dotfiles/modules/darwin/nixpkgs.nix
2024-12-16 13:43:57 -05:00

43 lines
1.1 KiB
Nix

{
config,
pkgs,
lib,
...
}:
{
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
programs.fish = {
shellAbbrs = {
nr = {
function = lib.mkForce "rebuild-darwin";
};
nro = {
function = lib.mkForce "rebuild-darwin-offline";
};
};
functions = {
rebuild-darwin = {
body = ''
git -C ${config.dotfilesPath} add --intent-to-add --all
echo "darwin-rebuild switch --flake ${config.dotfilesPath}#lookingglass"
'';
};
rebuild-darwin-offline = {
body = ''
git -C ${config.dotfilesPath} add --intent-to-add --all
echo "darwin-rebuild switch --option substitute false --flake ${config.dotfilesPath}#lookingglass"
'';
};
rebuild-home = lib.mkForce {
body = ''
git -C ${config.dotfilesPath} add --intent-to-add --all
echo "${pkgs.home-manager}/bin/home-manager switch --flake ${config.dotfilesPath}#lookingglass";
'';
};
};
};
};
}