You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nixos-template-base/configuration/nix-options.nix

40 lines
970 B
Nix

{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.fqdn}";
flags = currentMachine.configurationFlags;
in
{
# Automatic update & automatic clean
system.autoUpgrade.enable = flags.auto-upgrade;
nix = {
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
settings = {
auto-optimise-store = true;
# Nombre de process d'installation en parrallèle effectués par Nix
cores = 0;
};
gc = {
automatic = true;
dates = "daily";
options = "--delete-older-than 7d";
};
};
# Affichage des modifications de profil (maj/ajout/suppression) dans le terminal
system.activationScripts.diff = {
supportsDryActivation = true;
text = ''
${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
'';
};
}