nixos/modules/nix.nix
2023-12-10 17:04:54 -05:00

61 lines
1.3 KiB
Nix

inputs:
{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.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"
"configurable-impure-env"
];
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
}