diff options
Diffstat (limited to 'modules/home')
-rw-r--r-- | modules/home/default.nix | 11 | ||||
-rw-r--r-- | modules/home/firefox.nix | 29 | ||||
-rw-r--r-- | modules/home/gtk-bookmarks.nix | 10 | ||||
-rw-r--r-- | modules/home/initial-home-setup.nix | 2 | ||||
-rw-r--r-- | modules/home/resources/activation-scripts/clone-repos.sh | 8 | ||||
-rw-r--r-- | modules/home/resources/firefox/userChrome.css | 11 | ||||
-rw-r--r-- | modules/home/theme-st.nix | 22 | ||||
-rw-r--r-- | modules/home/theme.nix | 30 | ||||
-rw-r--r-- | modules/home/userdirs.nix | 5 |
9 files changed, 101 insertions, 27 deletions
diff --git a/modules/home/default.nix b/modules/home/default.nix index b44f360..9abf1b5 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,12 +1,11 @@ -{ lib, userDetails, ... }: { +{ lib, userDetails, homeStateVersion, ... }: { home = { username = userDetails.username; - homeDirectory = userDetails.home.root; - stateVersion = "24.05"; + homeDirectory = userDetails.home; + stateVersion = homeStateVersion; }; imports = [ - ./alacritty.nix #./chrome.nix ./firefox.nix ./git.nix @@ -14,11 +13,13 @@ ./htop.nix ./initial-home-setup.nix ./pcmanfm.nix # TODO mk name changeable & doesn't seem to work right now + ./theme-st.nix ./theme.nix + ./userdirs.nix ./wallpapers.nix ]; - alacritty.enable = lib.mkDefault true; + theme.st.enable = lib.mkDefault false; theme.mint.enable = lib.mkDefault true; wallpapers.enable = lib.mkDefault false; } diff --git a/modules/home/firefox.nix b/modules/home/firefox.nix index 5e015ff..30fd08a 100644 --- a/modules/home/firefox.nix +++ b/modules/home/firefox.nix @@ -1,29 +1,33 @@ { pkgs, userDetails, ... }: { programs.firefox = { - # TODO see if there is way to login to moz account in profile enable = true; - arkenfox = { - enable = true; - }; + arkenfox.enable = true; profiles = let search = { engines = { "Timmy Search" = { - urls = [{ template = "https://search.tjkeller.xyz/search?q={searchTerms}"; }]; # Don't know how to do w/ POST but I prefer GET anyways + urls = [{ + template = "https://search.tjkeller.xyz/search"; + params = [ { name = "q"; value = "{searchTerms}"; } ]; + }]; iconURI = "https://search.tjkeller.xyz/static/themes/simple/img/favicon.svg"; # TODO doesn't seem to work }; "Nix Packages" = { urls = [{ template = "https://search.nixos.org/packages"; - params = [ - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } - ]; + params = [ { name = "query"; value = "{searchTerms}"; } ]; }]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@np" ]; }; + "NixOS Options" = { + urls = [{ + template = "https://search.nixos.org/options"; + params = [ { name = "query"; value = "{searchTerms}"; } ]; + }]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@no" ]; + }; }; default = "Timmy Search"; privateDefault = "Timmy Search"; @@ -36,7 +40,7 @@ "0100"."0102"."browser.startup.page".value = 3; # 0=blank, 1=home, 2=last visited page, 3=resume previous session "0100"."0103"."browser.startup.homepage".enable = false; "0100"."0104"."browser.newtabpage.enabled".enable = false; - "2800"."2811"."privacy.clearOnShutdown.history".enable = false; + #"2800"."2811"."privacy.clearOnShutdown.history".enable = false; }; settings = { "browser.compactmode.show" = true; @@ -46,7 +50,7 @@ "app.normandy.first_run" = false; "browser.aboutConfig.showWarning" = false; # arkenfox does - "browser.download.dir" = userDetails.home.downloads; # FF will create this dir if it doesn't exist + #"browser.download.dir" = userDetails.userDirs.downloads; "browser.newtabpage.activity-stream.feeds.section.topstories" = false; "browser.newtabpage.activity-stream.feeds.topsites" = false; "browser.urlbar.suggest.topsites" = false; @@ -54,7 +58,6 @@ "dom.push.enabled" = false; # "extensions.pocket.enabled" = false; "general.smoothScroll" = false; - #identity.fxaccounts.account.device.name = "timmy’s Firefox on nixos"; # HOSTNAME }; workSettings = settings // { "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; # Use builtin dark theme instead of system theme diff --git a/modules/home/gtk-bookmarks.nix b/modules/home/gtk-bookmarks.nix index 067543d..24c6563 100644 --- a/modules/home/gtk-bookmarks.nix +++ b/modules/home/gtk-bookmarks.nix @@ -8,10 +8,10 @@ }; config = { - gtk.gtk3.bookmarks = with userDetails; [ - "file://${home.downloads} Downloads" - "file://${home.documents} Documents" - "file://${home.pictures} Pictures" - ] ++ config.additional-gtk-bookmarks; + gtk.gtk3.bookmarks = ( + lib.mapAttrsToList (name: path: + "file://${path} ${lib.toUpper (lib.substring 0 1 name)}${lib.substring 1 (-1) name}" + ) userDetails.userDirs + ) ++ config.additional-gtk-bookmarks; }; } diff --git a/modules/home/initial-home-setup.nix b/modules/home/initial-home-setup.nix index 046f5a5..4132386 100644 --- a/modules/home/initial-home-setup.nix +++ b/modules/home/initial-home-setup.nix @@ -16,7 +16,7 @@ run mimewiz -i # already verbose ''; createDirs = lib.hm.dag.entryAfter ["writeBoundary"] '' - run mkdir -p $VERBOSE_ARG "${userDetails.home.downloads}" + run mkdir -p $VERBOSE_ARG ${ lib.concatStringsSep " " (lib.attrValues userDetails.userDirs) } ''; }; } diff --git a/modules/home/resources/activation-scripts/clone-repos.sh b/modules/home/resources/activation-scripts/clone-repos.sh index 887968b..eaee4dc 100644 --- a/modules/home/resources/activation-scripts/clone-repos.sh +++ b/modules/home/resources/activation-scripts/clone-repos.sh @@ -3,8 +3,14 @@ server="https://git.tjkeller.xyz/" clonemissing() { + # pull and return if already existing + if [ -d "$2"/.git ]; then + run cd $VERBOSE_ARG "$2" + run git pull $VERBOSE_ARG || echo "$2: failed to pull from remote" + return + fi + # clone to $2 - [ -d "$2"/.git ] && return run mkdir -p $VERBOSE_ARG "$2" run git clone $VERBOSE_ARG "$server$1" "$2" diff --git a/modules/home/resources/firefox/userChrome.css b/modules/home/resources/firefox/userChrome.css index de0e112..624ab26 100644 --- a/modules/home/resources/firefox/userChrome.css +++ b/modules/home/resources/firefox/userChrome.css @@ -14,6 +14,17 @@ background: var(--toolbar-field-border-color) !important; } +/* Change background color of bookmarks toolbar */ +#PersonalToolbar { + background: var(--toolbox-bgcolor) !important; +} + +/* Adjust spacing of toolbar items */ +#PlacesToolbarItems { + gap: .35rem; + margin-block: .2rem; +} + /* Fix vertical spacing of tabs */ #TabsToolbar { margin-top: -1px; diff --git a/modules/home/theme-st.nix b/modules/home/theme-st.nix new file mode 100644 index 0000000..bc22791 --- /dev/null +++ b/modules/home/theme-st.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: { + options = { + theme.st = { + enable = lib.mkEnableOption "enables theming st with home manager"; + font = lib.mkOption { + type = lib.types.str; + default = "JetBrainsMonoNL Nerd Font Mono:size=12:antialias=true:autohint=true"; + }; + }; + }; + config = let + themed-st = pkgs.st.overrideAttrs (old: { + buildInputs = old.buildInputs or [] ++ [ pkgs.makeWrapper ]; + postInstall = old.postInstall or "" + '' + wrapProgram $out/bin/st \ + --add-flags '-f${config.theme.st.font}' + ''; + }); + in { + home.packages = [ themed-st ]; + }; +} diff --git a/modules/home/theme.nix b/modules/home/theme.nix index a1c4f9b..2288610 100644 --- a/modules/home/theme.nix +++ b/modules/home/theme.nix @@ -40,6 +40,30 @@ in { default = "CommitMono"; description = "default monospace font"; }; + gtk = { + name = lib.mkOption { + type = lib.types.str; + default = "sans-serif"; + description = "default gtk font"; + }; + size = lib.mkOption { + type = with lib.types; nullOr int; + default = null; + description = "default gtk font size"; + }; + }; + }; + theme.cursor = { + name = lib.mkOption { + type = lib.types.str; + default = "Adwaita"; + description = "gtk cursor theme"; + }; + size = lib.mkOption { + type = with lib.types; nullOr int; + default = null; + description = "gtk cursor size"; + }; }; }; @@ -55,10 +79,12 @@ in { name = transformColorValue config.theme.mint.icons.color; }; font = { - name = config.theme.font.sansSerif; + name = config.theme.font.gtk.name; + size = config.theme.font.gtk.size; }; cursorTheme = { - name = "Adwaita"; + name = config.theme.cursor.name; + size = config.theme.cursor.size; }; gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; }; diff --git a/modules/home/userdirs.nix b/modules/home/userdirs.nix new file mode 100644 index 0000000..58c1d59 --- /dev/null +++ b/modules/home/userdirs.nix @@ -0,0 +1,5 @@ +{ userDetails, ... }: { + xdg.userDirs = { + enable = true; + } // userDetails.userDirs; +} |