nix settings: unify for NixOS and nix-darwin

moved into a common module
This commit is contained in:
Trolli Schmittlauch 2024-04-07 02:09:46 +02:00
parent 4976cea39d
commit f08a7540ef
4 changed files with 42 additions and 22 deletions

View file

@ -13,6 +13,7 @@ in
imports = [
./packages.nix
./nitrokey.nix
./nix-settings.nix
];
services.davfs2.enable = true;
@ -221,27 +222,7 @@ in
# Enable all sysrq functions (useful to recover from some issues):
boot.kernel.sysctl."kernel.sysrq" = 1; # NixOS default: 16 (only the sync command)
nix = {
# expose all flake inputs through nix Path and registry
registry = (lib.mapAttrs (_: value: { flake = value; }) inputs) // {
nixpkgs.flake = inputs.nixpkgs;
};
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
# keep build-time deps around for offline-rebuilding
settings = {
# keep around all inputs necessary for offline-rebuilding the system
keep-outputs = true;
keep-derivations = true;
trusted-users = [ "spiollinux" ];
experimental-features = [
"nix-command"
"flakes"
"repl-flake"
];
# use all cores for building
cores = 0;
};
};
nix.settings.trusted-users = [ "spiollinux" ];
# override tmpdir for daemon
#systemd.services.nix-daemon.environment.TMPDIR = "/var/tmp";