sysadmin: init, replacing deployment directory

This commit is contained in:
Katherina Walshe-Grey 2024-08-29 16:00:50 +01:00
parent b4b879a87b
commit 8076f91738
8 changed files with 36 additions and 29 deletions

View file

@ -1,5 +1,6 @@
{
imports = [
./sysadmin
./users
./environment.nix
./nginx.nix

View file

@ -0,0 +1,16 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.qenya.sysadmin;
in
{
options.qenya.sysadmin.enable = mkEnableOption "Base configuration for headless servers";
config = mkIf cfg.enable {
# Allow remote deployment with colmena
deployment.targetUser = null;
security.sudo.wheelNeedsPassword = false;
nix.settings.trusted-users = [ "@wheel" ];
};
}

View file

@ -1,9 +0,0 @@
{ name, nodes, config, lib, pkgs, ... }:
{
deployment = {
allowLocalDeployment = true;
targetHost = null;
tags = [ "local" ];
};
}

View file

@ -1,12 +0,0 @@
{ name, nodes, config, lib, pkgs, ... }:
{
deployment = {
targetHost = "${name}.birdsong.network";
targetUser = "qenya";
tags = [ "remote" ];
};
security.sudo.wheelNeedsPassword = false;
nix.settings.trusted-users = [ "@wheel" ];
}

View file

@ -22,11 +22,14 @@
outputs = inputs@{ self, nixpkgs, home-manager, nur, agenix, birdsong, ... }: {
colmena = {
meta.nixpkgs = import nixpkgs { system = "x86_64-linux"; };
meta.nodeNixpkgs.kalessin = import nixpkgs { system = "aarch64-linux"; }; # TODO: this should be generated from the host config somehow
meta = {
nixpkgs = import nixpkgs { system = "x86_64-linux"; };
nodeNixpkgs = {
kalessin = import nixpkgs { system = "aarch64-linux"; }; # TODO: this should be generated from the host config somehow
};
};
defaults = { name, nodes, config, lib, pkgs, ... }: {
deployment.replaceUnknownProfiles = lib.mkDefault false;
networking.hostName = name;
nix.settings.experimental-features = "nix-command flakes";
@ -62,9 +65,12 @@
tohru = { name, nodes, ... }: {
networking.hostId = "31da19c1";
time.timeZone = "Europe/London";
deployment = {
allowLocalDeployment = true;
targetHost = null; # disallow remote deployment
};
imports = [
./deployment/local.nix
./hosts/tohru/configuration.nix
];
};
@ -72,9 +78,9 @@
yevaud = { name, nodes, ... }: {
networking.hostId = "09673d65";
time.timeZone = "Etc/UTC";
deployment.targetHost = "yevaud.birdsong.network";
imports = [
./deployment/remote.nix
./hosts/yevaud/configuration.nix
];
};
@ -82,9 +88,9 @@
orm = { name, nodes, ... }: {
networking.hostId = "00000000";
time.timeZone = "Etc/UTC";
deployment.targetHost = "orm.birdsong.network";
imports = [
./deployment/remote.nix
./hosts/orm/configuration.nix
];
};
@ -93,12 +99,11 @@
networking.hostId = "534b538e";
time.timeZone = "Etc/UTC";
deployment = {
targetHost = "kalessin.birdsong.network";
buildOnTarget = true;
replaceUnknownProfiles = true;
};
imports = [
./deployment/remote.nix
./hosts/kalessin/configuration.nix
];
};

View file

@ -7,6 +7,8 @@
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
qenya.sysadmin.enable = true;
system.stateVersion = "23.11";
}

View file

@ -7,6 +7,8 @@
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
qenya.sysadmin.enable = true;
age.secrets.wireguard-peer-orm.file = ../../secrets/wireguard-peer-orm.age;

View file

@ -7,6 +7,8 @@
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
qenya.sysadmin.enable = true;
age.secrets.wireguard-peer-yevaud.file = ../../secrets/wireguard-peer-yevaud.age;