diff --git a/darwin/hosts/ivr/default.nix b/darwin/hosts/ivr/default.nix index 2e08773..73a12a8 100644 --- a/darwin/hosts/ivr/default.nix +++ b/darwin/hosts/ivr/default.nix @@ -3,6 +3,10 @@ let username = "gregory.hellings"; in { + greg = { + nix.cache = false; + }; + homebrew = { enable = true; brews = [ @@ -12,7 +16,9 @@ in name = "libvirt"; restart_service = true; } + "mysql" "nushell" + "poetry" "qemu" ]; casks = [ @@ -22,15 +28,14 @@ in "chromium" "firefox" "microsoft-teams" - "mysql" "onlyoffice" "pgadmin4" - "poetry" "tabby" "twine" "vagrant" "visual-studio-code" "zed" + "zoho-workdrive" ]; user = username; }; diff --git a/modules/baseline.nix b/modules/baseline.nix index b825ee3..b7c649c 100644 --- a/modules/baseline.nix +++ b/modules/baseline.nix @@ -14,9 +14,6 @@ let [ ]; in { - # This is a dumb hack to pass the value into the import below, but it's how we have to do it, - # since that's how the module system works - _module.args.cache = true; imports = [ ./nix-conf.nix ]; diff --git a/modules/nix-conf.nix b/modules/nix-conf.nix index c94c061..55e3fcc 100644 --- a/modules/nix-conf.nix +++ b/modules/nix-conf.nix @@ -1,60 +1,72 @@ { pkgs, lib, - cache, + config, ... }: +let + cfg = config.greg.nix; +in { - nix = { - gc = { - automatic = true; - # Scheduling of them is different in nixos vs nix-darwin, so check for - # the extra details there - options = "--delete-older-than 30d"; - }; - - package = pkgs.nixStable; - - settings = { - cores = 0; # Use all cores for builds - download-buffer-size = 500 * 1024 * 1024; - experimental-features = "nix-command flakes"; - keep-outputs = true; - keep-derivations = true; - min-free = (toString (1024 * 1024 * 1024)); - max-free = (toString (5 * 1024 * 1024 * 1024)); - trusted-users = [ - "greg" - "gregory.hellings" - ]; # For home and for work machines - substituters = - (lib.optionals cache [ - "http://nas.thehellings.lan:9000/binary-cache/" - "http://nas.home:9000/binary-cache/" - ]) - ++ [ - "https://ai.cachix.org" - "https://nixpkgs-python.cachix.org" - "https://greg-hellings.cachix.org" - "https://nix-community.cachix.org" - "https://cache.nixos.org" - ]; - trusted-public-keys = [ - "nix.thehellings.lan:0qWYHn3gGllXChhAaaxKlNZtRy6yG/XJs1RFSqV3nW8=" - "nix.home:0qWYHn3gGllXChhAaaxKlNZtRy6yG/XJs1RFSqV3nW8=" - "ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc=" - "nixpkgs-python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcNZLNS3ZAvfYNuYifcEU=" - "greg-hellings.cachix.org-1:y01Jl/L5evlhxdnUW6n56AiI1k8g1wxWhTxJCe7XSco=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - ]; + options.greg.nix = { + cache = lib.mkOption { + type = lib.types.bool; + default = true; }; }; - nixpkgs.config = { - allowUnfree = true; - allowUnfreePredicate = _: true; - permittedInsecurePackages = [ "ventoy-1.1.05" ]; + config = { + nix = { + gc = { + automatic = true; + # Scheduling of them is different in nixos vs nix-darwin, so check for + # the extra details there + options = "--delete-older-than 30d"; + }; + + package = pkgs.nixStable; + + settings = { + cores = 0; # Use all cores for builds + download-buffer-size = 500 * 1024 * 1024; + experimental-features = "nix-command flakes"; + keep-outputs = true; + keep-derivations = true; + min-free = (toString (1024 * 1024 * 1024)); + max-free = (toString (5 * 1024 * 1024 * 1024)); + trusted-users = [ + "greg" + "gregory.hellings" + ]; # For home and for work machines + substituters = + (lib.optionals cfg.cache [ + "http://nas.thehellings.lan:9000/binary-cache/" + "http://nas.home:9000/binary-cache/" + ]) + ++ [ + "https://ai.cachix.org" + "https://nixpkgs-python.cachix.org" + "https://greg-hellings.cachix.org" + "https://nix-community.cachix.org" + "https://cache.nixos.org" + ]; + trusted-public-keys = [ + "nix.thehellings.lan:0qWYHn3gGllXChhAaaxKlNZtRy6yG/XJs1RFSqV3nW8=" + "nix.home:0qWYHn3gGllXChhAaaxKlNZtRy6yG/XJs1RFSqV3nW8=" + "ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc=" + "nixpkgs-python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcNZLNS3ZAvfYNuYifcEU=" + "greg-hellings.cachix.org-1:y01Jl/L5evlhxdnUW6n56AiI1k8g1wxWhTxJCe7XSco=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + ]; + }; + }; + + nixpkgs.config = { + allowUnfree = true; + allowUnfreePredicate = _: true; + permittedInsecurePackages = [ "ventoy-1.1.05" ]; + }; }; }