From 7b87bdbc2f0e153de39a29c6839e696c425698de Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Wed, 5 Jun 2024 20:31:13 +0100 Subject: [PATCH] More deduplication --- hive.nix | 33 ++++++++++++++++++++++++--------- hosts/tohru/configuration.nix | 7 ------- hosts/yevaud/configuration.nix | 6 ------ 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/hive.nix b/hive.nix index f331dc7..2775603 100644 --- a/hive.nix +++ b/hive.nix @@ -2,30 +2,45 @@ let sources = import ./npins; in { meta.nixpkgs = sources.nixpkgs; - defaults = { pkgs, ... }: { - imports = [ - (import "${sources.home-manager}/nixos") - ]; + defaults = { name, pkgs, ... }: { deployment.replaceUnknownProfiles = false; - + networking.hostName = name; + + environment.systemPackages = with pkgs; [ + git + wget + ]; + # Make point systemwide to the pinned nixpkgs above # https://jade.fyi/blog/pinning-nixos-with-npins/ nix.settings.experimental-features = "nix-command flakes"; nixpkgs.flake.source = sources.nixpkgs; - nix.nixPath = ["nixpkgs=flake:nixpkgs"]; + nix.nixPath = [ "nixpkgs=flake:nixpkgs" ]; + + imports = [ + (import "${sources.home-manager}/nixos") + ./users/qenya.nix + ]; }; - tohru = { name, nodes, ... }: { + tohru = { deployment = { allowLocalDeployment = true; targetHost = null; }; + networking.hostId = "31da19c1"; + time.timeZone = "Europe/London"; + imports = [ ./hosts/tohru/configuration.nix ]; }; - yevaud = { - deployment.targetHost = "yevaud.birdsong.network"; + yevaud = { name, ... }: { + deployment.targetHost = "${name}.birdsong.network"; + + networking.hostId = "09673d65"; + time.timeZone = "Etc/UTC"; + imports = [ ./hosts/yevaud/configuration.nix ]; }; } diff --git a/hosts/tohru/configuration.nix b/hosts/tohru/configuration.nix index b39db2f..7ca7e19 100644 --- a/hosts/tohru/configuration.nix +++ b/hosts/tohru/configuration.nix @@ -4,7 +4,6 @@ imports = [ ./hardware-configuration.nix - ../../users/qenya.nix ./home.nix ]; @@ -12,12 +11,8 @@ boot.loader.efi.canTouchEfiVariables = true; boot.loader.systemd-boot.editor = false; - networking.hostName = "tohru"; - networking.hostId = "31da19c1"; networking.networkmanager.enable = true; - time.timeZone = "Europe/London"; - i18n.defaultLocale = "en_GB.UTF-8"; console.keyMap = "uk"; @@ -34,9 +29,7 @@ environment.systemPackages = with pkgs; [ colmena - git npins - wget ]; programs.steam = { diff --git a/hosts/yevaud/configuration.nix b/hosts/yevaud/configuration.nix index c4bb9d1..e8c073f 100644 --- a/hosts/yevaud/configuration.nix +++ b/hosts/yevaud/configuration.nix @@ -4,7 +4,6 @@ imports = [ ./hardware-configuration.nix - ../../users/qenya.nix ../../services/nginx.nix ../../services/openssh.nix ]; @@ -12,11 +11,6 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "yevaud"; - networking.hostId = "09673d65"; - - time.timeZone = "Etc/UTC"; - services.nginx.virtualHosts = { "git.katherina.rocks" = { forceSSL = true;