mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-25 13:45:37 +00:00
add gc for home-manager
move gc options into nixpkgs file
This commit is contained in:
parent
203bb6a13a
commit
3a4568bc69
@ -113,38 +113,6 @@
|
|||||||
config = let stateVersion = "23.05";
|
config = let stateVersion = "23.05";
|
||||||
in {
|
in {
|
||||||
|
|
||||||
nix = {
|
|
||||||
|
|
||||||
# Enable features in Nix commands
|
|
||||||
extraOptions = ''
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
warn-dirty = false
|
|
||||||
'';
|
|
||||||
|
|
||||||
gc = {
|
|
||||||
automatic = true;
|
|
||||||
options = "--delete-older-than 10d";
|
|
||||||
};
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
|
|
||||||
# Add community Cachix to binary cache
|
|
||||||
# Don't use with macOS because blocked by corporate firewall
|
|
||||||
builders-use-substitutes = true;
|
|
||||||
substituters = lib.mkIf (!pkgs.stdenv.isDarwin)
|
|
||||||
[ "https://nix-community.cachix.org" ];
|
|
||||||
trusted-public-keys = lib.mkIf (!pkgs.stdenv.isDarwin) [
|
|
||||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
||||||
];
|
|
||||||
|
|
||||||
# Scans and hard links identical files in the store
|
|
||||||
# Not working with macOS: https://github.com/NixOS/nix/issues/7273
|
|
||||||
auto-optimise-store = lib.mkIf (!pkgs.stdenv.isDarwin) true;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
# Basic common system packages for all devices
|
# Basic common system packages for all devices
|
||||||
environment.systemPackages = with pkgs; [ git vim wget curl ];
|
environment.systemPackages = with pkgs; [ git vim wget curl ];
|
||||||
|
|
||||||
|
@ -72,6 +72,12 @@
|
|||||||
fi
|
fi
|
||||||
'');
|
'');
|
||||||
|
|
||||||
|
# Set automatic generation cleanup for home-manager
|
||||||
|
nix.gc = {
|
||||||
|
automatic = config.nix.gc.automatic;
|
||||||
|
options = config.nix.gc.options;
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
@ -88,6 +94,34 @@
|
|||||||
# For security, only allow specific users
|
# For security, only allow specific users
|
||||||
settings.allowed-users = [ "@wheel" config.user ];
|
settings.allowed-users = [ "@wheel" config.user ];
|
||||||
|
|
||||||
|
# Enable features in Nix commands
|
||||||
|
extraOptions = ''
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
warn-dirty = false
|
||||||
|
'';
|
||||||
|
|
||||||
|
gc = {
|
||||||
|
automatic = true;
|
||||||
|
options = "--delete-older-than 10d";
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
|
||||||
|
# Add community Cachix to binary cache
|
||||||
|
# Don't use with macOS because blocked by corporate firewall
|
||||||
|
builders-use-substitutes = true;
|
||||||
|
substituters =
|
||||||
|
lib.mkIf (!pkgs.stdenv.isDarwin) [ "https://nix-community.cachix.org" ];
|
||||||
|
trusted-public-keys = lib.mkIf (!pkgs.stdenv.isDarwin) [
|
||||||
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
|
];
|
||||||
|
|
||||||
|
# Scans and hard links identical files in the store
|
||||||
|
# Not working with macOS: https://github.com/NixOS/nix/issues/7273
|
||||||
|
auto-optimise-store = lib.mkIf (!pkgs.stdenv.isDarwin) true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user