nixos/modules/nix.nix
2023-10-08 21:05:21 -04:00

65 lines
1.3 KiB
Nix

inputs:
{
pkgs,
lib,
config,
...
}:
{
#
# Flake registry and $NIX_PATH pinning
#
nix.registry = lib.pipe inputs [
(lib.filterAttrs (_: lib.isType "flake"))
(lib.mapAttrs (_: flake: { inherit flake; }))
(x: x // { nixpkgs.flake = inputs.unstable; })
];
environment.etc =
lib.mapAttrs'
(name: value: {
name = "nix/path/${name}";
value.source = value.flake;
})
config.nix.registry;
nix.nixPath = [ "/etc/nix/path" ];
#
# Ignore global registry
#
nix.settings.flake-registry = "";
#
# Use nix directly from master
#
nix.package = inputs.nix.packages.${pkgs.system}.default;
#
# Other nix settings
#
nix.settings = {
experimental-features = [
"auto-allocate-uids"
"ca-derivations"
"cgroups"
"daemon-trust-override"
"dynamic-derivations"
"fetch-closure"
"flakes"
"nix-command"
"no-url-literals"
"parse-toml-timestamps"
"read-only-local-store"
"recursive-nix"
"repl-flake"
];
auto-optimise-store = true;
warn-dirty = false;
#
# Use for testing
#
#allow-import-from-derivation = false;
trusted-users = [ "root" ];
allowed-users = [ "@wheel" ];
use-xdg-base-directories = true;
auto-allocate-uids = true;
};
_file = ./nix.nix;
}