nix settings: unify for NixOS and nix-darwin
moved into a common module
This commit is contained in:
parent
4976cea39d
commit
f08a7540ef
4 changed files with 42 additions and 22 deletions
34
common/nix-settings.nix
Normal file
34
common/nix-settings.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
# needs to be kept compatible to both NixOS and nix-darwin
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inputs = config.inputInjection.flake-inputs;
|
||||
unstable = inputs.nixos-unstable;
|
||||
in
|
||||
{
|
||||
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;
|
||||
};
|
||||
nix.settings = builtins.mapAttrs (_: lib.mkDefault) {
|
||||
# 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;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue