move spotifyd

This commit is contained in:
willemml 2023-02-06 14:44:33 -08:00
parent f26588204b
commit dfc17e0b17
Signed by: willemml
GPG key ID: C3DE5DF6198DACBD
7 changed files with 78 additions and 66 deletions

View file

@ -49,7 +49,7 @@
{
darwinConfigurations = {
zeus = darwin.lib.darwinSystem {
inherit system;
inherit system pkgs;
modules = [
./system/darwin.nix
home-manager.darwinModules.home-manager

View file

@ -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
'';
};
}

View file

@ -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;

View file

@ -156,6 +156,8 @@ in {
WarnOnEmptyTrash = false;
_FXShowPosixPathInTitle = true;
_FXSortFoldersFirst = true;
_FXSortFoldersFirstOnDesktop = true;

View file

@ -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";
};
};
};

View file

@ -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

View file

@ -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.