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";
|
2025-02-05 17:25:29 -05:00
|
|
|
default =
|
|
|
|
config.nmasur.presets.programs.nixpkgs.enable
|
|
|
|
&& pkgs.stdenv.isDarwin
|
|
|
|
&& config.nmasur.presets.programs.dotfiles.enable;
|
2025-01-20 22:35:40 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf (cfg.enable) {
|
2022-06-19 23:44:29 -04:00
|
|
|
|
|
|
|
programs.fish = {
|
2025-02-05 17:25:29 -05:00
|
|
|
shellAbbrs = lib.mkIf config.nmasur.presets.programs.dotfiles.enable {
|
2024-12-05 22:00:14 +00:00
|
|
|
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
|
|
|
};
|
2025-02-05 17:25:29 -05:00
|
|
|
functions = lib.mkIf config.nmasur.presets.programs.dotfiles.enable {
|
2022-06-19 23:54:16 -04:00
|
|
|
rebuild-darwin = {
|
2022-06-19 23:44:29 -04:00
|
|
|
body = ''
|
2025-02-05 17:25:29 -05:00
|
|
|
git -C ${config.nmasur.presets.programs.dotfiles.path} add --intent-to-add --all
|
|
|
|
echo "darwin-rebuild switch --flake ${config.nmasur.presets.programs.dotfiles.path}#lookingglass"
|
2024-12-16 13:43:54 -05:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
rebuild-darwin-offline = {
|
|
|
|
body = ''
|
2025-02-05 17:25:29 -05:00
|
|
|
git -C ${config.nmasur.presets.programs.dotfiles.path} add --intent-to-add --all
|
|
|
|
echo "darwin-rebuild switch --option substitute false --flake ${config.nmasur.presets.programs.dotfiles.path}#lookingglass"
|
2022-06-19 23:44:29 -04:00
|
|
|
'';
|
|
|
|
};
|
2022-10-30 20:14:41 -04:00
|
|
|
rebuild-home = lib.mkForce {
|
|
|
|
body = ''
|
2025-02-05 17:25:29 -05:00
|
|
|
git -C ${config.nmasur.presets.programs.dotfiles.path} add --intent-to-add --all
|
|
|
|
echo "${lib.getExe pkgs.home-manager} switch --flake ${config.nmasur.presets.programs.dotfiles.path}#lookingglass";
|
2022-10-30 20:14:41 -04:00
|
|
|
'';
|
|
|
|
};
|
2022-06-19 23:44:29 -04:00
|
|
|
};
|
|
|
|
};
|
2025-01-20 22:35:40 -05:00
|
|
|
|
2022-06-19 23:44:29 -04:00
|
|
|
};
|
|
|
|
}
|