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;
};
};
in {
in
{
darwinConfigurations = {
zeus = darwin.lib.darwinSystem {
inherit system;

View file

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

View file

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

View file

@ -256,11 +256,13 @@ in {
latex = {
enable = true;
package = epkgs: epkgs.auctex;
hook = [''
hook = [
''
(LaTeX-mode
. (lambda ()
(turn-on-reftex)))
''];
''
];
init = ''
(setq TeX-PDF-mode 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 ]);
node-packages = with pkgs.nodePackages; [ bash-language-server ];
octave-wp = pkgs.octave.withPackages (p: with p; [ symbolic ]);
in {
in
{
home.packages = with pkgs;
[
autoconf
@ -42,8 +43,9 @@ in {
graphviz
htop
jq
nixfmt
nix-review
nixfmt
nixpkgs-fmt
nmap
octave-wp
openssh
@ -51,12 +53,13 @@ in {
plantuml
pngpaste
poppler
python-wp
pv
python-wp
ripgrep
rsync
rustup
shellcheck
spotify-tui
sqlite
texinfo
texlive.combined.scheme-full
@ -67,7 +70,6 @@ in {
unzip
wget
yq
zoom-us
]
++ lib.optionals stdenv.isDarwin darwin
++ lib.optionals stdenv.isLinux linux

View file

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

View file

@ -10,4 +10,5 @@ let
sha256 = "sha256-V/8W3qqYhJmte2tq/ZSPtYChdhv8WFQoSORYRaxva9Y=";
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";
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 {
name = "spotify-mac-app";
sourceRoot = ".";
nativeBuildInputs =
[ pkgs.undmg pkgs.makeWrapper pkgs.perl pkgs.unzip pkgs.zip ];
let
appName = "Spotify";
pname = "spotify";
version = "sha256-JESQZtyPE9o5PW/f5GdxbqbyeHCxs/oZEW0AakMJgKg=";
src = pkgs.fetchurl {
url = "https://download.scdn.co/Spotify.dmg";
hash = "sha256-9Ts6064YaZdjbRN28qkZcrwTH+63drC/jUfTGLvpBNc=";
hash = version;
name = "spotify-mac.dmg";
};
spotxsrc = pkgs.fetchFromGitHub {
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
'';
}
in
import ./mk-mac-binpkg.nix { inherit pkgs src pname appName version; }

View file

@ -19,7 +19,8 @@ let
};
};
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;
}

View file

@ -2,6 +2,12 @@
{
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;