From e0588878b13cd27c06207798b64ce1620f5670f7 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sun, 16 Mar 2025 15:12:07 -0400 Subject: [PATCH] darwin build --- .../modules/nmasur/presets/fonts.nix | 2 +- .../nmasur/presets/programs/git-work.nix | 2 +- .../presets/services/hammerspoon/default.nix | 2 +- .../modules/nmasur/profiles/darwin-base.nix | 6 +++++ .../modules/nmasur/presets/services/dock.nix | 2 +- .../nmasur/presets/services/nix-daemon.nix | 24 ------------------- .../modules/nmasur/presets/services/nix.nix | 7 ++++++ .../nmasur/presets/services/settings.nix | 2 +- .../modules/nmasur/presets/services/user.nix | 2 +- .../modules/nmasur/profiles/base.nix | 17 ++++++++++--- 10 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 platforms/nix-darwin/modules/nmasur/presets/services/nix-daemon.nix diff --git a/platforms/home-manager/modules/nmasur/presets/fonts.nix b/platforms/home-manager/modules/nmasur/presets/fonts.nix index a9650ec..a2c45c7 100644 --- a/platforms/home-manager/modules/nmasur/presets/fonts.nix +++ b/platforms/home-manager/modules/nmasur/presets/fonts.nix @@ -15,7 +15,7 @@ in config = lib.mkIf cfg.enable { home.packages = [ - pkgs.victor-mono # Used for Vim and Terminal + pkgs.nerd-fonts.victor-mono # Used for Vim and Terminal pkgs.nerd-fonts.hack # For Polybar, Rofi ]; fonts.fontconfig = { diff --git a/platforms/home-manager/modules/nmasur/presets/programs/git-work.nix b/platforms/home-manager/modules/nmasur/presets/programs/git-work.nix index ca83ad1..efb6e7b 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/git-work.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/git-work.nix @@ -44,7 +44,7 @@ in userEmail = lib.mkForce cfg.work.email; includes = [ { - path = "${config.xdg.configHome}/${config.xdg.configFile."git/personal".target}"; + path = "${config.home.homeDirectory}/${config.xdg.configFile."git/personal".target}"; condition = "gitdir:~/dev/personal/"; } ]; diff --git a/platforms/home-manager/modules/nmasur/presets/services/hammerspoon/default.nix b/platforms/home-manager/modules/nmasur/presets/services/hammerspoon/default.nix index 5fbf9ba..980c52f 100644 --- a/platforms/home-manager/modules/nmasur/presets/services/hammerspoon/default.nix +++ b/platforms/home-manager/modules/nmasur/presets/services/hammerspoon/default.nix @@ -20,7 +20,7 @@ in xdg.configFile."hammerspoon/Spoons/DismissAlerts.spoon".source = ./Spoons/DismissAlerts.spoon; xdg.configFile."hammerspoon/Spoons/Launcher.spoon/init.lua".source = pkgs.substituteAll { src = ./Spoons/Launcher.spoon/init.lua; - firefox = "${pkgs.firefox-bin}/Applications/Firefox.app"; + firefox = "${pkgs.firefox-unwrapped}/Applications/Firefox.app"; discord = "${pkgs.discord}/Applications/Discord.app"; wezterm = "${pkgs.wezterm}/Applications/WezTerm.app"; obsidian = "${pkgs.obsidian}/Applications/Obsidian.app"; diff --git a/platforms/home-manager/modules/nmasur/profiles/darwin-base.nix b/platforms/home-manager/modules/nmasur/profiles/darwin-base.nix index 26b940e..78d4090 100644 --- a/platforms/home-manager/modules/nmasur/profiles/darwin-base.nix +++ b/platforms/home-manager/modules/nmasur/profiles/darwin-base.nix @@ -15,6 +15,12 @@ in config = lib.mkIf cfg.enable { + nmasur.presets = { + fonts.enable = lib.mkDefault true; + services.hammerspoon.enable = lib.mkDefault true; + programs.nixpkgs-darwin.enable = lib.mkDefault true; + }; + home.homeDirectory = lib.mkForce "/Users/${config.home.username}"; # Default shell setting doesn't work diff --git a/platforms/nix-darwin/modules/nmasur/presets/services/dock.nix b/platforms/nix-darwin/modules/nmasur/presets/services/dock.nix index ac6b91a..1cb0b45 100644 --- a/platforms/nix-darwin/modules/nmasur/presets/services/dock.nix +++ b/platforms/nix-darwin/modules/nmasur/presets/services/dock.nix @@ -45,7 +45,7 @@ in "/Applications/1Password.app" "${pkgs.slack}/Applications/Slack.app" "/System/Applications/Calendar.app" - "${pkgs.firefox-bin}/Applications/Firefox.app" + "${pkgs.firefox-unwrapped}/Applications/Firefox.app" "/System/Applications/Messages.app" "/System/Applications/Mail.app" "/Applications/zoom.us.app" diff --git a/platforms/nix-darwin/modules/nmasur/presets/services/nix-daemon.nix b/platforms/nix-darwin/modules/nmasur/presets/services/nix-daemon.nix deleted file mode 100644 index 3533785..0000000 --- a/platforms/nix-darwin/modules/nmasur/presets/services/nix-daemon.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - config, - lib, - ... -}: - -let - cfg = config.nmasur.presets.services.nix-daemon; -in - -{ - - options.nmasur.presets.services.nix-daemon.enable = lib.mkEnableOption "Nix garbage collection"; - - config = lib.mkIf cfg.enable { - services.nix-daemon.enable = true; - - nix.gc.interval = { - Hour = 12; - Minute = 15; - Day = 1; - }; - }; -} diff --git a/platforms/nix-darwin/modules/nmasur/presets/services/nix.nix b/platforms/nix-darwin/modules/nmasur/presets/services/nix.nix index 0cd0077..2d209ee 100644 --- a/platforms/nix-darwin/modules/nmasur/presets/services/nix.nix +++ b/platforms/nix-darwin/modules/nmasur/presets/services/nix.nix @@ -18,6 +18,8 @@ in nix = { + enable = true; + # Set channel to flake packages, used for nix-shell commands nixPath = [ "nixpkgs=${pkgs.path}" ]; @@ -37,6 +39,11 @@ in gc = { automatic = true; options = "--delete-older-than 10d"; + interval = { + Hour = 12; + Minute = 15; + Day = 1; + }; }; settings = { diff --git a/platforms/nix-darwin/modules/nmasur/presets/services/settings.nix b/platforms/nix-darwin/modules/nmasur/presets/services/settings.nix index ec19c67..715cbe7 100644 --- a/platforms/nix-darwin/modules/nmasur/presets/services/settings.nix +++ b/platforms/nix-darwin/modules/nmasur/presets/services/settings.nix @@ -14,7 +14,7 @@ in config = lib.mkIf cfg.enable { - security.pam.enableSudoTouchIdAuth = true; + security.pam.services.sudo_local.touchIdAuth = true; system = { diff --git a/platforms/nix-darwin/modules/nmasur/presets/services/user.nix b/platforms/nix-darwin/modules/nmasur/presets/services/user.nix index 384a518..4a2fac4 100644 --- a/platforms/nix-darwin/modules/nmasur/presets/services/user.nix +++ b/platforms/nix-darwin/modules/nmasur/presets/services/user.nix @@ -16,7 +16,7 @@ in config = lib.mkIf cfg.enable { users.users."${username}" = { # macOS user - home = config.home-manager.users.${username}.home.homeDirectory; + home = "/Users/${username}"; uid = 502; # shell = pkgs.fish; # Default shell }; diff --git a/platforms/nix-darwin/modules/nmasur/profiles/base.nix b/platforms/nix-darwin/modules/nmasur/profiles/base.nix index bf76af7..a0157b3 100644 --- a/platforms/nix-darwin/modules/nmasur/profiles/base.nix +++ b/platforms/nix-darwin/modules/nmasur/profiles/base.nix @@ -14,9 +14,20 @@ in config = lib.mkIf cfg.enable { - nmasur.presets.programs = { - fish.enable = lib.mkDefault true; - homebrew.enable = lib.mkDefault true; + nmasur.presets = { + programs = { + fish.enable = lib.mkDefault true; + homebrew.enable = lib.mkDefault true; + }; + services = { + dock.enable = lib.mkDefault true; + finder.enable = lib.mkDefault true; + hammerspoon.enable = lib.mkDefault true; + menubar.enable = lib.mkDefault true; + nix.enable = lib.mkDefault true; + settings.enable = lib.mkDefault true; + user.enable = lib.mkDefault true; + }; }; homebrew.brews = [