chore: bump dependencies
This commit is contained in:
parent
11d0bc133f
commit
9ab64ca35f
5 changed files with 64 additions and 21 deletions
|
|
@ -30,39 +30,77 @@
|
|||
"${pkgs.eza}/bin/eza --group-directories-first --hyperlink --icons -la --tree";
|
||||
llt =
|
||||
"${pkgs.expect}/bin/unbuffer ${pkgs.eza}/bin/eza --group-directories-first --hyperlink --icons -la --tree | ${pkgs.less}/bin/less -r";
|
||||
sa = ''
|
||||
if ps -p $SSH_AGENT_PID > /dev/null 2>&1; then ${pkgs.gum}/bin/gum log -l info "ssh-agent is already running: pid: $SSH_AGENT_PID"; else eval $(ssh-agent); ssh-add ~/.ssh/id_ed25519; ${pkgs.gum}/bin/gum log -l info "ssh-agent started"; fi'';
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellScriptBin "n" ''
|
||||
set -euo pipefail
|
||||
action=$(${pkgs.gum}/bin/gum choose switch test clean)
|
||||
target=$(${pkgs.gum}/bin/gum choose PABU APPA MOMO)
|
||||
|
||||
action=$(${pkgs.gum}/bin/gum choose --header "Choose action:" build clean)
|
||||
target=$(${pkgs.gum}/bin/gum choose --header "Choose target:" PABU APPA MOMO)
|
||||
|
||||
case "$target" in
|
||||
"PABU")
|
||||
;;
|
||||
*)
|
||||
if ! ps -p $SSH_AGENT_PID > /dev/null; then
|
||||
${pkgs.gum}/bin/gum log -t kitchen -l error "ssh-agent is not running! Please run \"sa\". Exiting ..."
|
||||
exit 1
|
||||
fi
|
||||
${pkgs.rsync}/bin/rsync -r . $target:/root/nix/
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$action" in
|
||||
"clean")
|
||||
case "$target" in
|
||||
"PABU")
|
||||
gum log -t kitchen -l info "Running: sudo nix-collect-garbage -d && nix store gc && nix-store --optimise"
|
||||
${pkgs.gum}/bin/gum log -t kitchen -l info "Running: sudo nix-collect-garbage -d && nix store gc && nix-store --optimise"
|
||||
sudo nix-collect-garbage -d && nix store gc && nix-store --optimise
|
||||
;;
|
||||
*)
|
||||
gum log -t kitchen -l info "Running: ssh $target \"nix-collect-garbage -d && nix store gc && nix-store --optimise\""
|
||||
${pkgs.gum}/bin/gum log -t kitchen -l info "Running: ssh $target \"nix-collect-garbage -d && nix store gc && nix-store --optimise\""
|
||||
ssh $target "nix-collect-garbage -d && nix store gc && nix-store --optimise"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
"build")
|
||||
case "$target" in
|
||||
"PABU")
|
||||
gum log -t kitchen -l info "Running: sudo nixos-rebuild $action --option sandbox false --flake .#PABU"
|
||||
sudo nixos-rebuild $action --option sandbox false --flake .#PABU
|
||||
sudo nixos-rebuild build --option sandbox false --log-format internal-json -v --flake .#PABU |& ${pkgs.nix-output-monitor}/bin/nom --json
|
||||
${pkgs.nvd}/bin/nvd --color=always diff /run/current-system result
|
||||
postBuildAction=$(${pkgs.gum}/bin/gum choose --header "Choose post-build-action" skip switch boot test )
|
||||
case "$postBuildAction" in
|
||||
"skip")
|
||||
${pkgs.gum}/bin/gum log -t kitchen -l info "Skipping ..."
|
||||
;;
|
||||
*)
|
||||
sudo ./result/bin/switch-to-configuration $postBuildAction
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
gum log -t kitchen -l info "Running: nixos-rebuild $action --build-host $target --target-host $target --flake .#$target"
|
||||
nixos-rebuild $action --build-host $target --target-host $target --flake .#$target
|
||||
ssh $target "cd /root/nix; nixos-rebuild build --log-format internal-json -v --flake .#$target" |& ${pkgs.nix-output-monitor}/bin/nom --json
|
||||
ssh $target "cd /root/nix; nix run nixpkgs#nvd -- --color=always diff /run/current-system result"
|
||||
postBuildAction=$(${pkgs.gum}/bin/gum choose --header "Choose post-build-action" skip switch boot test )
|
||||
case "$postBuildAction" in
|
||||
"skip")
|
||||
${pkgs.gum}/bin/gum log -t kitchen -l info "Skipping ..."
|
||||
;;
|
||||
*)
|
||||
ssh $target "cd /root/nix; ./result/bin/switch-to-configuration $postBuildAction"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
${pkgs.gum}/bin/gum log -t kitchen -l error "Unkown action: $action. Exiting ..."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
'')
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue