ctucx.git: nixfiles

ctucx' nixfiles

commit 444c7b51968dc0beca456bb962dad33fbf722b46
parent 27edfabaaee3b7740730366568641df9af41d864
Author: Leah (ctucx) <git@ctu.cx>
Date: Fri, 12 May 2023 17:51:50 +0200

configurations/common/programs/scripts: add `colmena-remote` script
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/configurations/common/programs/scripts.nix b/configurations/common/programs/scripts.nix
@@ -16,6 +16,16 @@ let
     nix-store --optimise
   '';
 
+  colmena-remote = pkgs.writeShellScriptBin "colmena-remote" ''
+    set -euo xtrace
+
+    SSH_HOST="''${HOST:-briefkasten.ctu.cx}"
+    NIXFILES="''${NIXFILES_PATH:-$HOME/proj/nixfiles/}"
+
+    rsync -Pavh $NIXFILES $SSH_HOST:/home/leah/nixfiles/
+    ssh -A -S none $SSH_HOST colmena -f ./nixfiles/flake.nix "$@"
+  '';
+
   backupToSSD = pkgs.writeShellScriptBin "backupToSSD" ''
     set -euo pipefail
     IFS=$'\n\t'

@@ -139,7 +149,7 @@ let
 
 in {
 
-  home-manager.users.leah.home.packages = [ nix-cleanup ] ++ lib.optionals ( currentSystem == "x86_64-linux") [
+  home-manager.users.leah.home.packages = [ nix-cleanup colmena-remote ] ++ lib.optionals ( currentSystem == "x86_64-linux") [
     backupToSSD
   ];