summaryrefslogtreecommitdiff
path: root/users/kassouni/palette/rebuild.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/kassouni/palette/rebuild.nix')
-rw-r--r--users/kassouni/palette/rebuild.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/users/kassouni/palette/rebuild.nix b/users/kassouni/palette/rebuild.nix
new file mode 100644
index 0000000..e42a7c5
--- /dev/null
+++ b/users/kassouni/palette/rebuild.nix
@@ -0,0 +1,20 @@
+{ writers, ghostty }:
+{
+ name = "rebuild";
+ icon = "󱄅";
+ # Rebuilds need a terminal: sudo prompts for a password and nixos-rebuild
+ # streams a lot of output. Spawn ghostty with a login shell so it inherits
+ # the system sudo (setuid) and the user's nix from PATH. Mirrors `make rebuild`.
+ exe = writers.writeBash "rebuild" ''
+ set -eu
+ exec ${ghostty}/bin/ghostty -e bash -lc '
+ set -eu
+ cd /home/kassouni/Developer/nixos-config
+ nix flake update xmonad-config
+ sudo nixos-rebuild switch --flake .
+ echo
+ echo "Rebuild finished. Press enter to close."
+ read -r _
+ '
+ '';
+}