nixos/home/scripts/remote-rebuild/default.nix
2024-06-23 17:52:19 +02:00

15 lines
435 B
Nix

{ pkgs, config, ... }:
let
remote-rebuild = pkgs.writeShellScriptBin "remote-rebuild" ''
ssh jack -S -C "cd /home/hadi/.config/nixos && git pull && sudo -S nixos-rebuild switch --flake ~/.config/nixos#jack"
'';
remote-push = pkgs.writeShellScriptBin "remote-push" ''
cd ~/.config/nixos && git add . && git commit -m "update" && git push
remote-rebuild
'';
in { home.packages = [ remote-rebuild remote-push ]; }