make sure to use sudo when rebuilding darwin

This commit is contained in:
Noah Masur
2025-07-26 16:00:51 -04:00
parent 3e7afdc0b3
commit eb1c08f5da

View File

@ -24,7 +24,7 @@ in
# These are useful for triggering from zellij (rather than running directly in the shell) # These are useful for triggering from zellij (rather than running directly in the shell)
nmasur.presets.programs.nixpkgs.commands.rebuildNixos = pkgs.writeShellScriptBin "rebuild-darwin" '' nmasur.presets.programs.nixpkgs.commands.rebuildNixos = pkgs.writeShellScriptBin "rebuild-darwin" ''
git -C ${config.nmasur.presets.programs.dotfiles.path} add --intent-to-add --all git -C ${config.nmasur.presets.programs.dotfiles.path} add --intent-to-add --all
darwin-rebuild switch --flake "${config.nmasur.presets.programs.dotfiles.path}#${config.nmasur.settings.host}" sudo darwin-rebuild switch --flake "${config.nmasur.presets.programs.dotfiles.path}#${config.nmasur.settings.host}"
''; '';
programs.fish = { programs.fish = {
@ -40,13 +40,13 @@ in
rebuild-darwin = { rebuild-darwin = {
body = '' body = ''
git -C ${config.nmasur.presets.programs.dotfiles.path} add --intent-to-add --all git -C ${config.nmasur.presets.programs.dotfiles.path} add --intent-to-add --all
echo "darwin-rebuild switch --flake ${config.nmasur.presets.programs.dotfiles.path}#lookingglass" echo "sudo darwin-rebuild switch --flake ${config.nmasur.presets.programs.dotfiles.path}#lookingglass"
''; '';
}; };
rebuild-darwin-offline = { rebuild-darwin-offline = {
body = '' body = ''
git -C ${config.nmasur.presets.programs.dotfiles.path} add --intent-to-add --all git -C ${config.nmasur.presets.programs.dotfiles.path} add --intent-to-add --all
echo "darwin-rebuild switch --option substitute false --flake ${config.nmasur.presets.programs.dotfiles.path}#lookingglass" echo "sudo darwin-rebuild switch --option substitute false --flake ${config.nmasur.presets.programs.dotfiles.path}#lookingglass"
''; '';
}; };
rebuild-home = lib.mkForce { rebuild-home = lib.mkForce {