dotfiles.nix/nixos/common/global/nix.nix

35 lines
949 B
Nix
Raw Normal View History

2024-01-14 06:29:18 +08:00
{
2024-08-08 09:02:42 +08:00
config,
inputs,
lib,
...
}: {
2024-01-14 06:29:18 +08:00
nix = {
gc = {
# Automatically run the garbage collector an a specified time.
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
2024-01-14 06:29:18 +08:00
};
# This will add each flake input as a registry
# To make nix commands consistent with your flake
2024-08-08 09:02:42 +08:00
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
2024-01-14 06:29:18 +08:00
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Deduplicate and optimize nix store
auto-optimise-store = true;
2024-01-22 20:03:37 +08:00
# Additional rights when connecting to the Nix daemon
trusted-users = [
"sajenim"
];
2024-01-14 06:29:18 +08:00
};
};
}