1
Fork 0
satellite/hosts/nixos/common/global/nix.nix

60 lines
1.3 KiB
Nix
Raw Normal View History

2024-08-27 21:32:51 +02:00
{
config,
lib,
pkgs,
inputs,
...
}:
{
2023-01-10 02:38:06 +01:00
nix = {
# Flake support and whatnot
2024-07-26 20:18:26 +02:00
package = pkgs.lix;
2023-01-10 02:38:06 +01:00
# Weekly clean up the store, I think
gc = {
automatic = true;
dates = "weekly";
};
# ~~Protect nix shell from garbage collection~~
# This was taking too much storage
# extraOptions = ''
# keep-outputs = true
# keep-derivations = true
# '';
# https://nixos.wiki/wiki/Storage_optimization
2023-01-10 02:38:06 +01:00
optimise.automatic = true;
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
# 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
2023-12-10 12:55:54 +01:00
experimental-features = [
"nix-command"
"flakes"
2024-07-26 20:18:26 +02:00
# "repl-flake"
"auto-allocate-uids"
# "configurable-impure-env"
2023-12-10 12:55:54 +01:00
];
2023-01-10 02:38:06 +01:00
# Disable warning when rebuilding before commiting
warn-dirty = false;
# Deduplicate and optimize nix store
auto-optimise-store = true;
2024-08-27 21:32:51 +02:00
trusted-users = [
"root"
"@wheel"
];
2023-01-10 02:38:06 +01:00
};
};
}