diff options
author | Tim Keller <tjk@tjkeller.xyz> | 2025-08-30 12:31:28 -0500 |
---|---|---|
committer | Tim Keller <tjk@tjkeller.xyz> | 2025-08-30 12:31:28 -0500 |
commit | 9da942ba47d34210e86a1a709e802eda5c3b95db (patch) | |
tree | f7434c4b4c9b8e5271220c11f9b802815c3519c7 /home-manager | |
parent | c3c3d6f1fd19a5da015c9a9d3ae5c54f2d177be0 (diff) | |
download | nixos-9da942ba47d34210e86a1a709e802eda5c3b95db.tar.xz nixos-9da942ba47d34210e86a1a709e802eda5c3b95db.zip |
refactor users activation. refactor home manager config to match nixos conf and move tjkeller archetypes to users/timmy. update many of the exising home manager configs to be nicer and better organized. profile archetypes now include homeconfigs which can be enabled per user, and are setup using a new mkProfileArchetype function.
Diffstat (limited to 'home-manager')
-rw-r--r-- | home-manager/clone-repos.nix | 47 | ||||
-rw-r--r-- | home-manager/default.nix | 25 | ||||
-rw-r--r-- | home-manager/firefox.nix | 159 | ||||
-rw-r--r-- | home-manager/git.nix | 7 | ||||
-rw-r--r-- | home-manager/gtk-bookmarks.nix | 17 | ||||
-rw-r--r-- | home-manager/home-cleanup.nix | 3 | ||||
-rw-r--r-- | home-manager/htop.nix | 82 | ||||
-rw-r--r-- | home-manager/initial-home-setup.nix | 22 | ||||
-rw-r--r-- | home-manager/mint-theme.nix | 43 | ||||
-rw-r--r-- | home-manager/pcmanfm.nix | 17 | ||||
-rw-r--r-- | home-manager/qt-gtk-theme.nix | 15 | ||||
-rw-r--r-- | home-manager/resources/activation-scripts/clone-repos.sh | 17 | ||||
-rw-r--r-- | home-manager/theme-st.nix | 49 | ||||
-rw-r--r-- | home-manager/theme.nix | 101 | ||||
-rw-r--r-- | home-manager/userdirs.nix | 5 | ||||
-rw-r--r-- | home-manager/wallpapers.nix | 13 |
16 files changed, 302 insertions, 320 deletions
diff --git a/home-manager/clone-repos.nix b/home-manager/clone-repos.nix new file mode 100644 index 0000000..8499760 --- /dev/null +++ b/home-manager/clone-repos.nix @@ -0,0 +1,47 @@ +{ config, lib, pkgs, ... }: let + cfg = config.home._repos; + # TODO MAKE OPTIONS + server = "https://git.tjkeller.xyz/"; + docs = config.xdg.userDirs.documents; + dotConfig = config.xdg.configHome; + bin = "$HOME/.local/bin"; + cloneMissing = repo: source: target: ''clonemissing "${repo}" "${source}" "${target}"''; +in { + options.home._repos = { + enable = lib.mkEnableOption "clone git repos"; + desktop = lib.mkEnableOption "clone repos that are for desktop use"; + }; + + config = lib.mkIf cfg.enable { + # TODO look into xdg.configFile.<name> + home.activation = { + cloneRepos = lib.hm.dag.entryAfter ["writeBoundary"] ('' + export PATH="${pkgs.git}/bin:$PATH" + ${builtins.readFile ./resources/activation-scripts/clone-repos.sh} + '' + lib.strings.concatStringsSep "\n" ([ + (cloneMissing "${server}dotconfig" "${docs}/config" dotConfig) + (cloneMissing "${server}nixos" "${docs}/nixos" "") + (cloneMissing "${server}nvim" "${dotConfig}/nvim" "") + (cloneMissing "${server}zsh" "${dotConfig}/zsh" "") + ] ++ lib.optionals cfg.desktop [ + (cloneMissing "${server}scripts" "${docs}/scripts" bin) + (cloneMissing "${server}userscripts" "${docs}/userscripts" "") + (cloneMissing "${server}awesome" "${dotConfig}/awesome" "") + ])); + linkZshProfile = lib.hm.dag.entryAfter ["writeBoundary"] '' + run ln -sf $VERBOSE_ARG ${dotConfig}/zsh/zprofile $HOME/.zprofile + ''; + + # TODO look into xdg.mimeApps.defaultApplications + #mimewiz = lib.mkIf cfg.desktop (lib.hm.dag.entryAfter ["writeBoundary"] '' + # export PATH="${pkgs.xdg-utils}/bin:$PATH" + # export PATH="${dotConfig}/misc:$PATH" + # run mimewiz -i # already verbose + #''); + }; + #home.file.Zprofile = { + # source = "${dotConfig}/zsh/zprofile"; + # target = ".zprofile"; + #}; + }; +} diff --git a/home-manager/default.nix b/home-manager/default.nix index bcd99eb..26c97c2 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -1,25 +1,16 @@ -{ lib, userDetails, homeStateVersion, ... }: { - home = { - username = userDetails.username; - homeDirectory = lib.mkForce userDetails.home; - stateVersion = homeStateVersion; - }; - +{ imports = [ + ./clone-repos.nix ./firefox.nix - ./git.nix - ./gtk-bookmarks.nix + ./home-cleanup.nix ./htop.nix - ./initial-home-setup.nix - ./pcmanfm.nix # TODO mk name changeable & doesn't seem to work right now + ./mint-theme.nix + ./pcmanfm.nix + ./qt-gtk-theme.nix ./theme-st.nix - ./theme.nix - ./userdirs.nix ./wallpapers.nix ]; - theme.enable = lib.mkDefault true; - theme.st.enable = lib.mkDefault false; - theme.mint.enable = lib.mkDefault true; - wallpapers.enable = lib.mkDefault false; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; } diff --git a/home-manager/firefox.nix b/home-manager/firefox.nix index 8aa1af3..811b811 100644 --- a/home-manager/firefox.nix +++ b/home-manager/firefox.nix @@ -1,82 +1,89 @@ -{ lib, pkgs, userDetails, ... }: { - programs.firefox = { - enable = lib.mkDefault true; - arkenfox.enable = true; - profiles = let - search = { - engines = { - "Timmy Search" = { - 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 = "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"; - force = true; # Overwrite old - }; - userChrome = builtins.readFile ./resources/firefox/userChrome.css; - arkenfox = { - enable = true; - enableAllSections = true; - "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; - }; - settings = { - "browser.compactmode.show" = true; - "browser.uiCustomization.state" = builtins.readFile ./resources/firefox/uiCustomization.json; # Toolbar etc. - "browser.uidensity" = 1; # Compact - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; # userchrome - - "app.normandy.first_run" = false; - "browser.aboutConfig.showWarning" = false; # arkenfox does - #"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; - "devtools.toolbox.host" = "window"; - "dom.push.enabled" = false; # - "extensions.pocket.enabled" = false; - "general.smoothScroll" = false; +{ config, lib, pkgs, ... }: let + cfg = config.programs.firefox; + search = { + engines = { + "Timmy Search" = { + 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 }; - workSettings = settings // { - "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; # Use builtin dark theme instead of system theme + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ { name = "query"; value = "{searchTerms}"; } ]; + }]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; }; - in { - Personal = { - id = 0; - isDefault = true; - inherit search; - inherit userChrome; - inherit arkenfox; - inherit settings; + "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" ]; }; - Work = { - id = 1; - inherit search; - inherit userChrome; - inherit arkenfox; - settings = workSettings; + }; + default = "Timmy Search"; + privateDefault = "Timmy Search"; + force = true; # Overwrite old + }; + userChrome = builtins.readFile ./resources/firefox/userChrome.css; + arkenfox = { + enable = true; + enableAllSections = true; + "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; + }; + settings = { + "browser.compactmode.show" = true; + "browser.uiCustomization.state" = builtins.readFile ./resources/firefox/uiCustomization.json; # Toolbar etc. + "browser.uidensity" = 1; # Compact + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; # userchrome + + "app.normandy.first_run" = false; + "browser.aboutConfig.showWarning" = false; # arkenfox does + #"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; + "devtools.toolbox.host" = "window"; + "dom.push.enabled" = false; # + "extensions.pocket.enabled" = false; + "general.smoothScroll" = false; + }; + workSettings = settings // { + "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; # Use builtin dark theme instead of system theme + }; +in { + options.programs.firefox = { + _configure = lib.mkEnableOption "configure firefox profiles"; + }; + + config = lib.mkIf cfg._configure { + programs.firefox = { + enable = lib.mkDefault true; + arkenfox.enable = lib.mkDefault true; + profiles = { + Personal = { + id = 0; + isDefault = true; + inherit search; + inherit userChrome; + inherit arkenfox; + inherit settings; + }; + Work = { + id = 1; + inherit search; + inherit userChrome; + inherit arkenfox; + settings = workSettings; + }; }; }; }; diff --git a/home-manager/git.nix b/home-manager/git.nix deleted file mode 100644 index 9d15a90..0000000 --- a/home-manager/git.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ userDetails, ... }: { - programs.git = { - enable = true; - userName = userDetails.fullname; - userEmail = userDetails.email; - }; -} diff --git a/home-manager/gtk-bookmarks.nix b/home-manager/gtk-bookmarks.nix deleted file mode 100644 index 24c6563..0000000 --- a/home-manager/gtk-bookmarks.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ config, lib, userDetails, ... }: { - options = { - additional-gtk-bookmarks = lib.mkOption { - type = with lib.types; listOf str; - default = []; - description = "gtk bookmarks for file managers, etc."; - }; - }; - - config = { - 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/home-manager/home-cleanup.nix b/home-manager/home-cleanup.nix new file mode 100644 index 0000000..b124342 --- /dev/null +++ b/home-manager/home-cleanup.nix @@ -0,0 +1,3 @@ +{ config, ... }: { + gtk.gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; +} diff --git a/home-manager/htop.nix b/home-manager/htop.nix index 523fee8..36ccbac 100644 --- a/home-manager/htop.nix +++ b/home-manager/htop.nix @@ -1,38 +1,46 @@ -{ config, ... }: { - programs.htop.enable = true; - programs.htop.settings = { - fields = with config.lib.htop.fields; [ - PID - USER - 124 # EXE - PERCENT_CPU - PERCENT_MEM - STARTTIME - ELAPSED # time elapsed since process start - IO_READ_RATE - RBYTES # num read bytes - IO_WRITE_RATE - WBYTES # num written bytes - TIME - STIME # sys time - CSTIME # child sys time - NICE - STATE - PRIORITY - 125 # CWD - ]; - } // (with config.lib.htop; leftMeters [ - (bar "AllCPUs2") - (bar "CPU") - (bar "Memory") - (bar "DiskIO") - (bar "NetworkIO") - ]) // (with config.lib.htop; rightMeters [ - (text "Hostname") - (text "Clock") - (text "Uptime") - (text "Battery") - (text "LoadAverage") - (text "Tasks") - ]); +{ config, lib, ... }: let + cfg = config.programs.htop; +in { + options.programs.htop = { + _configure = lib.mkEnableOption "apply sensible defaults to htop"; + }; + + config = lib.mkIf cfg._configure { + programs.htop.enable = lib.mkDefault true; + programs.htop.settings = { + fields = with config.lib.htop.fields; [ + PID + USER + 124 # EXE + PERCENT_CPU + PERCENT_MEM + STARTTIME + ELAPSED # time elapsed since process start + IO_READ_RATE + RBYTES # num read bytes + IO_WRITE_RATE + WBYTES # num written bytes + TIME + STIME # sys time + CSTIME # child sys time + NICE + STATE + PRIORITY + 125 # CWD + ]; + } // (with config.lib.htop; leftMeters [ + (bar "AllCPUs2") + (bar "CPU") + (bar "Memory") + (bar "DiskIO") + (bar "NetworkIO") + ]) // (with config.lib.htop; rightMeters [ + (text "Hostname") + (text "Clock") + (text "Uptime") + (text "Battery") + (text "LoadAverage") + (text "Tasks") + ]); + }; } diff --git a/home-manager/initial-home-setup.nix b/home-manager/initial-home-setup.nix deleted file mode 100644 index 4132386..0000000 --- a/home-manager/initial-home-setup.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ config, lib, pkgs, userDetails, ... }: { - home.activation = { - cloneRepos = lib.hm.dag.entryAfter ["writeBoundary"] '' - export PATH="${config.home.path}/bin:$PATH" - ${builtins.readFile ./resources/activation-scripts/clone-repos.sh} - ''; - linkZshProfile = lib.hm.dag.entryAfter ["writeBoundary"] '' - run ln -sf $VERBOSE_ARG $HOME/.config/zsh/zprofile $HOME/.zprofile - ''; - cleanupHome = lib.hm.dag.entryAfter ["writeBoundary"] '' - run rm -f $VERBOSE_ARG $HOME/{.zcompdump,.zshrc,.zsh_history,.bash_history} - ''; - mimewiz = lib.hm.dag.entryAfter ["writeBoundary"] '' - export PATH="${pkgs.xdg-utils}/bin:$PATH" - export PATH="$HOME/.local/bin/misc:$PATH" - run mimewiz -i # already verbose - ''; - createDirs = lib.hm.dag.entryAfter ["writeBoundary"] '' - run mkdir -p $VERBOSE_ARG ${ lib.concatStringsSep " " (lib.attrValues userDetails.userDirs) } - ''; - }; -} diff --git a/home-manager/mint-theme.nix b/home-manager/mint-theme.nix new file mode 100644 index 0000000..a77be6a --- /dev/null +++ b/home-manager/mint-theme.nix @@ -0,0 +1,43 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.gtk._mintTheme; # gtk.theme type is null or submodule under the hood so gtk.theme._mint, etc. can't be used + transformColorValue = color: dark: + "Mint-Y" + lib.optionalString dark "-Dark" + + lib.optionalString (color != "Green") ("-" + color) + ; +in { + options.gtk._mintTheme = { + enable = lib.mkEnableOption "enables mint theme"; + color = lib.mkOption { + type = lib.types.enum [ + "Aqua" "Blue" "Green" "Grey" "Orange" + "Pink" "Purple" "Red" "Sand" "Teal" + ]; + default = "Green"; + description = "mint-y theme color"; + }; + dark = lib.mkEnableOption "whether to use dark variant of mint theme"; + icons.color = lib.mkOption { + type = lib.types.enum [ + "Aqua" "Blue" "Green" "Grey" "Orange" "Pink" "Purple" "Red" + "Sand" "Teal" + ]; + default = "Aqua"; + description = "mint-y icons color eg. 'Aqua' or 'Red'"; + }; + }; + + config = lib.mkIf cfg.enable { + gtk = { + enable = true; + theme = { + package = pkgs.mint-themes; + name = transformColorValue cfg.color cfg.dark; + }; + iconTheme = { + package = pkgs.mint-y-icons; + name = transformColorValue cfg.icons.color false; + }; + }; + }; +} diff --git a/home-manager/pcmanfm.nix b/home-manager/pcmanfm.nix index 3c70521..a99fb15 100644 --- a/home-manager/pcmanfm.nix +++ b/home-manager/pcmanfm.nix @@ -1,6 +1,15 @@ -{ - home.file.pcmanfm-root = { - target = ".local/share/file-manager/actions/root.desktop"; - source = ./resources/pcmanfm/root.desktop; +{ config, lib, ... }: let + cfg = config.programs._pcmanfm.openAsRootOption; +in { + options.programs._pcmanfm.openAsRootOption = { + enable = lib.mkEnableOption "enable 'open as root' option in pcmanfm right-click menu"; + }; + + config = lib.mkIf cfg.enable { + home.file.pcmanfm-root = { + target = ".local/share/file-manager/actions/root.desktop"; + # FIXME this action uses an absolute path pls fix + source = ./resources/pcmanfm/root.desktop; + }; }; } diff --git a/home-manager/qt-gtk-theme.nix b/home-manager/qt-gtk-theme.nix new file mode 100644 index 0000000..2e53ccc --- /dev/null +++ b/home-manager/qt-gtk-theme.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.qt._gtkPlatformTheme; +in { + options.qt._gtkPlatformTheme = { + enable = lib.mkEnableOption "use gtk theme in qt"; + }; + + config = lib.mkIf cfg.enable { + qt = { + enable = lib.mkDefault true; + platformTheme.name = "gtk3"; + }; + }; +} diff --git a/home-manager/resources/activation-scripts/clone-repos.sh b/home-manager/resources/activation-scripts/clone-repos.sh index eaee4dc..adf8fd7 100644 --- a/home-manager/resources/activation-scripts/clone-repos.sh +++ b/home-manager/resources/activation-scripts/clone-repos.sh @@ -1,7 +1,5 @@ #!/bin/sh -server="https://git.tjkeller.xyz/" - clonemissing() { # pull and return if already existing if [ -d "$2"/.git ]; then @@ -10,21 +8,12 @@ clonemissing() { return fi - # clone to $2 + # clone $1 to $2 run mkdir -p $VERBOSE_ARG "$2" - run git clone $VERBOSE_ARG "$server$1" "$2" + run git clone $VERBOSE_ARG "$1" "$2" - # link to $3 + # link files to $3 [ -z "$3" ] && return run mkdir -p $VERBOSE_ARG "$3" run ln -sf $VERBOSE_ARG "$2"/* "$3" } - -# # repo # clone to # link to -clonemissing scripts $HOME/docs/src/scripts $HOME/.local/bin -clonemissing dotconfig $HOME/docs/src/config $HOME/.config -clonemissing userscripts $HOME/docs/src/userscripts '' -clonemissing nixos $HOME/docs/src/nixos '' -clonemissing awesome $HOME/.config/awesome '' -clonemissing nvim $HOME/.config/nvim '' -clonemissing zsh $HOME/.config/zsh '' diff --git a/home-manager/theme-st.nix b/home-manager/theme-st.nix index 0a06cd0..aa4ddbb 100644 --- a/home-manager/theme-st.nix +++ b/home-manager/theme-st.nix @@ -1,22 +1,41 @@ -{ config, lib, pkgs, ... }: { - options = { - theme.st = { - enable = lib.mkEnableOption "enables theming st with home manager"; - font = lib.mkOption { +{ config, lib, pkgs, ... }: let + cfg = config.programs._st; + generateXftFontString = name: attrs: + name + lib.optionalString lib.attrIsEmpty attrs ( + ":" + builtins.concatStringsSep ":" ( + lib.mapAttrsToList (key: value: "${key}=${value}") attrs + ) + ) + ; + themed-st = pkgs.st.overrideAttrs (old: { + buildInputs = old.buildInputs or [] ++ [ pkgs.makeWrapper ]; + postInstall = old.postInstall or "" + '' + wrapProgram $out/bin/st \ + --add-flags '-f"${generateXftFontString cfg.font.name cfg.font.attrs}"' + ''; + }); +in { + options.programs._st = { + enable = lib.mkEnableOption "enables theming st with home manager"; + font = { + name = lib.mkOption { type = lib.types.str; - default = "JetBrainsMonoNL Nerd Font Mono:size=12:antialias=true:autohint=true"; + example = "JetBrainsMonoNL Nerd Font Mono"; + default = "monospace"; + }; + attrs = { + type = lib.types.attrs; + default = {}; + example = { + 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 lib.mkIf config.theme.enable { + + config = lib.mkIf cfg.enable { home.packages = [ themed-st ]; }; } diff --git a/home-manager/theme.nix b/home-manager/theme.nix deleted file mode 100644 index 9e4edae..0000000 --- a/home-manager/theme.nix +++ /dev/null @@ -1,101 +0,0 @@ -{ config, lib, pkgs, ... }: -let - transformColorValue = color : - if color == "Green" then "Mint-Y" - else if color == "Dark-Green" then "Mint-Y-Dark" - else "Mint-Y-${color}" - ; -in { - options = { - theme.enable = lib.mkEnableOption "enables theming"; - theme.mint = { - enable = lib.mkEnableOption "enables mint theme"; - # TODO add theme.dark option instead of specifying Dark-Color - theme.color = lib.mkOption { - type = lib.types.enum [ - "Aqua" "Blue" "Green" "Grey" "Orange" "Pink" "Purple" "Red" - "Sand" "Teal" "Dark-Aqua" "Dark-Blue" "Dark-Green" - "Dark-Grey" "Dark-Orange" "Dark-Pink" "Dark-Purple" - "Dark-Red" "Dark-Sand" "Dark-Teal" - ]; - default = "Dark-Aqua"; - description = "mint-y theme color eg. 'Dark-Aqua' or 'Red'"; - }; - icons.color = lib.mkOption { - type = lib.types.enum [ - "Aqua" "Blue" "Green" "Grey" "Orange" "Pink" "Purple" "Red" - "Sand" "Teal" - ]; - default = "Aqua"; - description = "mint-y icons color eg. 'Aqua' or 'Red'"; - }; - }; - theme.font = { - sansSerif = lib.mkOption { - type = lib.types.str; - default = "Inter"; - description = "default sans serif font"; - }; - monospace = lib.mkOption { - type = lib.types.str; - 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"; - }; - }; - }; - - config = lib.mkIf config.theme.enable { - gtk = { - enable = true; - theme = lib.mkIf config.theme.mint.enable { - package = pkgs.mint-themes; - name = transformColorValue config.theme.mint.theme.color; - }; - iconTheme = lib.mkIf config.theme.mint.enable { - package = pkgs.mint-y-icons; - name = transformColorValue config.theme.mint.icons.color; - }; - font = { - name = config.theme.font.gtk.name; - size = config.theme.font.gtk.size; - }; - cursorTheme = { - name = config.theme.cursor.name; - size = config.theme.cursor.size; - }; - gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; - }; - qt = { - enable = true; - platformTheme.name = "gtk3"; - }; - fonts.fontconfig.defaultFonts = { - sansSerif = [ config.theme.font.sansSerif ]; - monospace = [ config.theme.font.monospace ]; - }; - }; -} diff --git a/home-manager/userdirs.nix b/home-manager/userdirs.nix deleted file mode 100644 index 58c1d59..0000000 --- a/home-manager/userdirs.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ userDetails, ... }: { - xdg.userDirs = { - enable = true; - } // userDetails.userDirs; -} diff --git a/home-manager/wallpapers.nix b/home-manager/wallpapers.nix index d7e067a..de64d76 100644 --- a/home-manager/wallpapers.nix +++ b/home-manager/wallpapers.nix @@ -1,10 +1,13 @@ -{ lib, config, pkgs, ... }: { - options = { - wallpapers.enable = lib.mkEnableOption "enables all wallpapers"; +{ lib, config, pkgs, ... }: let + cfg = config.programs._seasonalwallpaper.wallpapers; +in { + options.programs._seasonalwallpaper.wallpapers = { + download = lib.mkEnableOption "enables all wallpapers"; }; - config = lib.mkIf config.wallpapers.enable { - home.file.".local/share/wallpaper" = { + config = lib.mkIf cfg.download { + home.file.wallpapers = { + target = ".local/share/wallpaper"; source = pkgs.fetchzip { url = "https://tjkeller.xyz/permalinks/wallpapers.tar"; hash = "sha256-lhj9wUMZfd0XOrUtWY9HB64oXrS/EjsvsaJHzu4ucFg="; |