diff --git a/flake.nix b/flake.nix index c865232..2cee535 100644 --- a/flake.nix +++ b/flake.nix @@ -49,7 +49,7 @@ { darwinConfigurations = { zeus = darwin.lib.darwinSystem { - inherit system; + inherit system pkgs; modules = [ ./system/darwin.nix home-manager.darwinModules.home-manager diff --git a/home/darwin/apps.nix b/home/darwin/apps.nix deleted file mode 100644 index 1d8a51d..0000000 --- a/home/darwin/apps.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ config, lib, pkgs, ... }: - -# see https://github.com/nix-community/home-manager/issues/1341 - -{ - disabledModules = [ "targets/darwin/linkapps.nix" ]; - - home.activation = lib.mkIf pkgs.stdenv.isDarwin { - copyApplications = let - apps = pkgs.buildEnv { - name = "home-manager-applications"; - paths = config.home.packages; - pathsToLink = "/Applications"; - }; - in lib.hm.dag.entryAfter [ "writeBoundary" ] '' - baseDir="$HOME/Applications/Home Manager Apps" - if [ -d "$baseDir" ]; then - rm -rf "$baseDir" - fi - mkdir -p "$baseDir" - for appFile in ${apps}/Applications/*; do - target="$baseDir/$(basename "$appFile")" - $DRY_RUN_CMD cp ''${VERBOSE_ARG:+-v} -fHRL "$appFile" "$baseDir" - $DRY_RUN_CMD chmod ''${VERBOSE_ARG:+-v} -R +w "$target" - done - ''; - }; -} diff --git a/home/darwin/default.nix b/home/darwin/default.nix index c4c9948..bdd0a4f 100644 --- a/home/darwin/default.nix +++ b/home/darwin/default.nix @@ -17,7 +17,7 @@ let zotero = "Zotero"; }; in { - imports = [ ./launchd.nix ./apps.nix ]; + imports = [ ./launchd.nix ]; home.file.".gnupg/gpg-agent.conf".text = mkIf stdenv.isDarwin '' pinentry-program "${pkgs.pinentry-touchid}/bin/pinentry-touchid" @@ -51,31 +51,12 @@ in { NSGlobalDomain = { AppleLanguages = [ "en-CA" ]; AppleLocale = "en_CA"; - AppleMeasurementUnits = "Centimeters"; - AppleMetricUnits = true; - AppleTemperatureUnit = "Celsius"; - NSAutomaticCapitalizationEnabled = false; - NSAutomaticDashSubstitutionEnabled = false; - NSAutomaticPeriodSubstitutionEnabled = false; - NSAutomaticQuoteSubstitutionEnabled = false; - NSAutomaticSpellingCorrectionEnabled = false; }; "com.apple.Safari" = { AutoOpenSafeDownloads = false; IncludeDevelopMenu = true; ShowFullURLInSmartSearchField = true; }; - "com.apple.dock" = { - autohide = true; - launchanim = false; - magnification = false; - minimize-to-application = true; - mru-spaces = false; - orientation = "bottom"; - static-only = true; - tilesize = 35; - workspaces-swoosh-animation-off = true; - }; "com.apple.menuextra.clock" = { DateFormat = "EEE d MMM HH:mm:ss"; FlashDateSeparators = false; diff --git a/home/darwin/finder.nix b/home/darwin/finder.nix index 388e343..8ca6678 100644 --- a/home/darwin/finder.nix +++ b/home/darwin/finder.nix @@ -156,6 +156,8 @@ in { WarnOnEmptyTrash = false; + _FXShowPosixPathInTitle = true; + _FXSortFoldersFirst = true; _FXSortFoldersFirstOnDesktop = true; diff --git a/home/darwin/launchd.nix b/home/darwin/launchd.nix index 2845808..07cb2a1 100644 --- a/home/darwin/launchd.nix +++ b/home/darwin/launchd.nix @@ -14,9 +14,32 @@ KeepAlive = true; UserName = "${config.home.username}"; ProcessType = "Adaptive"; - StandardOutPath = "${config.home.homeDirectory}/.emacs.d/daemon-stdout"; + StandardOutPath = "${config.home.homeDirectory}/Library/Logs/emacs-stdout.log"; StandardErrorPath = - "${config.home.homeDirectory}/.emacs.d/daemon-stderr"; + "${config.home.homeDirectory}/Library/Logs/emacs-stderr.log"; + + }; + }; + + agents.spotifyd = { + enable = true; + config = { + ProgramArguments = [ + "${pkgs.spotifyd}/bin/spotifyd" + "--no-daemon" + "--username-cmd" + "${pkgs.pass}/bin/pass 'music/spotify' | grep login | cut -f2 -d ' '" + "--password-cmd" + "${pkgs.pass}/bin/pass 'music/spotify' | head -n1" + "--backend" + "portaudio" + ]; + KeepAlive = true; + UserName = "${config.home.username}"; + StandardOutPath = "${config.home.homeDirectory}/Library/Logs/spotifyd-stdout.log"; + StandardErrorPath = + "${config.home.homeDirectory}/Library/Logs/spotifyd-stderr.log"; + }; }; }; diff --git a/home/packages.nix b/home/packages.nix index e8201b8..4712e6c 100644 --- a/home/packages.nix +++ b/home/packages.nix @@ -7,9 +7,8 @@ let freecad-mac gnused iterm2 - karabiner-elements - pinentry_mac pinentry-touchid + pinentry_mac qbittorrent-mac spoof-mac spotify-mac @@ -61,6 +60,7 @@ in rustup shellcheck spotify-tui + spotifyd sqlite texinfo texlive.combined.scheme-full diff --git a/system/darwin.nix b/system/darwin.nix index 312f235..4c54fe3 100644 --- a/system/darwin.nix +++ b/system/darwin.nix @@ -1,31 +1,65 @@ { pkgs, ... }: { - services.nix-daemon.enable = true; - services.spotifyd = { - enable = true; - settings.use_keyring = true; - settings.username_cmd = "${pkgs.pass}/bin/pass 'music/spotify' | grep login | cut -f2 -d ' '"; - settings.password_cmd = "${pkgs.pass}/bin/pass 'music/spotify' | head -n1"; - }; + environment.systemPackages = with pkgs; [ ]; nix.package = pkgs.nix; + programs.bash.enable = true; + programs.zsh.enable = true; + services.nix-daemon.enable = true; + system = { defaults = { - loginwindow.SHOWFULLNAME = false; - loginwindow.GuestEnabled = false; - loginwindow.DisableConsoleAccess = true; - finder._FXShowPosixPathInTitle = true; + loginwindow = { + SHOWFULLNAME = false; + GuestEnabled = false; + DisableConsoleAccess = true; + }; LaunchServices.LSQuarantine = false; + dock = { + autohide = true; + launchanim = false; + minimize-to-application = true; + mru-spaces = false; + orientation = "bottom"; + static-only = true; + tilesize = 35; + }; + NSGlobalDomain = { + "com.apple.sound.beep.feedback" = 1; + AppleICUForce24HourTime = true; + AppleInterfaceStyle = "Dark"; + AppleMeasurementUnits = "Centimeters"; + AppleMetricUnits = 1; + AppleShowAllExtensions = true; + AppleShowScrollBars = "WhenScrolling"; + AppleTemperatureUnit = "Celsius"; + NSAutomaticCapitalizationEnabled = false; + NSAutomaticDashSubstitutionEnabled = false; + NSAutomaticPeriodSubstitutionEnabled = false; + NSAutomaticQuoteSubstitutionEnabled = false; + NSAutomaticSpellingCorrectionEnabled = false; + NSAutomaticWindowAnimationsEnabled = false; + NSDocumentSaveNewDocumentsToCloud = false; + NSNavPanelExpandedStateForSaveMode = true; + NSNavPanelExpandedStateForSaveMode2 = true; + NSTableViewDefaultSizeMode = 1; + NSTextShowsControlCharacters = true; + NSWindowResizeTime = 0.0; + }; + trackpad = { + FirstClickThreshold = 0; + SecondClickThreshold = 2; + Clicking = true; + }; }; + keyboard = { enableKeyMapping = true; - remapCapsLockToEscape = true; - # see https://developer.apple.com/library/content/technotes/tn2450/_index.html for more info userKeyMapping = [{ HIDKeyboardModifierMappingSrc = 30064771303; # remap right command to right control.