nixdots/system/nix/default.nix

44 lines
1.5 KiB
Nix
Raw Normal View History

2024-03-21 22:08:56 +00:00
{ pkgs, ... }:
2024-02-24 21:24:22 +00:00
{
2024-03-21 22:08:56 +00:00
imports = [
./cachix.nix
2024-03-22 14:17:57 +00:00
./gc.nix
2024-03-21 22:08:56 +00:00
];
2024-03-21 20:47:25 +00:00
system.autoUpgrade.enable = false;
2024-02-24 21:24:22 +00:00
nix = {
settings = {
# enable flakes support
experimental-features = [ "nix-command" "flakes" ];
2024-03-21 20:47:25 +00:00
2024-03-22 14:17:57 +00:00
# Keep the built outputs of derivations in Nix store, even if the package is no longer needed
# - prevents the need to rebuild/redownload if it becomes a dependency again
# - helps with debugging or reverting to previous state
2024-03-21 20:47:25 +00:00
keep-outputs = true;
2024-03-22 14:17:57 +00:00
# Keep the derivations themselves too. A derivation describes how to build a package.
# - allows inspecting the build process of a package for debugging or educational purposes
# - allows rebuilding a package from its exact specification without having to fetch again
# - ensures we can reproduce a build even if the original online source goes down/changes
2024-03-21 20:47:25 +00:00
keep-derivations = true;
2024-03-21 22:30:05 +00:00
# Give these users/groups additional rights when connecting to the Nix daemon
# like specifying extra binary caches
trusted-users = [ "root" "@wheel" ];
2024-04-04 21:59:46 +00:00
# Tell nix to use xdg base directories
# If you're just setting this, you will need to move the directories
# manually, nix won't do it for you:
# - mv "$HOME/.nix-defexpr" "$XDG_STATE_HOME/nix/defexpr"
# - mv "$HOME/.nix-profile" "$XDG_STATE_HOME/nix/profile"
use-xdg-base-directories = true;
2024-02-24 21:24:22 +00:00
};
};
nixpkgs.config.allowUnfree = true;
# Git is needed for flakes
2024-03-21 22:08:56 +00:00
environment.systemPackages = [ pkgs.git ];
2024-02-24 21:24:22 +00:00
}