spotifyd + nixpkgs-fmt

This commit is contained in:
willemml 2023-02-05 17:20:34 -08:00
parent 18fdb1b562
commit 125183aa81
Signed by: willemml
GPG key ID: C3DE5DF6198DACBD
12 changed files with 183 additions and 195 deletions

View file

@ -45,7 +45,8 @@
shell = pkgs.zshInteractive; shell = pkgs.zshInteractive;
}; };
}; };
in { in
{
darwinConfigurations = { darwinConfigurations = {
zeus = darwin.lib.darwinSystem { zeus = darwin.lib.darwinSystem {
inherit system; inherit system;

View file

@ -46,8 +46,8 @@ in {
targets.darwin = { targets.darwin = {
defaults = { defaults = {
"com.googlecode.iterm2" = ./iterm2.nix; "com.googlecode.iterm2" = import ./iterm2.nix;
"com.apple.finder" = ./finder.nix; "com.apple.finder" = import ./finder.nix;
NSGlobalDomain = { NSGlobalDomain = {
AppleLanguages = [ "en-CA" ]; AppleLanguages = [ "en-CA" ];
AppleLocale = "en_CA"; AppleLocale = "en_CA";

View file

@ -2,7 +2,8 @@
let let
emacsCommand = "emacsclient -c -nw"; emacsCommand = "emacsclient -c -nw";
in rec { in
rec {
home = { home = {
file = { file = {
".config/nix/nix.conf".text = '' ".config/nix/nix.conf".text = ''

View file

@ -256,11 +256,13 @@ in {
latex = { latex = {
enable = true; enable = true;
package = epkgs: epkgs.auctex; package = epkgs: epkgs.auctex;
hook = ['' hook = [
''
(LaTeX-mode (LaTeX-mode
. (lambda () . (lambda ()
(turn-on-reftex))) (turn-on-reftex)))
'']; ''
];
init = '' init = ''
(setq TeX-PDF-mode t (setq TeX-PDF-mode t
TeX-auto-save t TeX-auto-save t

View file

@ -19,7 +19,8 @@ let
python-wp = pkgs.python310.withPackages (p: with p; [ setuptools pyaml requests latexify-py ]); python-wp = pkgs.python310.withPackages (p: with p; [ setuptools pyaml requests latexify-py ]);
node-packages = with pkgs.nodePackages; [ bash-language-server ]; node-packages = with pkgs.nodePackages; [ bash-language-server ];
octave-wp = pkgs.octave.withPackages (p: with p; [ symbolic ]); octave-wp = pkgs.octave.withPackages (p: with p; [ symbolic ]);
in { in
{
home.packages = with pkgs; home.packages = with pkgs;
[ [
autoconf autoconf
@ -42,8 +43,9 @@ in {
graphviz graphviz
htop htop
jq jq
nixfmt
nix-review nix-review
nixfmt
nixpkgs-fmt
nmap nmap
octave-wp octave-wp
openssh openssh
@ -51,12 +53,13 @@ in {
plantuml plantuml
pngpaste pngpaste
poppler poppler
python-wp
pv pv
python-wp
ripgrep ripgrep
rsync rsync
rustup rustup
shellcheck shellcheck
spotify-tui
sqlite sqlite
texinfo texinfo
texlive.combined.scheme-full texlive.combined.scheme-full
@ -67,7 +70,6 @@ in {
unzip unzip
wget wget
yq yq
zoom-us
] ]
++ lib.optionals stdenv.isDarwin darwin ++ lib.optionals stdenv.isDarwin darwin
++ lib.optionals stdenv.isLinux linux ++ lib.optionals stdenv.isLinux linux

View file

@ -26,7 +26,8 @@ let
}; };
}; };
src = srcs.${stdenv.hostPlatform.system}; src = srcs.${stdenv.hostPlatform.system};
in import ./mk-mac-binpkg.nix { in
import ./mk-mac-binpkg.nix {
inherit pkgs src pname appName version; inherit pkgs src pname appName version;
srcsubdir = "chrome-mac"; srcsubdir = "chrome-mac";
} }

View file

@ -10,4 +10,5 @@ let
sha256 = "sha256-V/8W3qqYhJmte2tq/ZSPtYChdhv8WFQoSORYRaxva9Y="; sha256 = "sha256-V/8W3qqYhJmte2tq/ZSPtYChdhv8WFQoSORYRaxva9Y=";
name = "${pname}_${version}.dmg"; name = "${pname}_${version}.dmg";
}; };
in import ./mk-mac-binpkg.nix { inherit pkgs src pname appName version; } in
import ./mk-mac-binpkg.nix { inherit pkgs src pname appName version; }

View file

@ -10,5 +10,6 @@ let
"https://phoenixnap.dl.sourceforge.net/project/qbittorrent/qbittorrent-mac/qbittorrent-${version}/qbittorrent-${version}.dmg"; "https://phoenixnap.dl.sourceforge.net/project/qbittorrent/qbittorrent-mac/qbittorrent-${version}/qbittorrent-${version}.dmg";
sha256 = "sha256-9h+gFAEU0tKrltOjnOKLfylbbBunGZqvPzQogdP9uQM="; sha256 = "sha256-9h+gFAEU0tKrltOjnOKLfylbbBunGZqvPzQogdP9uQM=";
}; };
in import ./mk-mac-binpkg.nix { inherit pkgs src pname appName version; } in
import ./mk-mac-binpkg.nix { inherit pkgs src pname appName version; }

View file

@ -1,43 +1,15 @@
{ stdenv, pkgs, ... }: { stdenv, pkgs, fetchurl, ... }:
stdenv.mkDerivation { let
name = "spotify-mac-app"; appName = "Spotify";
pname = "spotify";
sourceRoot = "."; version = "sha256-JESQZtyPE9o5PW/f5GdxbqbyeHCxs/oZEW0AakMJgKg=";
nativeBuildInputs =
[ pkgs.undmg pkgs.makeWrapper pkgs.perl pkgs.unzip pkgs.zip ];
src = pkgs.fetchurl { src = pkgs.fetchurl {
url = "https://download.scdn.co/Spotify.dmg"; url = "https://download.scdn.co/Spotify.dmg";
hash = "sha256-9Ts6064YaZdjbRN28qkZcrwTH+63drC/jUfTGLvpBNc="; hash = version;
name = "spotify-mac.dmg";
}; };
in
spotxsrc = pkgs.fetchFromGitHub { import ./mk-mac-binpkg.nix { inherit pkgs src pname appName version; }
name = "spotx-mac-src";
owner = "willemml";
repo = "SpotX-Mac";
rev = "03ea3aa59e135b9e2f68b6c8f4d4debe2b207830";
hash = "sha256-H3QxmM0ALtz58MKaQ6pFcK6wP8oMWufvQ2q2ZjpO5Gs=";
};
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
cp -r "Spotify.app" $out/Applications
# wrap executable to $out/bin
mkdir -p $out/bin
makeWrapper "$out/Applications/Spotify.app/Contents/MacOS/Spotify" "$out/bin/Spotify"
cp "$spotxsrc/install.sh" install.sh
chmod +x install.sh
./install.sh -a "$out/Applications/Spotify.app"
runHook postInstall
'';
}

View file

@ -19,7 +19,8 @@ let
}; };
}; };
src = srcs.${stdenv.hostPlatform.system}; src = srcs.${stdenv.hostPlatform.system};
in import ./mk-mac-binpkg.nix { in
import ./mk-mac-binpkg.nix {
inherit stdenv pkgs fetchurl src pname appName version; inherit stdenv pkgs fetchurl src pname appName version;
} }

View file

@ -2,6 +2,12 @@
{ {
services.nix-daemon.enable = true; 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";
};
nix.package = pkgs.nix; nix.package = pkgs.nix;
@ -21,7 +27,7 @@
remapCapsLockToEscape = true; remapCapsLockToEscape = true;
# see https://developer.apple.com/library/content/technotes/tn2450/_index.html for more info # see https://developer.apple.com/library/content/technotes/tn2450/_index.html for more info
userKeyMapping = [ { userKeyMapping = [{
HIDKeyboardModifierMappingSrc = 30064771303; # remap right command to right control. HIDKeyboardModifierMappingSrc = 30064771303; # remap right command to right control.
HIDKeyboardModifierMappingDst = 30064771300; HIDKeyboardModifierMappingDst = 30064771300;
}]; }];