sysadmin: init, replacing deployment directory
This commit is contained in:
parent
b4b879a87b
commit
8076f91738
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./sysadmin
|
||||||
./users
|
./users
|
||||||
./environment.nix
|
./environment.nix
|
||||||
./nginx.nix
|
./nginx.nix
|
||||||
|
|
16
common/sysadmin/default.nix
Normal file
16
common/sysadmin/default.nix
Normal 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" ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,9 +0,0 @@
|
||||||
{ name, nodes, config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
deployment = {
|
|
||||||
allowLocalDeployment = true;
|
|
||||||
targetHost = null;
|
|
||||||
tags = [ "local" ];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -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" ];
|
|
||||||
}
|
|
21
flake.nix
21
flake.nix
|
@ -22,11 +22,14 @@
|
||||||
|
|
||||||
outputs = inputs@{ self, nixpkgs, home-manager, nur, agenix, birdsong, ... }: {
|
outputs = inputs@{ self, nixpkgs, home-manager, nur, agenix, birdsong, ... }: {
|
||||||
colmena = {
|
colmena = {
|
||||||
meta.nixpkgs = import nixpkgs { system = "x86_64-linux"; };
|
meta = {
|
||||||
meta.nodeNixpkgs.kalessin = import nixpkgs { system = "aarch64-linux"; }; # TODO: this should be generated from the host config somehow
|
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, ... }: {
|
defaults = { name, nodes, config, lib, pkgs, ... }: {
|
||||||
deployment.replaceUnknownProfiles = lib.mkDefault false;
|
|
||||||
networking.hostName = name;
|
networking.hostName = name;
|
||||||
|
|
||||||
nix.settings.experimental-features = "nix-command flakes";
|
nix.settings.experimental-features = "nix-command flakes";
|
||||||
|
@ -62,9 +65,12 @@
|
||||||
tohru = { name, nodes, ... }: {
|
tohru = { name, nodes, ... }: {
|
||||||
networking.hostId = "31da19c1";
|
networking.hostId = "31da19c1";
|
||||||
time.timeZone = "Europe/London";
|
time.timeZone = "Europe/London";
|
||||||
|
deployment = {
|
||||||
|
allowLocalDeployment = true;
|
||||||
|
targetHost = null; # disallow remote deployment
|
||||||
|
};
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./deployment/local.nix
|
|
||||||
./hosts/tohru/configuration.nix
|
./hosts/tohru/configuration.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -72,9 +78,9 @@
|
||||||
yevaud = { name, nodes, ... }: {
|
yevaud = { name, nodes, ... }: {
|
||||||
networking.hostId = "09673d65";
|
networking.hostId = "09673d65";
|
||||||
time.timeZone = "Etc/UTC";
|
time.timeZone = "Etc/UTC";
|
||||||
|
deployment.targetHost = "yevaud.birdsong.network";
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./deployment/remote.nix
|
|
||||||
./hosts/yevaud/configuration.nix
|
./hosts/yevaud/configuration.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -82,9 +88,9 @@
|
||||||
orm = { name, nodes, ... }: {
|
orm = { name, nodes, ... }: {
|
||||||
networking.hostId = "00000000";
|
networking.hostId = "00000000";
|
||||||
time.timeZone = "Etc/UTC";
|
time.timeZone = "Etc/UTC";
|
||||||
|
deployment.targetHost = "orm.birdsong.network";
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./deployment/remote.nix
|
|
||||||
./hosts/orm/configuration.nix
|
./hosts/orm/configuration.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -93,12 +99,11 @@
|
||||||
networking.hostId = "534b538e";
|
networking.hostId = "534b538e";
|
||||||
time.timeZone = "Etc/UTC";
|
time.timeZone = "Etc/UTC";
|
||||||
deployment = {
|
deployment = {
|
||||||
|
targetHost = "kalessin.birdsong.network";
|
||||||
buildOnTarget = true;
|
buildOnTarget = true;
|
||||||
replaceUnknownProfiles = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./deployment/remote.nix
|
|
||||||
./hosts/kalessin/configuration.nix
|
./hosts/kalessin/configuration.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
qenya.sysadmin.enable = true;
|
||||||
|
|
||||||
system.stateVersion = "23.11";
|
system.stateVersion = "23.11";
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
qenya.sysadmin.enable = true;
|
||||||
|
|
||||||
age.secrets.wireguard-peer-orm.file = ../../secrets/wireguard-peer-orm.age;
|
age.secrets.wireguard-peer-orm.file = ../../secrets/wireguard-peer-orm.age;
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
qenya.sysadmin.enable = true;
|
||||||
|
|
||||||
age.secrets.wireguard-peer-yevaud.file = ../../secrets/wireguard-peer-yevaud.age;
|
age.secrets.wireguard-peer-yevaud.file = ../../secrets/wireguard-peer-yevaud.age;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue