diff --git a/hosts/hl-bigbox2.hardware-configuration.nix b/hosts/hl-bigbox2.hardware-configuration.nix index 9e4ace2..3e286b7 100644 --- a/hosts/hl-bigbox2.hardware-configuration.nix +++ b/hosts/hl-bigbox2.hardware-configuration.nix @@ -12,7 +12,7 @@ boot.extraModulePackages = [ ]; boot.loader.grub = { enable = true; - device = "/dev/sdb"; # install GRUB to MBR + device = "/dev/sda"; # install GRUB to MBR efiSupport = false; }; diff --git a/hosts/hl-bigbox2.nix b/hosts/hl-bigbox2.nix index 696544b..66c54c0 100644 --- a/hosts/hl-bigbox2.nix +++ b/hosts/hl-bigbox2.nix @@ -10,6 +10,8 @@ let in { skyg = { + gc.rootDays = 30; + gc.userDays = 30; user.enable = true; nixos.common = { ssh-server.enable = true; diff --git a/modules/nixos/common/core.nix b/modules/nixos/common/core.nix index 7cb1c9e..20ae321 100644 --- a/modules/nixos/common/core.nix +++ b/modules/nixos/common/core.nix @@ -1,62 +1,79 @@ -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: { - # System Packages - services.hydra.useSubstitutes = true; - programs.dconf.enable = true; - programs.nix-ld.enable = true; - nixpkgs.config.allowUnfree = true; - nix = { - optimise.automatic = true; - settings.experimental-features = [ "nix-command" "flakes" ]; + options.skyg = { + gc = { + rootDays = lib.mkOption { + type = lib.types.int; + description = "How often (in days) we call 'nix-collect-garbage' on root user"; + default = 7; + }; + userDays = lib.mkOption { + type = lib.types.int; + description = "How often in (days) we call 'nix-collect-garbage' on skyg.user.name"; + default = 7; + }; + }; }; - programs.nh = { - enable = true; - clean.enable = true; - }; - environment.systemPackages = with pkgs; [ - # shell tools - git - usbutils + config = let skyg = config.skyg; in { - # system utils - nfs-utils - lm_sensors - hwinfo - dig - iperf + # System Packages + services.hydra.useSubstitutes = true; + programs.dconf.enable = true; + programs.nix-ld.enable = true; + nixpkgs.config.allowUnfree = true; + nix = { + optimise.automatic = true; + settings.experimental-features = [ "nix-command" "flakes" ]; + }; + programs.nh = { + enable = true; + clean.enable = true; + }; + environment.systemPackages = with pkgs; [ + # shell tools + git + usbutils - # misc - glib-networking - glib - glibc + # system utils + nfs-utils + lm_sensors + hwinfo + dig + iperf - # printer - system-config-printer + # misc + glib-networking + glib + glibc - # nix utils - nix-index - nil - cachix - nixpkgs-fmt - nvd - # shell tools - wget - ]; - services.xserver.excludePackages = with pkgs; [ - xterm - ]; - # Set your time zone. - time.timeZone = "America/Toronto"; + # printer + system-config-printer - # Select internationalisation properties. - i18n.defaultLocale = "en_CA.UTF-8"; - - # Storage Clean up - services.cron = { - enable = true; - systemCronJobs = [ - "0 23 * * * root nix-collect-garbage --delete-older-than 7d" - "0 23 * * * ${config.skyg.user.name} nix-collect-garbage --delete-older-than 7d" + # nix utils + nix-index + nil + cachix + nixpkgs-fmt + nvd + # shell tools + wget ]; + services.xserver.excludePackages = with pkgs; [ + xterm + ]; + # Set your time zone. + time.timeZone = "America/Toronto"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_CA.UTF-8"; + + # Storage Clean up + services.cron = { + enable = true; + systemCronJobs = [ + "0 23 * * * root nix-collect-garbage --delete-older-than ${toString skyg.gc.rootDays}d" + "0 23 * * * ${skyg.user.name} nix-collect-garbage --delete-older-than ${toString skyg.gc.userDays}d" + ]; + }; }; }