mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-10 02:52:55 +00:00
merge darwin and nixos rebuild function
This commit is contained in:
parent
708672b2e3
commit
0229df9b97
@ -37,13 +37,6 @@
|
||||
|
||||
xdg.configFile.hammerspoon = { source = ./hammerspoon; };
|
||||
|
||||
programs.fish = {
|
||||
shellAbbrs = {
|
||||
nr =
|
||||
"sudo darwin-rebuild switch --flake ${config.dotfilesPath}#macbook";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
system.activationScripts.hammerspoon.text = ''
|
||||
|
@ -16,10 +16,21 @@
|
||||
|
||||
};
|
||||
|
||||
programs.fish = {
|
||||
shellAbbrs = {
|
||||
nr = lib.mkIf pkgs.stdenv.isLinux
|
||||
"doas nixos-rebuild switch --flake ${config.dotfilesPath}";
|
||||
programs.fish = let
|
||||
system = if pkgs.stdenv.isDarwin then "darwin" else "nixos";
|
||||
sudo = if pkgs.stdenv.isDarwin then "doas" else "sudo";
|
||||
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}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user