From 0946022a185f7d919bc4c0aa884eae3b0009d296 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Tue, 17 Oct 2023 23:54:24 -0500 Subject: [PATCH] feat: colmena Signed-off-by: jolheiser --- flake.nix | 17 +++++++++++------ justfile | 4 ++++ machines/dragonwell/caddy.nix | 2 +- machines/dragonwell/default.nix | 18 +++++++++++------- secrets/shared/ssh-config.age | Bin 1487 -> 1472 bytes 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/flake.nix b/flake.nix index 4ce5570..a4b4aeb 100644 --- a/flake.nix +++ b/flake.nix @@ -169,14 +169,18 @@ (commonConfig {}) ]; }; - "dragonwell" = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - home-manager.nixosModules.home-manager - agenix.nixosModules.default + }; + colmena = { + meta = { + nixpkgs = import nixpkgs { + system = "x86_64-linux"; + overlays = overlays; + }; + }; + dragonwell = { + imports = [ golink.nixosModules.default ./machines/dragonwell - (commonConfig {gui = false;}) ]; }; }; @@ -187,6 +191,7 @@ devShells.default = pkgs.mkShell { nativeBuildInputs = [ agenix.packages.${system}.agenix + pkgs.colmena ]; }; }); diff --git a/justfile b/justfile index 1c4d46b..0ca7c47 100644 --- a/justfile +++ b/justfile @@ -13,6 +13,10 @@ rebuild *args: switch *args: @just rebuild switch {{args}} +# Run colmena for remote deploy +colmena node: + @nix run nixpkgs#colmena -- apply --on {{node}} + # Update the flake update-flake: @nix flake update diff --git a/machines/dragonwell/caddy.nix b/machines/dragonwell/caddy.nix index 619e604..ae2b77d 100644 --- a/machines/dragonwell/caddy.nix +++ b/machines/dragonwell/caddy.nix @@ -3,7 +3,7 @@ lib, ... }: let - packages = ["tmpl" "git-age" "ffmd"]; + packages = ["tmpl" "git-age" "ffmd" "kv"]; in { services.caddy = { enable = true; diff --git a/machines/dragonwell/default.nix b/machines/dragonwell/default.nix index d413d27..64b23fe 100644 --- a/machines/dragonwell/default.nix +++ b/machines/dragonwell/default.nix @@ -1,7 +1,8 @@ let username = "jolheiser"; + key = ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfKqCWtDlS3tgvfT6hQN+ii8UtabIZ+ZNmYN+bLwIa8PHOEW5MbfaqXSlhKkSi4+7SfQDCHphw0SMfhsQ4qMEcoywZ+4niDgKlQEVkl+S/VGbLuPe92NRStkyreZBLPr3Rh7ScNlGHcmHmoV9v7725fMnsMmabGVhpGO84PwNHOfJyv2tx2h6LxFbAV8S44UQu2lc8YLWCK2UvKuRnBerBXLnDQThUUX8UuCFzb786gQzD5XDU0MENbByxiy0XdVGAC+tFXEiSIgFZlFbFYyShgdTP9MzX2MOglEi+ae+1UIFncraW7ptUey7qHFJylpHWWWvE+GTwsg2G50i0FvFj jolheiser@jolheiser''; in { - imports = [./caddy.nix ./golink.nix ./hardware.nix ../common/nogui]; + imports = [./caddy.nix ./golink.nix ./hardware.nix]; boot.tmp.cleanOnBoot = true; zramSwap.enable = true; @@ -18,12 +19,15 @@ in { services.openssh.enable = true; virtualisation.docker.enable = true; - users.users."${username}" = { - extraGroups = ["wheel" "docker" "storage"]; - isNormalUser = true; - openssh.authorizedKeys.keys = [ - ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfKqCWtDlS3tgvfT6hQN+ii8UtabIZ+ZNmYN+bLwIa8PHOEW5MbfaqXSlhKkSi4+7SfQDCHphw0SMfhsQ4qMEcoywZ+4niDgKlQEVkl+S/VGbLuPe92NRStkyreZBLPr3Rh7ScNlGHcmHmoV9v7725fMnsMmabGVhpGO84PwNHOfJyv2tx2h6LxFbAV8S44UQu2lc8YLWCK2UvKuRnBerBXLnDQThUUX8UuCFzb786gQzD5XDU0MENbByxiy0XdVGAC+tFXEiSIgFZlFbFYyShgdTP9MzX2MOglEi+ae+1UIFncraW7ptUey7qHFJylpHWWWvE+GTwsg2G50i0FvFj jolheiser@jolheiser'' - ]; + users.users = { + "${username}" = { + extraGroups = ["wheel" "docker" "storage"]; + isNormalUser = true; + openssh.authorizedKeys.keys = [ + key + ]; + }; + "root".openssh.authorizedKeys.keys = [key]; }; system.stateVersion = "22.11"; diff --git a/secrets/shared/ssh-config.age b/secrets/shared/ssh-config.age index 66766088160d345c0a19fc635c33816514512cdb..bb109015af019db9b0249a00a25ab178a5cfb81f 100644 GIT binary patch delta 1407 zcmV-_1%Ud`3&0DIEPrf5XI3j$D^Y4PV`eyRYcfr6HFs=JXiiKxa#TfRH&-`hF>XUx zH*0KFK?-*_G-*{tQB6cScxz-vQ%_ZFa#>AEGfj4SHgiLGc64J{cu_=hYC(2PFbXX` zAaiqQEoEdfH8n9gAb3?xb~1M$MNnx}LvccGGBrv?SZQi`dPY`BQF?E9Oh$8ZR%~us zRa0ny zZb4ZyNJMQ_F)?&lLu4{nMnzLWMom*}ICXDlIW=zzEj}P&Dt;(IT5BjRXL4m>b7dfM zDkWZR3OG<|RYzxUVslMRSZpwVW?^S=IWaUrM_N{FdU!-PD@|r(Z){OjS4&evIaxVo zYiDzCbWui9Win1xHEnKfP*n;qQ)z8_VNx=9Ms87XH84;wVmB}_O>bB)X;)4-ZfSHl zcyd{FW>r>8G*B^icUn;jEiEk|ICD=sr$ zNNRF7Yh-dwR5fW;3U@Ls-7fHBqJdmF?PMui-x_$3QtID31{VL)DvDcZh+4%^AaZ>d+y6CZwI`8mvuJ?b_S~Vd{Ma%4l$Jl)x;yyV_1O*>JSU642E=iZR%WJZJ zW1pfD>`V*$F6HHaD(tdr`n%@(d=b>>(`Q{O(^L(#R4illpbo8EZ^E=cqNwpZIK2kc zm^iz=BQk>b1VhqAnR|iZ)2aeU?kpD#Py>SXXXv1yOEpb_pvoNUK>H%IuWQJs@z=*r z8W4!UqfZB|m2dgWvwX zUGPw!-3Tw%*_4zZEUSwe0k)Ov=pHjv^`EX~F<(~6-K?1>HB8l$V{lQ~1ce67GY2Ca zSy4XYm=?`{&*?{z_3vwes*n5p&L*9IAVR)ShI)AdaB2*1&PlETV+Up{a2r!?Zh^M| zgr1+JCc*?DWNW-rLO?zu`nFc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