diff options
| -rw-r--r-- | flake.nix | 4 | ||||
| -rw-r--r-- | machines/bismuth/default.nix | 8 | ||||
| -rw-r--r-- | modules/common.nix | 10 |
3 files changed, 19 insertions, 3 deletions
diff --git a/flake.nix b/flake.nix index 0d04ff9..7075583 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,9 @@ (machine: nixpkgs.lib.nixosSystem { inherit system; - specialArgs = inputs // packageSets; + specialArgs = inputs // packageSets // { + me = machine; + }; modules = [ ./machines/${machine} diff --git a/machines/bismuth/default.nix b/machines/bismuth/default.nix index 8dbdd14..2663703 100644 --- a/machines/bismuth/default.nix +++ b/machines/bismuth/default.nix @@ -13,6 +13,14 @@ networking.hostName = "Bismuth"; + # run binary cache for slower machines + services.nix-serve = { + enable = true; + # note: can we get this value from somewhere? + bindAddress = "100.85.58.31"; # bismuth tailnet ip + secretKeyFile = "/var/bismuth-cache.pem"; + }; + # expose vm web interface to tailnet services.tailscale.extraUpFlags = [ "--advertise-routes=192.168.122.100/32" diff --git a/modules/common.nix b/modules/common.nix index e7de738..f586579 100644 --- a/modules/common.nix +++ b/modules/common.nix @@ -1,4 +1,4 @@ -{ config, pkgs, unstablePkgs, auxiliaryPkgs, ... }: +{ me, config, lib, pkgs, unstablePkgs, auxiliaryPkgs, ... }: { imports = [ @@ -13,7 +13,13 @@ boot.kernelPackages = pkgs.linuxPackages_latest; - nix.settings.experimental-features = [ "flakes" "nix-command" ]; + nix.settings = { + experimental-features = [ "flakes" "nix-command" ]; + } // lib.optionalAttrs (me != "bismuth") { + # add the bismuth binary cache, if we're not bismuth; + substituters = [ "http://bismuth:5000" ]; + trusted-public-keys = [ "bismuth-1:XW9nsNsccipbmdfchyb3YIIWNT058iSpHLwlj1xgB7A=" ]; + }; services.envfs.enable = true; virtualisation.libvirtd.enable = true; |
