From 893de326af2966d40853c856672c4372b0c01ebd Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 6 Jan 2026 17:11:15 +0900 Subject: [PATCH] flake.nix: allow disabling defaults for `nixosConfig` func --- flake.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 3d3b1d2..3c2ed6a 100644 --- a/flake.nix +++ b/flake.nix @@ -80,7 +80,13 @@ nixpkgs: name: configurationPath: - extraArgs: + extraArgs@{ + specialArgs ? { }, + modules ? [ ], + overlays ? [ ], + enableDefaults ? true, + ... + }: lib.nixosSystem (lib.recursiveUpdate (let system = "x86_64-linux"; @@ -91,13 +97,14 @@ inherit unstablePkgs inputs; values = import ./values.nix; fp = path: ./${path}; - } // extraArgs.specialArgs or { }; + } // specialArgs; modules = [ configurationPath + ] ++ (lib.optionals enableDefaults [ sops-nix.nixosModules.sops inputs.roowho2.nixosModules.default - ] ++ extraArgs.modules or []; + ]) ++ modules; pkgs = import nixpkgs { inherit system; @@ -106,10 +113,10 @@ "nvidia-x11" "nvidia-settings" ]; - overlays = [ + overlays = (lib.optionals enableDefaults [ # Global overlays go here inputs.roowho2.overlays.default - ] ++ extraArgs.overlays or [ ]; + ]) ++ overlays; }; }) (builtins.removeAttrs extraArgs [