diff --git a/config/base.nix b/config/base.nix index 34a22b2..29f4911 100644 --- a/config/base.nix +++ b/config/base.nix @@ -168,37 +168,38 @@ }; fonts = { fontconfig.enable = true; - packages = let - customFonts = pkgs.stdenvNoCC.mkDerivation { - name = "custom-fonts"; - src = inputs.fonts; - installPhase = '' - mkdir -p $out/share/fonts - find $src -type f \( \ - -name "*.ttf" -o \ - -name "*.otf" -o \ - -name "*.woff" -o \ - -name "*.woff2" \ - \) -exec cp {} $out/share/fonts/ \; - ''; + packages = + let + customFonts = pkgs.stdenvNoCC.mkDerivation { + name = "custom-fonts"; + src = inputs.fonts; + installPhase = '' + mkdir -p $out/share/fonts + find $src -type f \( \ + -name "*.ttf" -o \ + -name "*.otf" -o \ + -name "*.woff" -o \ + -name "*.woff2" \ + \) -exec cp {} $out/share/fonts/ \; + ''; + }; + in + builtins.attrValues { + inherit customFonts; + inherit (pkgs) + symbola + comic-neue + cascadia-code + corefonts + ; + inherit (pkgs.nerd-fonts) + caskaydia-cove + open-dyslexic + comic-shanns-mono + iosevka + agave + ; }; - in - builtins.attrValues { - inherit customFonts; - inherit (pkgs) - symbola - comic-neue - cascadia-code - corefonts - ; - inherit (pkgs.nerd-fonts) - caskaydia-cove - open-dyslexic - comic-shanns-mono - iosevka - agave - ; - }; }; powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; } diff --git a/config/stylix.nix b/config/stylix.nix index 7504b5b..3fabeb6 100644 --- a/config/stylix.nix +++ b/config/stylix.nix @@ -19,6 +19,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.stylix; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to apply Stylix theming for"; }; }; diff --git a/modules/apps/art.nix b/modules/apps/art.nix index cd97fe4..685bb79 100644 --- a/modules/apps/art.nix +++ b/modules/apps/art.nix @@ -42,6 +42,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.apps; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install art packages for"; }; }; diff --git a/modules/apps/dictionaries.nix b/modules/apps/dictionaries.nix index 8a47bdf..143dee8 100644 --- a/modules/apps/dictionaries.nix +++ b/modules/apps/dictionaries.nix @@ -23,6 +23,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.apps; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install dictionaries packages for"; }; }; diff --git a/modules/apps/gaming.nix b/modules/apps/gaming.nix index 1133cdc..c680e57 100644 --- a/modules/apps/gaming.nix +++ b/modules/apps/gaming.nix @@ -28,6 +28,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.apps; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install gaming packages for"; }; }; diff --git a/modules/apps/internet.nix b/modules/apps/internet.nix index 0ab4f84..ba7261a 100644 --- a/modules/apps/internet.nix +++ b/modules/apps/internet.nix @@ -33,6 +33,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.apps; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install internet packages for"; }; }; diff --git a/modules/apps/misc.nix b/modules/apps/misc.nix index 35b3629..0fc1103 100644 --- a/modules/apps/misc.nix +++ b/modules/apps/misc.nix @@ -11,6 +11,7 @@ users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.apps; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install misc packages for"; }; }; diff --git a/modules/apps/multimedia.nix b/modules/apps/multimedia.nix index 7a8b32f..8456c5f 100644 --- a/modules/apps/multimedia.nix +++ b/modules/apps/multimedia.nix @@ -35,6 +35,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.apps; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install multimedia packages for"; }; videoEditing = { @@ -42,6 +43,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.apps; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install video editing packages for"; }; }; diff --git a/modules/apps/music.nix b/modules/apps/music.nix index 0c0fabf..9b625b7 100644 --- a/modules/apps/music.nix +++ b/modules/apps/music.nix @@ -11,6 +11,7 @@ users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.apps; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install piano packages for"; }; }; diff --git a/modules/apps/office.nix b/modules/apps/office.nix index 0000ae4..5c2e766 100644 --- a/modules/apps/office.nix +++ b/modules/apps/office.nix @@ -11,6 +11,7 @@ users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.apps; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install office packages for"; }; }; diff --git a/modules/dev/cc.nix b/modules/dev/cc.nix index f4a1e14..b679fb0 100644 --- a/modules/dev/cc.nix +++ b/modules/dev/cc.nix @@ -23,6 +23,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.dev; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install C/C++ packages for"; }; }; diff --git a/modules/dev/docker.nix b/modules/dev/docker.nix index 0d889dc..5f0662d 100644 --- a/modules/dev/docker.nix +++ b/modules/dev/docker.nix @@ -20,6 +20,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.dev; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install Docker packages for"; }; }; diff --git a/modules/dev/emacs.nix b/modules/dev/emacs.nix index fac11e8..809aa0b 100644 --- a/modules/dev/emacs.nix +++ b/modules/dev/emacs.nix @@ -11,6 +11,7 @@ users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.dev; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install Emacs packages for"; }; }; diff --git a/modules/dev/go.nix b/modules/dev/go.nix index 17735b2..5554927 100644 --- a/modules/dev/go.nix +++ b/modules/dev/go.nix @@ -26,6 +26,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.dev; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install Go packages for"; }; }; diff --git a/modules/dev/haskell.nix b/modules/dev/haskell.nix index 0e54a0f..b142864 100644 --- a/modules/dev/haskell.nix +++ b/modules/dev/haskell.nix @@ -24,6 +24,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.dev; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install Haskell packages for"; }; }; diff --git a/modules/dev/javascript.nix b/modules/dev/javascript.nix index ac4e9e9..1f2fde7 100644 --- a/modules/dev/javascript.nix +++ b/modules/dev/javascript.nix @@ -18,6 +18,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.dev; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install JavaScript packages for"; }; }; diff --git a/modules/dev/julia.nix b/modules/dev/julia.nix index 42a3cd9..2d30333 100644 --- a/modules/dev/julia.nix +++ b/modules/dev/julia.nix @@ -17,6 +17,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.dev; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install Julia packages for"; }; }; diff --git a/modules/dev/nix.nix b/modules/dev/nix.nix index a671815..1e36ae8 100644 --- a/modules/dev/nix.nix +++ b/modules/dev/nix.nix @@ -24,6 +24,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.dev; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install Nix packages for"; }; }; diff --git a/modules/dev/python.nix b/modules/dev/python.nix index d405363..add8db7 100644 --- a/modules/dev/python.nix +++ b/modules/dev/python.nix @@ -36,6 +36,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.dev; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install Python packages for"; }; }; diff --git a/modules/dev/ruby.nix b/modules/dev/ruby.nix index 60910be..faf3193 100644 --- a/modules/dev/ruby.nix +++ b/modules/dev/ruby.nix @@ -18,6 +18,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.dev; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install Ruby packages for"; }; }; diff --git a/modules/dev/rust.nix b/modules/dev/rust.nix index 766cb7c..dc7dd4b 100644 --- a/modules/dev/rust.nix +++ b/modules/dev/rust.nix @@ -23,6 +23,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.dev; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install Rust packages for"; }; }; diff --git a/modules/dev/sh.nix b/modules/dev/sh.nix index 62b441e..0705932 100644 --- a/modules/dev/sh.nix +++ b/modules/dev/sh.nix @@ -22,6 +22,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.dev; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install shell scripting packages for"; }; }; diff --git a/modules/dev/zig.nix b/modules/dev/zig.nix index b74acda..9aec9df 100644 --- a/modules/dev/zig.nix +++ b/modules/dev/zig.nix @@ -20,6 +20,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.dev; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install Zig packages for"; }; }; diff --git a/modules/factories/mkscript.nix b/modules/factories/mkscript.nix index 640b7da..5828b6f 100644 --- a/modules/factories/mkscript.nix +++ b/modules/factories/mkscript.nix @@ -16,6 +16,7 @@ users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.scripts; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install this script for"; }; name = lib.mkOption { diff --git a/modules/services/printing.nix b/modules/services/printing.nix index f992e35..e8f50aa 100644 --- a/modules/services/printing.nix +++ b/modules/services/printing.nix @@ -17,6 +17,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.services; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install printing packages for"; }; }; diff --git a/modules/shell/config.nix b/modules/shell/config.nix index ace9ad2..5f72291 100644 --- a/modules/shell/config.nix +++ b/modules/shell/config.nix @@ -18,6 +18,7 @@ users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.shell; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to configure shell for"; }; }; diff --git a/modules/shell/exercism.nix b/modules/shell/exercism.nix index dcb3fed..f421d7d 100644 --- a/modules/shell/exercism.nix +++ b/modules/shell/exercism.nix @@ -11,6 +11,7 @@ users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.shell; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install Exercism for"; }; }; diff --git a/modules/shell/multimedia.nix b/modules/shell/multimedia.nix index 2bb17eb..c74038f 100644 --- a/modules/shell/multimedia.nix +++ b/modules/shell/multimedia.nix @@ -11,6 +11,7 @@ users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.shell; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install multimedia shell tools for"; }; }; diff --git a/modules/shell/tools.nix b/modules/shell/tools.nix index adba415..0cecdbc 100644 --- a/modules/shell/tools.nix +++ b/modules/shell/tools.nix @@ -14,6 +14,7 @@ in users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.shell; + merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install shell tools for"; }; }; diff --git a/parts/core.nix b/parts/core.nix index 7c9a5c5..fed2a77 100644 --- a/parts/core.nix +++ b/parts/core.nix @@ -237,6 +237,13 @@ in }) (inputs.self.lib.normalizeUsers users) ); getFirstUser = users: if builtins.isString users then users else (builtins.head users); + mergeUsersOption = + lib: _loc: defs: + let + normalize = users: if builtins.isString users then [ users ] else users; + allUsers = lib.foldl' (acc: def: acc ++ (normalize def.value)) [ ] defs; + in + lib.unique allUsers; }; }; }