mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-09 16:22:56 +00:00
18 lines
415 B
Nix
18 lines
415 B
Nix
{ 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
|
|
sudo darwin-rebuild switch --flake ${builtins.toString ../.}
|
|
else
|
|
doas nixos-rebuild switch --flake ${builtins.toString ../.}
|
|
fi
|
|
''
|
|
);
|
|
}
|