1

Lib/Nixos: Add common nix configuration

This commit is contained in:
2026-03-24 11:30:22 +01:00
parent d61e6f8b9c
commit 8263fe01eb

View File

@ -4,6 +4,26 @@
lib,
...
}: {
# Common nix daemon settings shared between NixOS and nix-darwin.
# Darwin additionally needs nix.enable = true.
mkCommonNixSettings = username: {
enable = true;
package = pkgs.nixVersions.stable;
extraOptions = ''
experimental-features = nix-command flakes pipe-operators
'';
settings.trusted-users = ["root" username];
gc.automatic = false;
gc.options = "--delete-older-than 5d";
settings.auto-optimise-store = true;
optimise.automatic = true;
registry = lib.mapAttrs' (n: v: lib.nameValuePair n {flake = v;}) inputs;
nixPath = [
"nixpkgs=${inputs.nixpkgs.outPath}"
"home-manager=${inputs.home-manager.outPath}"
];
};
mkNixosConfigWithHomeManagerModule = {
system,
mylib,