System Gen176 @ 2025-05-01-12:10:41

This commit is contained in:
Jonas Röger 2025-05-01 12:10:42 +02:00
parent 85c2004551
commit e37eec7d7f

View File

@ -1,8 +1,4 @@
{ {pkgs, ...}: let
config,
pkgs,
...
}: let
home-rebuild = home-rebuild =
pkgs.writeShellScriptBin ".home-rebuild" pkgs.writeShellScriptBin ".home-rebuild"
'' ''
@ -13,7 +9,8 @@
echo "NixOS Rebuilding..." echo "NixOS Rebuilding..."
${pkgs.nh}/bin/nh home switch ~/.nixos ${pkgs.nh}/bin/nh home switch ~/.nixos
gen=$(home-manager generations | head -n1 | ${pkgs.gawk}/bin/awk '{print "Gen" $5 " @ " $1 "-" $2}') gen=$(home-manager generations | head -n1 | ${pkgs.gawk}/bin/awk '{print "Gen" $5 " @ " $1 "-" $2}')
${pkgs.git}/bin/git commit --no-gpg-sign -am "Home $gen" by="$(${pkgs.coreutils-full}/bin/whoami)@$(${pkgs.nettools}/bin/hostname)"
${pkgs.git}/bin/git commit --no-gpg-sign -am "Home $gen by $by"
popd popd
''; '';
rebuild = rebuild =
@ -26,7 +23,8 @@
echo "NixOS Rebuilding..." echo "NixOS Rebuilding..."
${pkgs.nh}/bin/nh os switch ~/.nixos ${pkgs.nh}/bin/nh os switch ~/.nixos
gen=$(sudo nix-env --list-generations --profile /nix/var/nix/profiles/system | ${pkgs.gnugrep}/bin/grep current | ${pkgs.gawk}/bin/awk '{print "Gen" $1 " @ " $2 "-" $3}') gen=$(sudo nix-env --list-generations --profile /nix/var/nix/profiles/system | ${pkgs.gnugrep}/bin/grep current | ${pkgs.gawk}/bin/awk '{print "Gen" $1 " @ " $2 "-" $3}')
${pkgs.git}/bin/git commit --no-gpg-sign -am "System $gen" by="$(${pkgs.coreutils-full}/bin/whoami)@$(${pkgs.nettools}/bin/hostname)"
${pkgs.git}/bin/git commit --no-gpg-sign -am "System $gen by $by"
popd popd
''; '';
upgrade = upgrade =
@ -53,7 +51,8 @@
echo "NixOS Rebuilding..." echo "NixOS Rebuilding..."
${pkgs.nh}/bin/nh os switch ~/.nixos ${pkgs.nh}/bin/nh os switch ~/.nixos
gen=$(sudo nix-env --list-generations --profile /nix/var/nix/profiles/system | ${pkgs.gnugrep}/bin/grep current | ${pkgs.gawk}/bin/awk '{print "Gen" $1 " @ " $2 "-" $3}') gen=$(sudo nix-env --list-generations --profile /nix/var/nix/profiles/system | ${pkgs.gnugrep}/bin/grep current | ${pkgs.gawk}/bin/awk '{print "Gen" $1 " @ " $2 "-" $3}')
${pkgs.git}/bin/git commit --no-gpg-sign -am "Upgrade $gen" by="$(${pkgs.coreutils-full}/bin/whoami)@$(${pkgs.nettools}/bin/hostname)"
${pkgs.git}/bin/git commit --no-gpg-sign -am "Upgrade $gen by $by"
${pkgs.git}/bin/git branch -D "$branch_staging" ${pkgs.git}/bin/git branch -D "$branch_staging"
popd popd
''; '';