mirror of
https://github.com/willemml/dotfiles.nix.git
synced 2025-04-13 19:57:19 +00:00
re-add spotify
This commit is contained in:
parent
925184f254
commit
6eb110370b
3 changed files with 148 additions and 33 deletions
138
emacs.nix
138
emacs.nix
|
@ -390,31 +390,64 @@ in {
|
||||||
(my/org-force-open-current-window)))
|
(my/org-force-open-current-window)))
|
||||||
'';
|
'';
|
||||||
init = ''
|
init = ''
|
||||||
(setq org-src-window-setup 'current-window)
|
(defvar my/org-dir "~/Documents/org/")
|
||||||
(setq org-confirm-babel-evaluate nil)
|
|
||||||
(setq org-src-fontify-natively t)
|
|
||||||
(setq org-src-tab-acts-natively t)
|
|
||||||
(setq org-src-preserve-indentation t)
|
|
||||||
|
|
||||||
(setq org-export-with-tags nil)
|
(require 'oc)
|
||||||
|
|
||||||
(setq org-publish-project-alist
|
(setq org-src-window-setup 'current-window)
|
||||||
'(("Root"
|
(setq org-confirm-babel-evaluate nil)
|
||||||
:base-directory "~/Documents/org/roam/"
|
(setq org-src-fontify-natively t)
|
||||||
:publishing-function org-html-publish-to-html
|
(setq org-src-tab-acts-natively t)
|
||||||
:publishing-directory "~/public_html"
|
(setq org-src-preserve-indentation t)
|
||||||
:section-numbers nil
|
|
||||||
:with-author nil
|
|
||||||
:with-creator t
|
|
||||||
:with-toc t
|
|
||||||
:time-stamp-file nil)))
|
|
||||||
|
|
||||||
;; Configure HTML export
|
(setq org-export-with-tags nil)
|
||||||
(setq org-html-validation-link nil)
|
|
||||||
(setq org-html-head-include-scripts nil)
|
(setq org-publish-project-alist
|
||||||
(setq org-html-head-include-default-style nil)
|
'(("root"
|
||||||
(setq org-html-head "<link rel=\"stylesheet\" href=\"https://cdn.simplecss.org/simple.min.css\" />")
|
:base-directory (expand-file-name my/org-dir)
|
||||||
(setq org-html-section)
|
:publishing-function org-html-publish-to-html
|
||||||
|
:publishing-directory (expand-file-name "~/public_html")
|
||||||
|
:section-numbers nil
|
||||||
|
|
||||||
|
:with-author nil
|
||||||
|
:with-creator t
|
||||||
|
:with-toc t
|
||||||
|
:time-stamp-file nil)))
|
||||||
|
|
||||||
|
;; Configure HTML export
|
||||||
|
(setq org-html-validation-link nil)
|
||||||
|
(setq org-html-head-include-scripts nil)
|
||||||
|
(setq org-html-head-include-default-style nil)
|
||||||
|
(setq org-html-head "<link rel=\"stylesheet\" href=\"https://cdn.simplecss.org/simple.min.css\" />")
|
||||||
|
(setq org-html-section)
|
||||||
|
|
||||||
|
(setq bibtex-completion-notes-path (expand-file-name "notes.org" my/org-dir))
|
||||||
|
|
||||||
|
(setq org-cite-follow-processor 'ivy-bibtex-org-cite-follow)
|
||||||
|
|
||||||
|
(setq bibtex-completion-pdf-open-function
|
||||||
|
(lambda (fpath)
|
||||||
|
(call-process "open" nil 0 nil "-a" "/Applications/Preview.app" fpath)))
|
||||||
|
|
||||||
|
(defun org-export-latex-no-toc (depth)
|
||||||
|
(when depth
|
||||||
|
(format "%% Org-mode is exporting headings to %s levels.\n"
|
||||||
|
depth)))
|
||||||
|
(setq org-export-latex-format-toc-function 'org-export-latex-no-toc)
|
||||||
|
|
||||||
|
(add-to-list 'org-latex-classes
|
||||||
|
'("apa6"
|
||||||
|
"\\documentclass{apa6}"
|
||||||
|
("\\section{%s}" . "\\section*{%s}")
|
||||||
|
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||||
|
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||||
|
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
||||||
|
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
|
||||||
|
|
||||||
|
(setq org-latex-pdf-process
|
||||||
|
'("latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -bibtex -f %f"))
|
||||||
|
|
||||||
|
(add-to-list 'exec-path "/Users/willem/.nix-profile/bin")
|
||||||
'';
|
'';
|
||||||
hook = [ "(org-babel-after-execute . org-redisplay-inline-images)" ];
|
hook = [ "(org-babel-after-execute . org-redisplay-inline-images)" ];
|
||||||
|
|
||||||
|
@ -490,15 +523,6 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
org-ref = {
|
|
||||||
enable = true;
|
|
||||||
config = ''
|
|
||||||
(setq org-ref-insert-cite-function
|
|
||||||
(lambda ()
|
|
||||||
(org-cite-insert nil)))
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
calibredb = {
|
calibredb = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraPackages = [ pkgs.sqlite ];
|
extraPackages = [ pkgs.sqlite ];
|
||||||
|
@ -620,10 +644,10 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
exec-path-from-shell = {
|
exec-path-from-shell = {
|
||||||
enable = true;
|
enable = false;
|
||||||
|
|
||||||
init = ''
|
init = ''
|
||||||
(dolist (var '("SSH_AUTH_SOCK" "LANG" "LC_CTYPE" "LC_MESSAGES" "NIX_SSL_CERT_FILE" "NIX_PROFILES" "JAVA_HOME" "GNUPGHOME"))
|
(dolist (var '("LANG" "LC_CTYPE" "LC_MESSAGES" "NIX_SSL_CERT_FILE" "NIX_PROFILES" "JAVA_HOME" "GNUPGHOME"))
|
||||||
(add-to-list 'exec-path-from-shell-variables var))
|
(add-to-list 'exec-path-from-shell-variables var))
|
||||||
|
|
||||||
(when (memq window-system '(mac ns x))
|
(when (memq window-system '(mac ns x))
|
||||||
|
@ -635,6 +659,54 @@ in {
|
||||||
(add-to-list 'exec-path "/Users/willem/.nix-profile/bin")
|
(add-to-list 'exec-path "/Users/willem/.nix-profile/bin")
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ivy-bibtext = {
|
||||||
|
enable = true;
|
||||||
|
init = ''
|
||||||
|
(autoload 'ivy-bibtex "ivy-bibtex" "" t)
|
||||||
|
|
||||||
|
;; ivy-bibtex requires ivy's `ivy--regex-ignore-order` regex builder, which
|
||||||
|
;; ignores the order of regexp tokens when searching for matching candidates.
|
||||||
|
(setq ivy-re-builders-alist
|
||||||
|
'((ivy-bibtex . ivy--regex-ignore-order)
|
||||||
|
(t . ivy--regex-plus)))
|
||||||
|
|
||||||
|
(setq ivy-bibtex-bibliography '("~/Documents/org/zotero.bib"))
|
||||||
|
(setq reftex-default-bibliography '("~/Documents/org/zotero.bib"))
|
||||||
|
(setq bibtex-completion-pdf-field "file")
|
||||||
|
'';
|
||||||
|
|
||||||
|
hook = [
|
||||||
|
''(Tex . (lambda () (define-key Tex-mode-map "C-ch" 'ivy-bibtex)))''
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
org-ref = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
init = ''
|
||||||
|
(setq org-ref-insert-cite-function
|
||||||
|
(lambda ()
|
||||||
|
(org-cite-insert nil)))
|
||||||
|
(setq org-ref-default-bibliography "~/Documents/org/zotero.bib")
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
pdf-tools = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
init = ''
|
||||||
|
(pdf-tools-install)
|
||||||
|
|
||||||
|
(setq-default pdf-view-display-size 'fit-width)
|
||||||
|
|
||||||
|
(define-key pdf-view-mode-map (kbd "C-s") 'isearch-forward)
|
||||||
|
|
||||||
|
(setq pdf-annot-activate-created-annotations t)
|
||||||
|
'';
|
||||||
|
|
||||||
|
extraPackages = [ pkgs.poppler pkgs.automake ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
iterm2
|
iterm2
|
||||||
zoom-us
|
zoom-us
|
||||||
karabiner-elements
|
karabiner-elements
|
||||||
|
(pkgs.callPackage ./spotify-mac.nix { inherit config lib pkgs; })
|
||||||
] ++ [ discord pkgsCustom.vlc pkgsCustom.qbittorrent ]
|
] ++ [ discord pkgsCustom.vlc pkgsCustom.qbittorrent ]
|
||||||
++ [ docker docker-compose ] ++ [
|
++ [ docker docker-compose ] ++ [
|
||||||
comma
|
comma
|
||||||
|
|
42
spotify-mac.nix
Normal file
42
spotify-mac.nix
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
{ stdenv, lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "spotify-mac-app";
|
||||||
|
|
||||||
|
sourceRoot = ".";
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkgs.undmg pkgs.makeWrapper pkgs.perl pkgs.unzip pkgs.zip ];
|
||||||
|
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url = "https://download.scdn.co/Spotify.dmg";
|
||||||
|
hash = "sha256-9Ts6064YaZdjbRN28qkZcrwTH+63drC/jUfTGLvpBNc=";
|
||||||
|
};
|
||||||
|
|
||||||
|
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
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue