about summary refs log tree commit diff
path: root/users/flokli/nixos/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/flokli/nixos/default.nix')
-rw-r--r--users/flokli/nixos/default.nix17
1 files changed, 16 insertions, 1 deletions
diff --git a/users/flokli/nixos/default.nix b/users/flokli/nixos/default.nix
index 412a0fae346a..b4ed22ed595a 100644
--- a/users/flokli/nixos/default.nix
+++ b/users/flokli/nixos/default.nix
@@ -6,11 +6,26 @@ let
 
   systemFor = sys: (depot.ops.nixos.nixosFor sys).system;
 
+  # assumes `name` is configured appropriately in your .ssh/config
+  deployScript = name: sys: pkgs.writeShellScriptBin "deploy-${name}" ''
+    set -eo pipefail
+    nix copy --no-check-sigs --to ssh-ng://${name} ${sys}
+    ssh ${name} nix-env --profile /nix/var/nix/profiles/system --set ${sys}
+    ssh ${name} ${sys}/bin/switch-to-configuration switch
+  '';
+
 in
-{
+rec {
   archeologySystem = (depot.ops.nixos.nixosFor ({ ... }: {
     imports = [
       ./archeology/configuration.nix
     ];
   })).config.system.build.toplevel;
+
+  shell = pkgs.mkShell {
+    name = "flokli-nixos-shell";
+    packages = [
+      (deployScript "archeology" archeologySystem)
+    ];
+  };
 }