From 433930bde613d481336746a023663444b7c57656 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Wed, 5 Jun 2024 23:03:25 +0100 Subject: [PATCH] Simplify build-related config --- colmena/local.nix | 14 ++++++++++++++ colmena/remote.nix | 12 ++++++++++++ hive.nix | 30 +++++++++++++----------------- hosts/tohru/configuration.nix | 6 ------ 4 files changed, 39 insertions(+), 23 deletions(-) create mode 100644 colmena/local.nix create mode 100644 colmena/remote.nix diff --git a/colmena/local.nix b/colmena/local.nix new file mode 100644 index 0000000..a610670 --- /dev/null +++ b/colmena/local.nix @@ -0,0 +1,14 @@ +{ name, nodes, config, lib, pkgs, ... }: + +{ + deployment = { + allowLocalDeployment = true; + targetHost = null; + tags = [ "local" ]; + }; + + environment.systemPackages = with pkgs; [ + colmena + npins + ]; +} diff --git a/colmena/remote.nix b/colmena/remote.nix new file mode 100644 index 0000000..a82923c --- /dev/null +++ b/colmena/remote.nix @@ -0,0 +1,12 @@ +{ name, nodes, config, lib, pkgs, ... }: + +{ + deployment = { + targetHost = "${name}.birdsong.network"; + tags = [ "remote" ]; + }; + + imports = [ + ../services/openssh.nix + ]; +} diff --git a/hive.nix b/hive.nix index fe52c2a..6c0d560 100644 --- a/hive.nix +++ b/hive.nix @@ -2,14 +2,11 @@ let sources = import ./npins; in { meta.nixpkgs = sources.nixpkgs; - defaults = { name, pkgs, ... }: { + defaults = { name, nodes, ... }: { deployment.replaceUnknownProfiles = false; networking.hostName = name; - environment.systemPackages = with pkgs; [ - git - wget - ]; + nixpkgs.config.allowUnfree = true; imports = [ (import "${sources.home-manager}/nixos") @@ -18,24 +15,23 @@ in { ]; }; - tohru = { - deployment = { - allowLocalDeployment = true; - targetHost = null; - }; - + tohru = { name, nodes, ... }: { networking.hostId = "31da19c1"; time.timeZone = "Europe/London"; - imports = [ ./hosts/tohru/configuration.nix ]; + imports = [ + ./colmena/local.nix + ./hosts/tohru/configuration.nix + ]; }; - yevaud = { name, ... }: { - deployment.targetHost = "${name}.birdsong.network"; - + yevaud = { name, nodes, ... }: { networking.hostId = "09673d65"; time.timeZone = "Etc/UTC"; - - imports = [ ./hosts/yevaud/configuration.nix ]; + + imports = [ + ./colmena/remote.nix + ./hosts/yevaud/configuration.nix + ]; }; } diff --git a/hosts/tohru/configuration.nix b/hosts/tohru/configuration.nix index 7ca7e19..d9ad02f 100644 --- a/hosts/tohru/configuration.nix +++ b/hosts/tohru/configuration.nix @@ -27,18 +27,12 @@ sound.enable = true; hardware.pulseaudio.enable = true; - environment.systemPackages = with pkgs; [ - colmena - npins - ]; - programs.steam = { enable = true; remotePlay.openFirewall = true; dedicatedServer.openFirewall = true; }; - nixpkgs.config.allowUnfree = true; hardware.enableAllFirmware = true; services.fwupd.enable = true; services.fstrim.enable = true;