dotfiles/apps/rebuild.nix

16 lines
392 B
Nix
Raw Normal View History

{ pkgs, ... }: {
type = "app";
program = builtins.toString (pkgs.writeShellScript "rebuild" ''
echo ${pkgs.system}
SYSTEM=${if pkgs.stdenv.isDarwin then "darwin" else "linux"}
if [ "$SYSTEM" == "darwin" ]; then
2023-04-02 22:47:06 +00:00
sudo darwin-rebuild switch --flake ${builtins.toString ../.}
else
2023-04-02 22:47:06 +00:00
doas nixos-rebuild switch --flake ${builtins.toString ../.}
fi
'');
}