54 lines
1.3 KiB
Nix
Raw Normal View History

2024-04-20 09:42:06 -04:00
{
config,
pkgs,
lib,
...
}:
2025-01-20 22:35:40 -05:00
let
cfg = config.nmasur.presets.programs.nixpkgs-darwin;
in
2024-04-20 09:42:06 -04:00
{
2022-06-19 23:44:29 -04:00
2025-01-20 22:35:40 -05:00
options.nmasur.presets.programs.nixpkgs-darwin.enable = lib.mkEnableOption {
description = "Nixpkgs tools for macOS";
default = config.nmasur.presets.programs.nixpkgs && pkgs.stdenv.isDarwin;
};
config = lib.mkIf (cfg.enable) {
2022-06-19 23:44:29 -04:00
programs.fish = {
shellAbbrs = {
nr = {
function = lib.mkForce "rebuild-darwin";
};
2024-12-16 13:43:54 -05:00
nro = {
function = lib.mkForce "rebuild-darwin-offline";
};
2022-06-19 23:44:29 -04:00
};
functions = {
2022-06-19 23:54:16 -04:00
rebuild-darwin = {
2022-06-19 23:44:29 -04:00
body = ''
2022-07-13 02:15:00 +00:00
git -C ${config.dotfilesPath} add --intent-to-add --all
2024-12-16 13:43:54 -05:00
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"
2022-06-19 23:44:29 -04:00
'';
};
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";
'';
};
2022-06-19 23:44:29 -04:00
};
};
2025-01-20 22:35:40 -05:00
2022-06-19 23:44:29 -04:00
};
}