Unified system flake update
This commit is contained in:
parent
693220a895
commit
ecf2237099
3 changed files with 35 additions and 14 deletions
|
@ -94,7 +94,7 @@
|
|||
];
|
||||
|
||||
shellAliases = {
|
||||
drsw = "nix-darwin-switch";
|
||||
nrsw = "nixpkgs-switch";
|
||||
upa = "nix flake update ~/.config/nixpkgs -v && upn";
|
||||
upn = "$HOME/.config/nixpkgs/home/programs/nvim/update-plugins.sh";
|
||||
ngc = "nix-collect-garbage -d && sudo nix-collect-garbage -d";
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
pushd ~/.config/nixpkgs
|
||||
rm -rf result
|
||||
|
||||
set system_old (readlink /run/current-system)
|
||||
env TERM=xterm-256color darwin-rebuild switch --flake .
|
||||
set system_new (readlink /run/current-system)
|
||||
|
||||
nvd diff "$system_old" "$system_new"
|
||||
|
||||
rm -f result
|
||||
popd
|
34
home/programs/scripts/nixpkgs-switch
Executable file
34
home/programs/scripts/nixpkgs-switch
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
set -g os (uname)
|
||||
|
||||
switch $os
|
||||
case Darwin
|
||||
set -g config_dir "$HOME/.config/nixpkgs"
|
||||
case Linux
|
||||
set -g config_dir /etc/nixos
|
||||
case '*'
|
||||
echo "Unsupported OS"
|
||||
exit 1
|
||||
end
|
||||
|
||||
pushd "$config_dir"
|
||||
rm -rf result
|
||||
|
||||
set system_old (readlink /run/current-system)
|
||||
|
||||
switch $os
|
||||
case Darwin
|
||||
git pull
|
||||
env TERM=xterm-256color darwin-rebuild switch --flake .
|
||||
case Linux
|
||||
sudo git pull
|
||||
sudo nixos-rebuild switch --flake .
|
||||
end
|
||||
|
||||
set system_new (readlink /run/current-system)
|
||||
|
||||
nvd diff "$system_old" "$system_new"
|
||||
|
||||
rm -f result
|
||||
popd
|
Loading…
Reference in a new issue