diff --git a/modules/nix.nix b/modules/nix.nix index af3190a..b4b3632 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -21,9 +21,6 @@ let in { nix = { - # nix with flake support - package = pkgs.nixFlakes; - registry = with inputs; { nixpkgs.flake = nixpkgs; nixpkgs-unstable.flake = nixpkgs-unstable; @@ -33,18 +30,20 @@ in "nixpkgs=${inputs.nixpkgs}" "nixpkgs-overlays=${overlaysCompat}" ]; - # Make sudoers trusted nix users - trustedUsers = [ "@wheel" ]; - # On-the-fly optimisation of nix store - autoOptimiseStore = true; - extraOptions = '' - experimental-features = nix-command flakes - '' + lib.optionalString config.sbruder.full '' + settings = { + # Make sudoers trusted nix users + trusted-users = [ "@wheel" ]; + + # On-the-fly optimisation of nix store + auto-optimise-store = true; + + experimental-features = "nix-command flakes"; + } // (lib.optionalAttrs config.sbruder.full { # Keep output of derivations with gc root - keep-outputs = true - keep-derivations = true - ''; + keep-outputs = true; + keep-derivations = true; + }); # Make nix build in background less noticeable daemonCPUSchedPolicy = "batch";