diff --git a/server-config/configuration.nix b/server-config/configuration.nix index a318eda..d04eca0 100644 --- a/server-config/configuration.nix +++ b/server-config/configuration.nix @@ -29,22 +29,15 @@ # Nix daemon config nix = { - # Automate garbage collection - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; - }; - package = pkgs.nixVersions.stable; - extraOptions = '' - # https://github.com/nix-community/nix-direnv#home-manager - keep-outputs = true - keep-derivations = true - # Enable the nix 2.0 CLI and flakes support feature-flags - experimental-features = nix-command flakes - ''; + # This will add each flake input as a registry + # To make nix3 commands consistent with your flake + registry = lib.mapAttrs (_: value: { flake = value; }) inputs; + + # This will additionally add your inputs to the system's legacy channels + # Making legacy nix commands consistent as well, awesome! + nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; settings = { # Automate `nix store --optimise` @@ -52,6 +45,21 @@ # Required by Cachix to be used as non-root user trusted-users = [ "root" "alice" ]; + + experimental-features = [ "nix-command" "flakes" ]; + }; + + extraOptions = '' + # https://github.com/nix-community/nix-direnv#home-manager + keep-outputs = true + keep-derivations = true + ''; + + # Automate garbage collection + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; }; };