From 3d23da27f6bf25612cd5ade9907d7e44552bce2c Mon Sep 17 00:00:00 2001 From: root Date: Wed, 29 May 2024 12:45:06 +0200 Subject: [PATCH] add a deploy helper binary --- common/configuration.nix | 1 + common/deploy.nix | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 common/deploy.nix diff --git a/common/configuration.nix b/common/configuration.nix index 420614e..c4fe092 100644 --- a/common/configuration.nix +++ b/common/configuration.nix @@ -3,6 +3,7 @@ { imports = [ ./secrets-permissions.nix + ./deploy.nix ]; # Enable the OpenSSH daemon diff --git a/common/deploy.nix b/common/deploy.nix new file mode 100644 index 0000000..310a754 --- /dev/null +++ b/common/deploy.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +let + deploy = pkgs.writeShellScriptBin "deploy" '' + cd /etc/nixos + git pull + nixos-rebuild switch + ''; + +in { environment.systemPackages = [ deploy ]; } \ No newline at end of file