diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-05-16 16:42:51 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-05-16 16:42:51 +0200 |
commit | 8bed94a028a88ed03354cba62a0cccaab6dcb61e (patch) | |
tree | 0360a64ea1bfc9c285d5ace0bf27f6f0579e905a /modules/by-name/ni/nix | |
parent | flake: Rename `nixVim` input to `nixvim` (diff) | |
download | nixos-config-8bed94a028a88ed03354cba62a0cccaab6dcb61e.zip |
flake: Pack arguments in attribute sets
This avoids having to change 3+ files, if you need to add a new argument.
Diffstat (limited to '')
-rw-r--r-- | modules/by-name/ni/nix/module.nix | 9 | ||||
-rw-r--r-- | modules/by-name/ni/nixpkgs/config.nix | 4 | ||||
-rw-r--r-- | modules/by-name/ni/nixpkgs/module.nix | 35 |
3 files changed, 39 insertions, 9 deletions
diff --git a/modules/by-name/ni/nix/module.nix b/modules/by-name/ni/nix/module.nix index 29ba4080..0072164f 100644 --- a/modules/by-name/ni/nix/module.nix +++ b/modules/by-name/ni/nix/module.nix @@ -10,10 +10,9 @@ { pkgs, # flakes - nixpkgs_as_input, - templates, self, system, + externalDependencies, ... }: { # TODO(@bpeetz): Modularize <2025-02-08> @@ -25,9 +24,9 @@ channel.enable = false; registry = { - nixpkgs.flake = nixpkgs_as_input; + nixpkgs.flake = self.inputs.nixpkgs; n.flake = - nixpkgs_as_input + self.inputs.nixpkgs // { # Otherwise nixpkgs's config and overlays are not available: @@ -36,7 +35,7 @@ legacyPackages."${system}" = pkgs; }; - t.flake = templates; + t.flake = externalDependencies.templates; my_flake.flake = self; m.flake = self; diff --git a/modules/by-name/ni/nixpkgs/config.nix b/modules/by-name/ni/nixpkgs/config.nix index 0d99336c..ea8f3c45 100644 --- a/modules/by-name/ni/nixpkgs/config.nix +++ b/modules/by-name/ni/nixpkgs/config.nix @@ -9,11 +9,11 @@ # If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { cfg, - myPkgs, lib, + packageSets, ... }: let - myPkgsOverlay = self: super: myPkgs; + myPkgsOverlay = self: super: packageSets.soispha; in { nixpkgs = { hostPlatform = cfg.systemName; diff --git a/modules/by-name/ni/nixpkgs/module.nix b/modules/by-name/ni/nixpkgs/module.nix index 07beae3e..fcde9505 100644 --- a/modules/by-name/ni/nixpkgs/module.nix +++ b/modules/by-name/ni/nixpkgs/module.nix @@ -10,8 +10,9 @@ { lib, config, + packageSets, ... -} @ args: let +}: let cfg = config.soispha.nixpkgs; in { options.soispha.nixpkgs = { @@ -22,5 +23,35 @@ in { type = lib.types.str; }; }; - config = lib.mkIf cfg.enable (import ./config.nix (args // {inherit cfg;})); + config = let + myPkgsOverlay = self: super: packageSets.soispha; + in + lib.mkIf cfg.enable + { + nixpkgs = { + hostPlatform = cfg.systemName; + + overlays = [ + myPkgsOverlay + ]; + + config = { + # TODO: this fails because of the root tempsize, which should be increased + # contentAddressedByDefault = true; + + hostSystem = cfg.systemName; + + allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "pypemicro" # required by pynitrokey + + # TODO(@bpeetz): Allow moving them to their respective module. <2025-04-25> + "steam" + "steam-unwrapped" + "steam-original" + "steam-run" + ]; + }; + }; + }; } |