merge darwin and nixos rebuild function

This commit is contained in:
Noah Masur 2022-06-14 19:03:16 -04:00
parent 708672b2e3
commit 0229df9b97
3 changed files with 15 additions and 14 deletions

View File

@ -1,3 +0,0 @@
nix:
git add -A
doas nixos-rebuild switch --flake .

View File

@ -37,13 +37,6 @@
xdg.configFile.hammerspoon = { source = ./hammerspoon; }; xdg.configFile.hammerspoon = { source = ./hammerspoon; };
programs.fish = {
shellAbbrs = {
nr =
"sudo darwin-rebuild switch --flake ${config.dotfilesPath}#macbook";
};
};
}; };
system.activationScripts.hammerspoon.text = '' system.activationScripts.hammerspoon.text = ''

View File

@ -16,10 +16,21 @@
}; };
programs.fish = { programs.fish = let
shellAbbrs = { system = if pkgs.stdenv.isDarwin then "darwin" else "nixos";
nr = lib.mkIf pkgs.stdenv.isLinux sudo = if pkgs.stdenv.isDarwin then "doas" else "sudo";
"doas nixos-rebuild switch --flake ${config.dotfilesPath}"; in {
shellAbbrs = { nr = lib.mkIf pkgs.stdenv.isLinux "rebuild-${system}"; };
functions = {
rebuild-nixos = {
body = ''
pushd ${config.dotfilesPath}
git add --all
popd
echo "${sudo} ${system}-rebuild switch --flake ${config.dotfilesPath}"
${sudo} ${system}-rebuild switch --flake ${config.dotfilesPath}
'';
};
}; };
}; };