Move Colmena deployment to machine's nixos module

This commit is contained in:
Pim Kunis 2024-11-17 22:59:40 +01:00
parent b0a106b332
commit adbea68c91
3 changed files with 56 additions and 57 deletions

View file

@ -15,34 +15,6 @@ inputs @ {
}; };
sue = { sue = {
pkgs,
lib,
...
}: let
sops = lib.getExe pkgs.sops;
in {
deployment = {
allowLocalDeployment = true;
targetHost = null;
keys = {
# TODO: Create macro for this
root-sops-age-key = {
keyCommand = ["sudo" sops "--extract" "[\"sops_age_key\"]" "-d" "${self}/machines/sue/nixos.sops.yaml"];
name = "keys.txt";
destDir = "/root/.config/sops/age";
};
pim-sops-age-key = {
keyCommand = ["sudo" sops "--extract" "[\"sops_age_key\"]" "-d" "${self}/machines/sue/home.sops.yaml"];
name = "keys.txt";
destDir = "/home/pim/.config/sops/age";
user = "pim";
group = "users";
};
};
};
imports = [ imports = [
(import ./machines).sue.module (import ./machines).sue.module
./nixos ./nixos
@ -50,33 +22,6 @@ inputs @ {
}; };
gamepc = { gamepc = {
pkgs,
lib,
...
}: let
sops = lib.getExe pkgs.sops;
in {
deployment = {
targetHost = "gamepc";
targetUser = "root";
keys = {
root-sops-age-key = {
keyCommand = ["sudo" sops "--extract" "[\"sops_age_key\"]" "-d" "${self}/machines/gamepc/nixos.sops.yaml"];
name = "keys.txt";
destDir = "/root/.config/sops/age";
};
pim-sops-age-key = {
keyCommand = ["sudo" sops "--extract" "[\"sops_age_key\"]" "-d" "${self}/machines/gamepc/home.sops.yaml"];
name = "keys.txt";
destDir = "/home/pim/.config/sops/age";
user = "pim";
group = "users";
};
};
};
imports = [ imports = [
(import ./machines).gamepc.module (import ./machines).gamepc.module
./nixos ./nixos

View file

@ -1,8 +1,12 @@
{ {
self,
pkgs,
config, config,
lib, lib,
... ...
}: { }: let
sops = lib.getExe pkgs.sops;
in {
config = { config = {
pim = { pim = {
cinnamon.enable = true; cinnamon.enable = true;
@ -14,6 +18,27 @@
home-manager.users.pim.imports = [./home.nix]; home-manager.users.pim.imports = [./home.nix];
programs.steam.enable = true; programs.steam.enable = true;
deployment = {
targetHost = "gamepc";
targetUser = "root";
keys = {
root-sops-age-key = {
keyCommand = ["sudo" sops "--extract" "[\"sops_age_key\"]" "-d" "${self}/machines/gamepc/nixos.sops.yaml"];
name = "keys.txt";
destDir = "/root/.config/sops/age";
};
pim-sops-age-key = {
keyCommand = ["sudo" sops "--extract" "[\"sops_age_key\"]" "-d" "${self}/machines/gamepc/home.sops.yaml"];
name = "keys.txt";
destDir = "/home/pim/.config/sops/age";
user = "pim";
group = "users";
};
};
};
services = { services = {
openssh.enable = true; openssh.enable = true;
tailscale.enable = true; tailscale.enable = true;

View file

@ -1,4 +1,11 @@
{pkgs, ...}: { {
self,
pkgs,
lib,
...
}: let
sops = lib.getExe pkgs.sops;
in {
config = { config = {
pim = { pim = {
lanzaboote.enable = true; lanzaboote.enable = true;
@ -9,6 +16,28 @@
compliance.enable = true; compliance.enable = true;
}; };
deployment = {
allowLocalDeployment = true;
targetHost = null;
keys = {
# TODO: Create macro for this
root-sops-age-key = {
keyCommand = ["sudo" sops "--extract" "[\"sops_age_key\"]" "-d" "${self}/machines/sue/nixos.sops.yaml"];
name = "keys.txt";
destDir = "/root/.config/sops/age";
};
pim-sops-age-key = {
keyCommand = ["sudo" sops "--extract" "[\"sops_age_key\"]" "-d" "${self}/machines/sue/home.sops.yaml"];
name = "keys.txt";
destDir = "/home/pim/.config/sops/age";
user = "pim";
group = "users";
};
};
};
services.tailscale.enable = true; services.tailscale.enable = true;
facter.reportPath = ./facter.json; facter.reportPath = ./facter.json;
home-manager.users.pim.imports = [./home.nix]; home-manager.users.pim.imports = [./home.nix];