diff --git a/Makefile b/Makefile deleted file mode 100644 index 45779bd..0000000 --- a/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -nix: - git add -A - doas nixos-rebuild switch --flake . diff --git a/modules/darwin/utilities.nix b/modules/darwin/utilities.nix index 7e3d61d..f085c32 100644 --- a/modules/darwin/utilities.nix +++ b/modules/darwin/utilities.nix @@ -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 = '' diff --git a/modules/editor/dotfiles.nix b/modules/editor/dotfiles.nix index 8cb5ec3..aab77c2 100644 --- a/modules/editor/dotfiles.nix +++ b/modules/editor/dotfiles.nix @@ -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} + ''; + }; }; };