From 8bed94a028a88ed03354cba62a0cccaab6dcb61e Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 16 May 2025 16:42:51 +0200 Subject: flake: Pack arguments in attribute sets This avoids having to change 3+ files, if you need to add a new argument. --- modules/by-name/ni/nix/module.nix | 9 ++++----- modules/by-name/ni/nixpkgs/config.nix | 4 ++-- modules/by-name/ni/nixpkgs/module.nix | 35 +++++++++++++++++++++++++++++++++-- modules/by-name/ri/river/module.nix | 4 ++-- 4 files changed, 41 insertions(+), 11 deletions(-) (limited to 'modules/by-name') 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 . { 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" + ]; + }; + }; + }; } diff --git a/modules/by-name/ri/river/module.nix b/modules/by-name/ri/river/module.nix index 63e25f62..33c8a713 100644 --- a/modules/by-name/ri/river/module.nix +++ b/modules/by-name/ri/river/module.nix @@ -10,9 +10,9 @@ { config, lib, - qmk_firmware, system, pkgs, + externalBinaries, ... }: let cfg = config.soispha.programs.river; @@ -176,7 +176,7 @@ in { }; config = lib.mkIf cfg.enable { - services.udev.packages = lib.mkIf cfg.unicodeInput.enable [qmk_firmware.packages.${system}.qmk_unicode_type]; + services.udev.packages = lib.mkIf cfg.unicodeInput.enable [externalBinaries.qmk_firmware.packages.${system}.qmk_unicode_type]; home-manager.users.soispha = { home.sessionVariables = { -- cgit 1.4.1