2024-03-21 22:02:12 +03:00
|
|
|
{ pkgs, ... }: {
|
|
|
|
environment.variables = {
|
2024-05-04 23:15:57 +03:00
|
|
|
# Allow running of proprietary software.
|
2024-03-21 22:02:12 +03:00
|
|
|
NIXPKGS_ALLOW_UNFREE = "1";
|
2024-05-04 23:15:57 +03:00
|
|
|
|
|
|
|
# I use this env variable to get currently running architecture.
|
|
|
|
NIX_CURRENT_SYSTEM = "${pkgs.stdenv.system}";
|
2024-03-21 22:02:12 +03:00
|
|
|
};
|
2024-05-04 23:15:57 +03:00
|
|
|
|
|
|
|
# Allow installation of proprietary software.
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
|
|
|
# Deduplicate store automatically. Slows down switches a bit, but saves space.
|
2024-03-04 00:34:39 +03:00
|
|
|
nix.settings.auto-optimise-store = true;
|
2024-05-04 23:15:57 +03:00
|
|
|
|
|
|
|
# Extra configuration line-by-line:
|
|
|
|
# 1. Allow use of flakes.
|
|
|
|
# 2. When running GC, keep .drv files.
|
|
|
|
# 3. When running GC, keep build dependencies.
|
|
|
|
# 4. Run GC automatically when there's a 50 GB or less free space.
|
2024-03-04 00:34:39 +03:00
|
|
|
nix.extraOptions = ''
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
keep-derivations = true
|
|
|
|
keep-outputs = true
|
2024-06-23 00:14:13 +03:00
|
|
|
min-free = ${toString (50 * 1000 * 1000 * 1000)}
|
2024-03-04 00:34:39 +03:00
|
|
|
'';
|
2024-03-09 19:42:03 +03:00
|
|
|
|
2024-05-04 23:15:57 +03:00
|
|
|
# NOTE: Currently I run GC completely, but this setting (put above near min-free)
|
|
|
|
# can stop GC when you hit 101 GB of free space available.
|
2024-06-22 23:34:03 +03:00
|
|
|
# max-free = ${toString 101 * 1024 * 1024 * 1024}
|
2024-05-04 23:15:57 +03:00
|
|
|
|
|
|
|
# NOTE: Enable this if you want to run GC on schedule. I instead use `min-free`.
|
2024-03-04 00:34:39 +03:00
|
|
|
# nix.gc = {
|
|
|
|
# automatic = true;
|
|
|
|
# dates = "weekly";
|
|
|
|
# options = "--delete-older-than 30d";
|
|
|
|
# persistent = true;
|
|
|
|
# };
|
|
|
|
}
|