dotfiles/modules/darwin/dotfiles.nix

29 lines
661 B
Nix
Raw Normal View History

2022-06-20 18:33:19 +00:00
{ config, lib, ... }: {
2022-06-20 03:44:29 +00:00
home-manager.users.${config.user} = {
programs.fish = {
shellAbbrs = {
2022-06-20 03:54:16 +00:00
nr = lib.mkForce "rebuild-darwin";
nro = lib.mkForce "rebuild-darwin offline";
2022-06-20 03:44:29 +00:00
};
functions = {
2022-06-20 03:54:16 +00:00
rebuild-darwin = {
2022-06-20 03:44:29 +00:00
body = ''
if test "$argv[1]" = "offline"
set option "--option substitute false"
end
pushd ${config.dotfilesPath}
git add --all
popd
2022-06-20 03:54:16 +00:00
commandline -r "darwin-rebuild switch $option --flake ${config.dotfilesPath}#macbook"
2022-06-20 03:44:29 +00:00
commandline -f execute
'';
};
};
};
};
}