Lib/Nixos: Add common nix configuration
This commit is contained in:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user