materusPC: valkyrie rebuild scripts

This commit is contained in:
Mateusz Słodkowicz 2023-06-07 01:52:01 +02:00
parent 7e3954506d
commit 51472e812a
Signed by: materus
GPG Key ID: 28D140BCA60B4FD1
1 changed files with 14 additions and 3 deletions

View File

@ -2,19 +2,30 @@
let let
valkyrie-sync = pkgs.writeShellScriptBin "valkyrie-sync" '' valkyrie-sync = pkgs.writeShellScriptBin "valkyrie-sync" ''
${pkgs.rsync}/bin/rsync -avzrh --delete --exclude ".git*" --exclude "flake.lock" /materus/config/Nixerus materus@valkyrie:/materus/config/ && \ ${pkgs.rsync}/bin/rsync -avzrh --delete --exclude ".git*" --exclude "flake.lock" /materus/config/Nixerus materus@valkyrie:/materus/config/ && \
${pkgs.rsync}/bin/rsync -avzrh --delete --exclude ".git*" /materus/config/valkyrie materus@valkyrie:/materus/config/ ${pkgs.rsync}/bin/rsync -avzrh --delete --exclude ".git*" /materus/config/valkyrie materus@valkyrie:/materus/config/
''; '';
valkyrie-flakelock = pkgs.writeShellScriptBin "valkyrie-flakelock" '' valkyrie-flakelock = pkgs.writeShellScriptBin "valkyrie-flakelock" ''
${pkgs.openssh}/bin/ssh materus@valkyrie "nix flake update /materus/config/Nixerus --override-input nixpkgs github:NixOS/nixpkgs/23.05 \ ${pkgs.openssh}/bin/ssh materus@valkyrie "nix flake update /materus/config/Nixerus --override-input nixpkgs github:NixOS/nixpkgs/23.05 \
--override-input home-manager github:nix-community/home-manager/release-23.05 \ --override-input home-manager github:nix-community/home-manager/release-23.05 \
--override-input private /materus/config/valkyrie/flake" --override-input private /materus/config/valkyrie/flake"
'';
valkyrie-rebuild-boot = pkgs.writeShellScriptBin "valkyrie-rebuild-boot" ''
${pkgs.openssh}/bin/ssh -t materus@valkyrie "sudo nixos-rebuild boot --flake /materus/config/Nixerus#valkyrie \
--override-input private /materus/config/valkyrie/flake"
'';
valkyrie-rebuild-switch = pkgs.writeShellScriptBin "valkyrie-rebuild-switch" ''
${pkgs.openssh}/bin/ssh -t materus@valkyrie "sudo nixos-rebuild switch --flake /materus/config/Nixerus#valkyrie \
--override-input private /materus/config/valkyrie/flake"
''; '';
in in
{ {
environment.systemPackages = [ environment.systemPackages = [
valkyrie-rebuild-boot
valkyrie-rebuild-switch
valkyrie-sync valkyrie-sync
valkyrie-flakelock valkyrie-flakelock
]; ];