diff --git a/modules/home/sops.nix b/modules/home/sops.nix index f2e7b70..06c8a5f 100755 --- a/modules/home/sops.nix +++ b/modules/home/sops.nix @@ -1,24 +1,22 @@ { config, lib, pkgs, ... }: -with lib; - let cfg = config.sydnix.sops; in { options = { sydnix.sops = { - enable = mkEnableOption "Sops"; - keyFile = mkOption { + enable = lib.mkEnableOption "Sops"; + keyFile = lib.mkOption { description = "Path to an Age key file."; - type = types.path; + type = lib.types.path; default = config.home.homeDirectory + "/key.txt"; }; - secrets = mkOption { + secrets = lib.mkOption { description = "Secrets passed directly to sops-nix."; }; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { home.packages = [ pkgs.sops ]; diff --git a/modules/home/users.nix b/modules/home/users.nix new file mode 100644 index 0000000..08a2c42 --- /dev/null +++ b/modules/home/users.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: + +let + # TODO: Move to a fucking utility library already! + listNixFilesInDirectory = dir: + builtins.attrNames + (lib.filterAttrs + (k: _v: lib.hasSuffix ".nix" k) + (builtins.readDir dir)); +in { + imports = + (builtins.concatMap + (user: + builtins.map + (module: + ./users/${user}/${module}) + (listNixFilesInDirectory ./users/${user})) + (builtins.attrNames (builtins.readDir ./users))); +} diff --git a/modules/home/users/crumb/age.nix b/modules/home/users/crumb/age.nix new file mode 100644 index 0000000..9b63470 --- /dev/null +++ b/modules/home/users/crumb/age.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +let + mutableSymlink = config.lib.file.mkOutOfStoreSymlink; + cfg = config.sydnix.users.crumb.age; +in +{ + options.sydnix.users.crumb.age.enable = lib.mkEnableOption "Age, à la crumb"; + + config = lib.mkIf cfg.enable { + home.packages = [ + # Rage supports pinentry while Age does not. + pkgs.rage + ]; + + # We use a mutable symlink to avoid placing the key inside the + # world-readable store. + home.file."private-keys/age/${config.home.username}.age".source = + mutableSymlink "/persist/private-keys/age/${config.home.username}.age"; + + home.file."public-keys/age/${config.home.username}.pub".source = + ../../../../public-keys/age/${config.home.username}.pub; + }; +} + diff --git a/modules/home/users/crumb/bash.nix b/modules/home/users/crumb/bash.nix new file mode 100755 index 0000000..c778b2b --- /dev/null +++ b/modules/home/users/crumb/bash.nix @@ -0,0 +1,13 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sydnix.users.crumb.bash; +in { + options.sydnix.users.crumb.bash.enable = lib.mkEnableOption "Bash, à la crumb"; + config = lib.mkIf cfg.enable { + programs.bash = { + enable = true; + }; + }; +} + diff --git a/modules/home/users/crumb/direnv.nix b/modules/home/users/crumb/direnv.nix new file mode 100644 index 0000000..e51c146 --- /dev/null +++ b/modules/home/users/crumb/direnv.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sydnix.users.crumb.direnv; +in { + options.sydnix.users.crumb.direnv.enable = + lib.mkEnableOption "direnv, à la crumb"; + config = lib.mkIf cfg.enable { + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + }; +} + diff --git a/modules/home/users/crumb/emacs.nix b/modules/home/users/crumb/emacs.nix new file mode 100755 index 0000000..9f6dd4a --- /dev/null +++ b/modules/home/users/crumb/emacs.nix @@ -0,0 +1,132 @@ +{ config, lib, pkgs, inputs, ... }@args: + +let cfg = config.sydnix.users.crumb.emacs; +in { + options.sydnix.users.crumb.emacs.enable = + lib.mkEnableOption ''Emacs, à la crumb''; + config = lib.mkIf cfg.enable + (let + emacsBasePackage = pkgs'.emacs-unstable-pgtk; + # Hard-coded path. }:\ + emacsConfigDir = + "/persist/dots/modules/home/users/${config.home.username}/emacs"; + + # Create a new instance of nixpkgs with emacs-overlay applied. This is a + # little unorthodox, but we do it + # 1. for the sake of organisation — For pure aesthetics and a clean + # codebase, I want everything Emacs to stay in this file; + # 2. and, there's simply no need to leak emacs-overlay's packages into the + # global nixpkgs instance when nothing else is using it! + pkgs' = import inputs.nixpkgs { + system = args.system; + overlays = [ inputs.emacs-overlay.overlays.emacs ]; + }; + + emacsDataDir = "${config.xdg.dataHome}/emacs"; + emacsCacheDir = "${emacsDataDir}/cache"; + straightBaseDir = "${emacsDataDir}/straight"; + + fontPackages = [ + pkgs.julia-mono + pkgs.nerd-fonts.victor-mono + pkgs.ibm-plex + ]; + + my-aspell = pkgs.aspellWithDicts + (dicts: with dicts; [ + en en-computers en-science + ]); + + my-emacs = + let ewp = (pkgs.emacsPackagesFor emacsBasePackage).emacsWithPackages + (epkgs: with epkgs; [ + jinx + pdf-tools + treesit-grammars.with-all-grammars + ]); + in pkgs.symlinkJoin { + name = "sydmacs"; + paths = [ ewp ]; + nativeBuildInputs = [ pkgs.makeWrapper ]; + buildInputs = [ + pkgs.git # Dependency of Straight.el. + my-aspell + pkgs.direnv + ]; + postBuild = '' + find "$out/bin" -name emacs -or -name "emacs-*" \ + | while IFS= read -r emacs; do + echo "emacs: $emacs" + wrapProgram "$emacs" \ + --add-flags "--init-directory \"${emacsConfigDir}\"" \ + --set EMACS_STRAIGHT_BASE_DIR "${straightBaseDir}" \ + --set EMACS_CACHE_DIR "${emacsCacheDir}" \ + --set EMACS_DATA_DIR "${emacsDataDir}" \ + --prefix PATH : "${pkgs.git}/bin" \ + --prefix PATH : "${my-aspell}/bin" \ + --prefix PATH : "${pkgs.direnv}/bin" \ + --prefix PATH : "${pkgs.texliveFull}/bin" \ + --set ASPELL_CONF "dict-dir ${my-aspell}/lib/aspell" + done + ''; + meta = emacsBasePackage.meta; + version = emacsBasePackage.version; + }; + + emacsclient-or-emacs = pkgs.writeShellScriptBin "emacsclient-or-emacs" '' + emacsclient --alternate-editor=${config.programs.emacs.finalPackage}/bin/emacs "$@" + ''; + in { + programs.emacs = { + enable = true; + package = my-emacs; + }; + + sydnix.impermanence.cache.directories = + # Impermanence expects the path to be relative to ~. + map (lib.removePrefix config.home.homeDirectory) [ + straightBaseDir + emacsCacheDir + emacsDataDir + ]; + + # Set emacsclient as the default editor for the time being. + home.sessionVariables = + let e = "${emacsclient-or-emacs}/bin/emacsclient-or-emacs"; + in { + "EDITOR" = e; + "VISUAL" = e; + }; + + home.file = + let default = + lib.removePrefix "${config.home.homeDirectory}/" + "${straightBaseDir}/straight/versions/default.el"; + in { + ${default}.source = + config.lib.file.mkOutOfStoreSymlink + "${emacsConfigDir}/straight-lockfile.el"; + }; + + home.packages = [ + emacsclient-or-emacs + ] ++ fontPackages; + + # There's probably a better place to put this, but the current setup demands + # Fontconfig for Emacs to find my fonts. + fonts.fontconfig.enable = true; + + # TODO: Make sure this is using the right package for Emacs... + services.emacs = { + enable = true; + # Generate a desktop entry for emacsclient. + client.enable = true; + }; + + home.shellAliases = { + e = "emacsclient-or-emacs"; + ec = "emacsclient"; + em = "emacs"; + }; + }); +} diff --git a/users/crumb/programs/emacs/early-init.el b/modules/home/users/crumb/emacs/early-init.el similarity index 100% rename from users/crumb/programs/emacs/early-init.el rename to modules/home/users/crumb/emacs/early-init.el diff --git a/users/crumb/programs/emacs/eshell/alias b/modules/home/users/crumb/emacs/eshell/alias similarity index 100% rename from users/crumb/programs/emacs/eshell/alias rename to modules/home/users/crumb/emacs/eshell/alias diff --git a/users/crumb/programs/emacs/init-straight.el b/modules/home/users/crumb/emacs/init-straight.el similarity index 100% rename from users/crumb/programs/emacs/init-straight.el rename to modules/home/users/crumb/emacs/init-straight.el diff --git a/users/crumb/programs/emacs/init.el b/modules/home/users/crumb/emacs/init.el similarity index 100% rename from users/crumb/programs/emacs/init.el rename to modules/home/users/crumb/emacs/init.el diff --git a/users/crumb/programs/emacs/lib/clj-lib.el b/modules/home/users/crumb/emacs/lib/clj-lib.el similarity index 100% rename from users/crumb/programs/emacs/lib/clj-lib.el rename to modules/home/users/crumb/emacs/lib/clj-lib.el diff --git a/users/crumb/programs/emacs/lib/syd-buffers.el b/modules/home/users/crumb/emacs/lib/syd-buffers.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-buffers.el rename to modules/home/users/crumb/emacs/lib/syd-buffers.el diff --git a/users/crumb/programs/emacs/lib/syd-constants.el b/modules/home/users/crumb/emacs/lib/syd-constants.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-constants.el rename to modules/home/users/crumb/emacs/lib/syd-constants.el diff --git a/users/crumb/programs/emacs/lib/syd-file.el b/modules/home/users/crumb/emacs/lib/syd-file.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-file.el rename to modules/home/users/crumb/emacs/lib/syd-file.el diff --git a/users/crumb/programs/emacs/lib/syd-general.el b/modules/home/users/crumb/emacs/lib/syd-general.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-general.el rename to modules/home/users/crumb/emacs/lib/syd-general.el diff --git a/users/crumb/programs/emacs/lib/syd-handle-eval.el b/modules/home/users/crumb/emacs/lib/syd-handle-eval.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-handle-eval.el rename to modules/home/users/crumb/emacs/lib/syd-handle-eval.el diff --git a/users/crumb/programs/emacs/lib/syd-handle-lookup.el b/modules/home/users/crumb/emacs/lib/syd-handle-lookup.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-handle-lookup.el rename to modules/home/users/crumb/emacs/lib/syd-handle-lookup.el diff --git a/users/crumb/programs/emacs/lib/syd-handle-repl.el b/modules/home/users/crumb/emacs/lib/syd-handle-repl.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-handle-repl.el rename to modules/home/users/crumb/emacs/lib/syd-handle-repl.el diff --git a/users/crumb/programs/emacs/lib/syd-kanagawa.el b/modules/home/users/crumb/emacs/lib/syd-kanagawa.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-kanagawa.el rename to modules/home/users/crumb/emacs/lib/syd-kanagawa.el diff --git a/users/crumb/programs/emacs/lib/syd-lisp-lib.el b/modules/home/users/crumb/emacs/lib/syd-lisp-lib.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-lisp-lib.el rename to modules/home/users/crumb/emacs/lib/syd-lisp-lib.el diff --git a/users/crumb/programs/emacs/lib/syd-prelude.el b/modules/home/users/crumb/emacs/lib/syd-prelude.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-prelude.el rename to modules/home/users/crumb/emacs/lib/syd-prelude.el diff --git a/users/crumb/programs/emacs/lib/syd-project.el b/modules/home/users/crumb/emacs/lib/syd-project.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-project.el rename to modules/home/users/crumb/emacs/lib/syd-project.el diff --git a/users/crumb/programs/emacs/lib/syd-prose.el b/modules/home/users/crumb/emacs/lib/syd-prose.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-prose.el rename to modules/home/users/crumb/emacs/lib/syd-prose.el diff --git a/users/crumb/programs/emacs/lib/syd-search.el b/modules/home/users/crumb/emacs/lib/syd-search.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-search.el rename to modules/home/users/crumb/emacs/lib/syd-search.el diff --git a/users/crumb/programs/emacs/lib/syd-strategies-lookup.el b/modules/home/users/crumb/emacs/lib/syd-strategies-lookup.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-strategies-lookup.el rename to modules/home/users/crumb/emacs/lib/syd-strategies-lookup.el diff --git a/users/crumb/programs/emacs/lib/syd-strategies.el b/modules/home/users/crumb/emacs/lib/syd-strategies.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-strategies.el rename to modules/home/users/crumb/emacs/lib/syd-strategies.el diff --git a/users/crumb/programs/emacs/lib/syd-text.el b/modules/home/users/crumb/emacs/lib/syd-text.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-text.el rename to modules/home/users/crumb/emacs/lib/syd-text.el diff --git a/users/crumb/programs/emacs/lib/syd-window.el b/modules/home/users/crumb/emacs/lib/syd-window.el similarity index 100% rename from users/crumb/programs/emacs/lib/syd-window.el rename to modules/home/users/crumb/emacs/lib/syd-window.el diff --git a/users/crumb/programs/emacs/modules/lang/syd-lang-agda.el b/modules/home/users/crumb/emacs/modules/lang/syd-lang-agda.el similarity index 100% rename from users/crumb/programs/emacs/modules/lang/syd-lang-agda.el rename to modules/home/users/crumb/emacs/modules/lang/syd-lang-agda.el diff --git a/users/crumb/programs/emacs/modules/lang/syd-lang-clojure.el b/modules/home/users/crumb/emacs/modules/lang/syd-lang-clojure.el similarity index 100% rename from users/crumb/programs/emacs/modules/lang/syd-lang-clojure.el rename to modules/home/users/crumb/emacs/modules/lang/syd-lang-clojure.el diff --git a/users/crumb/programs/emacs/modules/lang/syd-lang-emacs-lisp.el b/modules/home/users/crumb/emacs/modules/lang/syd-lang-emacs-lisp.el similarity index 100% rename from users/crumb/programs/emacs/modules/lang/syd-lang-emacs-lisp.el rename to modules/home/users/crumb/emacs/modules/lang/syd-lang-emacs-lisp.el diff --git a/users/crumb/programs/emacs/modules/lang/syd-lang-haskell.el b/modules/home/users/crumb/emacs/modules/lang/syd-lang-haskell.el similarity index 100% rename from users/crumb/programs/emacs/modules/lang/syd-lang-haskell.el rename to modules/home/users/crumb/emacs/modules/lang/syd-lang-haskell.el diff --git a/users/crumb/programs/emacs/modules/lang/syd-lang-nix.el b/modules/home/users/crumb/emacs/modules/lang/syd-lang-nix.el similarity index 100% rename from users/crumb/programs/emacs/modules/lang/syd-lang-nix.el rename to modules/home/users/crumb/emacs/modules/lang/syd-lang-nix.el diff --git a/users/crumb/programs/emacs/modules/lang/syd-lang-sql.el b/modules/home/users/crumb/emacs/modules/lang/syd-lang-sql.el similarity index 100% rename from users/crumb/programs/emacs/modules/lang/syd-lang-sql.el rename to modules/home/users/crumb/emacs/modules/lang/syd-lang-sql.el diff --git a/users/crumb/programs/emacs/modules/syd-age.el b/modules/home/users/crumb/emacs/modules/syd-age.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-age.el rename to modules/home/users/crumb/emacs/modules/syd-age.el diff --git a/users/crumb/programs/emacs/modules/syd-autosave.el b/modules/home/users/crumb/emacs/modules/syd-autosave.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-autosave.el rename to modules/home/users/crumb/emacs/modules/syd-autosave.el diff --git a/users/crumb/programs/emacs/modules/syd-completion.el b/modules/home/users/crumb/emacs/modules/syd-completion.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-completion.el rename to modules/home/users/crumb/emacs/modules/syd-completion.el diff --git a/users/crumb/programs/emacs/modules/syd-custom.el b/modules/home/users/crumb/emacs/modules/syd-custom.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-custom.el rename to modules/home/users/crumb/emacs/modules/syd-custom.el diff --git a/users/crumb/programs/emacs/modules/syd-dired.el b/modules/home/users/crumb/emacs/modules/syd-dired.el similarity index 81% rename from users/crumb/programs/emacs/modules/syd-dired.el rename to modules/home/users/crumb/emacs/modules/syd-dired.el index 44de534..a0e7e17 100644 --- a/users/crumb/programs/emacs/modules/syd-dired.el +++ b/modules/home/users/crumb/emacs/modules/syd-dired.el @@ -4,6 +4,22 @@ (interactive) (dired default-directory)) +(defun syd-dired-goto-file (file) + "Like `dired-goto-file', but will act as `find-file' if FILE is inside another +directory." + (interactive + (prog1 (let ((dir (dired-current-directory))) + (list (directory-file-name + (file-relative-name + (read-file-name "Goto file: " dir) + dir)))) + ;; let push-mark display its message + (push-mark)) + dired-mode) + (if (file-name-directory file) + (find-file file) + (dired-goto-file (expand-file-name file)))) + (use-package dired ;; Built-in to Emacs. :straight nil @@ -15,6 +31,8 @@ (:keymaps 'dired-mode-map :states '(normal motion) "g r" #'revert-buffer) + (:keymaps 'dired-mode-map + [remap dired-goto-file] #'syd-dired-goto-file) :commands dired-jump :custom (;; When there are other Dired windows open, suggest them as targets ;; for renaming/copying. diff --git a/users/crumb/programs/emacs/modules/syd-display-startup-time.el b/modules/home/users/crumb/emacs/modules/syd-display-startup-time.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-display-startup-time.el rename to modules/home/users/crumb/emacs/modules/syd-display-startup-time.el diff --git a/users/crumb/programs/emacs/modules/syd-ediff.el b/modules/home/users/crumb/emacs/modules/syd-ediff.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-ediff.el rename to modules/home/users/crumb/emacs/modules/syd-ediff.el diff --git a/users/crumb/programs/emacs/modules/syd-editing.el b/modules/home/users/crumb/emacs/modules/syd-editing.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-editing.el rename to modules/home/users/crumb/emacs/modules/syd-editing.el diff --git a/users/crumb/programs/emacs/modules/syd-eshell.el b/modules/home/users/crumb/emacs/modules/syd-eshell.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-eshell.el rename to modules/home/users/crumb/emacs/modules/syd-eshell.el diff --git a/users/crumb/programs/emacs/modules/syd-evil.el b/modules/home/users/crumb/emacs/modules/syd-evil.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-evil.el rename to modules/home/users/crumb/emacs/modules/syd-evil.el diff --git a/users/crumb/programs/emacs/modules/syd-keybinds.el b/modules/home/users/crumb/emacs/modules/syd-keybinds.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-keybinds.el rename to modules/home/users/crumb/emacs/modules/syd-keybinds.el diff --git a/users/crumb/programs/emacs/modules/syd-lang.el b/modules/home/users/crumb/emacs/modules/syd-lang.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-lang.el rename to modules/home/users/crumb/emacs/modules/syd-lang.el diff --git a/users/crumb/programs/emacs/modules/syd-org.el b/modules/home/users/crumb/emacs/modules/syd-org.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-org.el rename to modules/home/users/crumb/emacs/modules/syd-org.el diff --git a/users/crumb/programs/emacs/modules/syd-pdfs.el b/modules/home/users/crumb/emacs/modules/syd-pdfs.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-pdfs.el rename to modules/home/users/crumb/emacs/modules/syd-pdfs.el diff --git a/users/crumb/programs/emacs/modules/syd-popups.el b/modules/home/users/crumb/emacs/modules/syd-popups.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-popups.el rename to modules/home/users/crumb/emacs/modules/syd-popups.el diff --git a/users/crumb/programs/emacs/modules/syd-projects.el b/modules/home/users/crumb/emacs/modules/syd-projects.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-projects.el rename to modules/home/users/crumb/emacs/modules/syd-projects.el diff --git a/users/crumb/programs/emacs/modules/syd-scratch.el b/modules/home/users/crumb/emacs/modules/syd-scratch.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-scratch.el rename to modules/home/users/crumb/emacs/modules/syd-scratch.el diff --git a/users/crumb/programs/emacs/modules/syd-smartparens.el b/modules/home/users/crumb/emacs/modules/syd-smartparens.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-smartparens.el rename to modules/home/users/crumb/emacs/modules/syd-smartparens.el diff --git a/users/crumb/programs/emacs/modules/syd-tabs.el b/modules/home/users/crumb/emacs/modules/syd-tabs.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-tabs.el rename to modules/home/users/crumb/emacs/modules/syd-tabs.el diff --git a/users/crumb/programs/emacs/modules/syd-tooling.el b/modules/home/users/crumb/emacs/modules/syd-tooling.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-tooling.el rename to modules/home/users/crumb/emacs/modules/syd-tooling.el diff --git a/users/crumb/programs/emacs/modules/syd-tramp.el b/modules/home/users/crumb/emacs/modules/syd-tramp.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-tramp.el rename to modules/home/users/crumb/emacs/modules/syd-tramp.el diff --git a/users/crumb/programs/emacs/modules/syd-ui.el b/modules/home/users/crumb/emacs/modules/syd-ui.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-ui.el rename to modules/home/users/crumb/emacs/modules/syd-ui.el diff --git a/users/crumb/programs/emacs/modules/syd-use-package.el b/modules/home/users/crumb/emacs/modules/syd-use-package.el similarity index 100% rename from users/crumb/programs/emacs/modules/syd-use-package.el rename to modules/home/users/crumb/emacs/modules/syd-use-package.el diff --git a/users/crumb/programs/emacs/project-skeletons/clj-nix/.envrc b/modules/home/users/crumb/emacs/project-skeletons/clj-nix/.envrc similarity index 100% rename from users/crumb/programs/emacs/project-skeletons/clj-nix/.envrc rename to modules/home/users/crumb/emacs/project-skeletons/clj-nix/.envrc diff --git a/users/crumb/programs/emacs/project-skeletons/clj-nix/.gitignore b/modules/home/users/crumb/emacs/project-skeletons/clj-nix/.gitignore similarity index 100% rename from users/crumb/programs/emacs/project-skeletons/clj-nix/.gitignore rename to modules/home/users/crumb/emacs/project-skeletons/clj-nix/.gitignore diff --git a/users/crumb/programs/emacs/project-skeletons/clj-nix/bb.edn b/modules/home/users/crumb/emacs/project-skeletons/clj-nix/bb.edn similarity index 100% rename from users/crumb/programs/emacs/project-skeletons/clj-nix/bb.edn rename to modules/home/users/crumb/emacs/project-skeletons/clj-nix/bb.edn diff --git a/users/crumb/programs/emacs/project-skeletons/clj-nix/deps.edn b/modules/home/users/crumb/emacs/project-skeletons/clj-nix/deps.edn similarity index 100% rename from users/crumb/programs/emacs/project-skeletons/clj-nix/deps.edn rename to modules/home/users/crumb/emacs/project-skeletons/clj-nix/deps.edn diff --git a/users/crumb/programs/emacs/project-skeletons/clj-nix/flake.nix b/modules/home/users/crumb/emacs/project-skeletons/clj-nix/flake.nix similarity index 100% rename from users/crumb/programs/emacs/project-skeletons/clj-nix/flake.nix rename to modules/home/users/crumb/emacs/project-skeletons/clj-nix/flake.nix diff --git a/users/crumb/programs/emacs/project-skeletons/clj-nix/src/__PROJECT-NAME__/main.clj b/modules/home/users/crumb/emacs/project-skeletons/clj-nix/src/__PROJECT-NAME__/main.clj similarity index 100% rename from users/crumb/programs/emacs/project-skeletons/clj-nix/src/__PROJECT-NAME__/main.clj rename to modules/home/users/crumb/emacs/project-skeletons/clj-nix/src/__PROJECT-NAME__/main.clj diff --git a/users/crumb/programs/emacs/project-skeletons/haskell-flake/.envrc b/modules/home/users/crumb/emacs/project-skeletons/haskell-flake/.envrc similarity index 100% rename from users/crumb/programs/emacs/project-skeletons/haskell-flake/.envrc rename to modules/home/users/crumb/emacs/project-skeletons/haskell-flake/.envrc diff --git a/users/crumb/programs/emacs/project-skeletons/haskell-flake/__PROJECT-NAME__.cabal b/modules/home/users/crumb/emacs/project-skeletons/haskell-flake/__PROJECT-NAME__.cabal similarity index 100% rename from users/crumb/programs/emacs/project-skeletons/haskell-flake/__PROJECT-NAME__.cabal rename to modules/home/users/crumb/emacs/project-skeletons/haskell-flake/__PROJECT-NAME__.cabal diff --git a/users/crumb/programs/emacs/project-skeletons/haskell-flake/flake.nix b/modules/home/users/crumb/emacs/project-skeletons/haskell-flake/flake.nix similarity index 100% rename from users/crumb/programs/emacs/project-skeletons/haskell-flake/flake.nix rename to modules/home/users/crumb/emacs/project-skeletons/haskell-flake/flake.nix diff --git a/users/crumb/programs/emacs/straight-lockfile.el b/modules/home/users/crumb/emacs/straight-lockfile.el similarity index 100% rename from users/crumb/programs/emacs/straight-lockfile.el rename to modules/home/users/crumb/emacs/straight-lockfile.el diff --git a/users/crumb/programs/emacs/transient/history.el b/modules/home/users/crumb/emacs/transient/history.el similarity index 100% rename from users/crumb/programs/emacs/transient/history.el rename to modules/home/users/crumb/emacs/transient/history.el diff --git a/modules/home/users/crumb/firefox.nix b/modules/home/users/crumb/firefox.nix new file mode 100644 index 0000000..71232ed --- /dev/null +++ b/modules/home/users/crumb/firefox.nix @@ -0,0 +1,142 @@ +{ config, lib, pkgs, inputs, ... }@args: + +let + cfg = config.sydnix.users.crumb.firefox; +in { + options.sydnix.users.crumb.firefox.enable = + lib.mkEnableOption "Firefox, à la crumb"; + + config = lib.mkIf cfg.enable { + programs.firefox = { + enable = true; + + # Available language codes can be found on the releases page: + # https://releases.mozilla.org/pub/firefox/releases/134.0.2/linux-x86_64/xpi/. + # The string `134.0.2` may be substituted for any other Firefox release + # number. + languagePacks = [ + "en-US" + "en-GB" + ]; + + # Available options can be found at + # https://mozilla.github.io/policy-templates/. + policies = { + DisableTelemetry = true; + DisableFirefoxStudies = false; + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + FirefoxHome = { + Search = true; + TopSites = true; + SponsoredTopSites = false; + Highlights = false; + Pocket = false; + SponsoredPocket = false; + Snippets = false; + Locked = false; + }; + # Weird advertiser shit. + FirefoxSuggest = { + WebSuggestions = false; + SponsoredSuggestions = false; + ImproveSuggest = false; + Locked = false; + }; + # Weird advertiser shit. + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableAccounts = true; + # Firefox has an in-built screenshot tool that I do not need. + DisableFirefoxScreenshots = true; + # Disable pop-up windows that appear after installation and updates. + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + # You think you're so important, don't you, Firefox? + DontCheckDefaultBrowser = true; + # Only tabs not yet visiting a page. Alternatives: `always`, `never`, + # `newtab`. + DisplayBookmarksToolbar = "newtab"; + # Alternatives: `always`, `never`, `default-on`, `default-on`. + DisplayMenuBar = "default-off"; + # Alternative: `unified`, `separate`. + SearchBar = "unified"; + }; + + profiles."msyds" = { + bookmarks = []; + + # Check about:support for extension/add-on ID strings. + extensions = { + # Override non-declared settings. + force = true; + packages = + let pkgs' = import inputs.nixpkgs { + system = args.system; + overlays = [ inputs.nur.overlays.default ]; + }; + in + with pkgs'.nur.repos.rycee.firefox-addons; [ + ublock-origin + darkreader + privacy-badger + vimium + kagi-search + duckduckgo-privacy-essentials + edit-with-emacs + copy-as-org-mode + clearurls + ]; + }; + + search = { + # Override non-declared settings. + force = true; + # Precedence of search engines. + order = [ "Kagi" "DuckDuckGo" ]; + default = "Kagi"; + privateDefault = "DuckDuckGo"; + engines = { + "Nixpkgs" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { name = "type"; value = "packages"; } + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + icon = + "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "!np" ]; + }; + }; + }; + + # See `about:config` in Firefox for available settings. + settings = { + # Disable suggestions. + "browser.search.suggest.enabled" = false; + # Enable dark theme for non-website UI; the URL bar and such. + "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; + "browser.theme.content-theme" = 0; + "browser.theme.toolbar-theme" = 0; + "browser.in-content.dark-mode" = true; + "ui.systemUsesDarkTheme" = 1; + # Disable sponsored suggestions. + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.newtabpage.activity-stream.system.showSponsored" = false; + "browser.newtabpage.activity-stream.showSponsored" = false; + "browser.urlbar.sponsoredTopSites" = false; + "services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsored" + = false; + "services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSites" + = false; + }; + }; + }; + }; +} diff --git a/modules/home/users/crumb/git.nix b/modules/home/users/crumb/git.nix new file mode 100644 index 0000000..87b96ac --- /dev/null +++ b/modules/home/users/crumb/git.nix @@ -0,0 +1,83 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sydnix.users.crumb.git; + + options.sydnix.users.crumb.git.enable = + lib.mkEnableOption "Git, à la crumb"; + + # TODO: Move somewhere else. + my-email = "lomiskiam@gmail.com"; + my-name = "Madeleine Sydney"; +in { + options.sydnix.users.crumb.git.enable = + lib.mkEnableOption "Git, à la crumb"; + + config = lib.mkIf cfg.enable ( + lib.mkMerge [ + { + ### Git + programs.git = { + enable = true; + userEmail = my-email; + userName = my-name; + }; + + home.shellAliases = { + ga = "git add"; + gb = "git branch"; + gc = "git commit"; + gcl = "git clone"; + gco = "git checkout"; + gd = "git diff"; + gl = "git log"; + glo = "git log --pretty=oneline"; + glol = "git log --graph --oneline --decorate"; + gp = "git push"; + gr = "git remote"; + grs = "git remote show"; + gs = "git status"; + gtd = "git tag --delete"; + }; + } + { + ### Jujutsu + programs.jujutsu = { + enable = true; + settings.user = { + email = my-email; + name = my-name; + }; + }; + + home.shellAliases = { + jb = "jj bookmark"; + jdi = "jj diff"; + jd = "jj describe"; + je = "jj edit"; + jgcl = "jj git clone"; + jgp = "jj git push"; + jgr = "jj git remote"; + jl = "jj log"; + jn = "jj new"; + js = "jj status"; + jsp = "jj split"; + }; + } + { + ### Github CLI + programs.gh = { + enable = true; + settings = { + git_protocol = "ssh"; + }; + }; + + sydnix.sops.secrets.github-oauth = {}; + } + { + ### Gitlab CLI + programs.glab.enable = true; + } + ]); +} diff --git a/modules/home/users/crumb/haskell.nix b/modules/home/users/crumb/haskell.nix new file mode 100644 index 0000000..1c888f6 --- /dev/null +++ b/modules/home/users/crumb/haskell.nix @@ -0,0 +1,57 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sydnix.users.crumb.haskell; +in { + options.sydnix.users.crumb.haskell.enable = + lib.mkEnableOption "Haskell, à la crumb"; + + config = lib.mkIf cfg.enable { + # Convenient shorthand for quickly opening Haskell REPLs. + programs.bash.profileExtra = '' + # Start a GHCi REPL with the given packages made available. + ghci-with-packages () { + nix-shell -p "haskellPackages.ghcWithPackages (p: with p; [ $@ ])" \ + --run ghci + } + + # Run GHC with the given packages made available. + ghc-with-packages () { + getopt -o "p" -- "$@" + while true; do + case "$1" in + -p) + packages="$1" + shift 2 + ;; + --) + shift + break + ;; + esac + done + + if [ $? -ne 0 ]; then + echo "Invalid options provided" + exit 1 + fi + + eval set -- "$options" + + nix-shell -p "haskellPackages.ghcWithPackages (p: with p; [ $packages ])" \ + --run "ghc $@" + } + ''; + + sydnix.impermanence.cache.directories = + let xdg-cache-dir = + config.home.cacheHome + or "${config.home.homeDirectory}/.cache"; + in [ + # We don't want to rebuild Hackage simply due to a reboot, do we? }:) + (lib.removePrefix "${config.home.homeDirectory}/" + "${xdg-cache-dir}/cabal") + ]; + }; +} + diff --git a/modules/home/users/crumb/mpd.nix b/modules/home/users/crumb/mpd.nix new file mode 100644 index 0000000..923cbfd --- /dev/null +++ b/modules/home/users/crumb/mpd.nix @@ -0,0 +1,36 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sydnix.users.crumb.mpd; +in { + options.sydnix.users.crumb.mpd.enable = + lib.mkEnableOption "MPD, à la crumb"; + + config = lib.mkIf cfg.enable { + sydnix.sops.secrets = { + lastfm-password = {}; + librefm-password = {}; + }; + + sydnix.mpd = { + enable = true; + scrobbling.endpoints = { + "last.fm" = { + passwordFile = + "/home/crumb/.config/sops-nix/secrets/lastfm-password"; + username = "crumb1"; + }; + "libre.fm" = { + passwordFile = + "/home/crumb/.config/sops-nix/secrets/librefm-password"; + username = "crumbtoo"; + }; + }; + }; + + # mpdscribble uses our password files, so it is imperative that the service + # runs only after said password files are brought into existence. }:) + systemd.user.services.mpdscribble.Unit.After = [ "sops-nix.service" ]; + }; +} + diff --git a/modules/home/users/crumb/nvim.nix b/modules/home/users/crumb/nvim.nix new file mode 100644 index 0000000..683b302 --- /dev/null +++ b/modules/home/users/crumb/nvim.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sydnix.users.crumb.nvim; +in { + options.sydnix.users.crumb.nvim.enable = + lib.mkEnableOption "Neovim, à la crumb"; + config = lib.mkIf cfg.enable ( + let + my-vimrc = + pkgs.writeTextFile { + name = "vimrc"; + text = '' + imap jk + xmap JK + set number + set relativenumber + ''; + }; + + my-neovim = + pkgs.symlinkJoin { + name = "neovim"; + paths = [ pkgs.neovim ]; + buildInputs = [ pkgs.makeWrapper ]; + postBuild = '' + wrapProgram $out/bin/nvim \ + --add-flags "-u ${my-vimrc}" + # Symlink {v,vi,vim} to nvim. + for i in {v,vi,vim}; do + ln -s $out/bin/nvim $out/bin/$i + done + ''; + }; + in { + home.packages = [ my-neovim ]; + }); +} + diff --git a/users/crumb/default.nix b/users/crumb/default.nix index 0b87c5c..f52452a 100755 --- a/users/crumb/default.nix +++ b/users/crumb/default.nix @@ -14,7 +14,7 @@ homeConfiguration = { config, lib, pkgs, ... }: { imports = [ - ./programs.nix + # ./programs.nix ./files.nix ]; @@ -31,6 +31,18 @@ enable = true; keyFile = "/persist/private-keys/age/${config.home.username}"; }; + # Personal configurations. + users.crumb = { + age.enable = true; + bash.enable = true; + direnv.enable = true; + firefox.enable = true; + git.enable = true; + haskell.enable = true; + mpd.enable = true; + nvim.enable = true; + emacs.enable = true; + }; }; # Don't touch! diff --git a/users/crumb/programs.nix b/users/crumb/programs.nix deleted file mode 100755 index 86c7ad7..0000000 --- a/users/crumb/programs.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, lib, pkgs, utils, ... }: - -{ - imports = - map (x: ./programs/${x}) - (utils.listNixFilesInDirectory ./programs); -} diff --git a/users/crumb/programs/age.nix b/users/crumb/programs/age.nix deleted file mode 100755 index cfe034b..0000000 --- a/users/crumb/programs/age.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, lib, pkgs, ... }: - -let mutableSymlink = config.lib.file.mkOutOfStoreSymlink; -in { - home.packages = [ - # Rage supports pinentry while Age does not. - pkgs.rage - ]; - - # Private keys must be mutable symlinks since we don't want the key inside the - # world-readable store. - home.file."private-keys/age/crumb.age".source = - mutableSymlink "/persist/private-keys/age/${config.home.username}.age"; - - home.file."public-keys/age/crumb.pub".source = - ../../../public-keys/age/${config.home.username}.pub; -} - diff --git a/users/crumb/programs/bash.nix b/users/crumb/programs/bash.nix deleted file mode 100755 index 4547908..0000000 --- a/users/crumb/programs/bash.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - programs.bash = { - enable = true; - }; -} diff --git a/users/crumb/programs/direnv.nix b/users/crumb/programs/direnv.nix deleted file mode 100644 index 235c0f4..0000000 --- a/users/crumb/programs/direnv.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - # High-speed Nix support. Note that Lorri has a years-old open issue - # preventing it from starting on boot/login correctly. - # - # Currently unused in favour of nix-direnv. - - # services.lorri.enable = true; - - programs.direnv = { - enable = true; - nix-direnv.enable = true; - }; -} diff --git a/users/crumb/programs/emacs.nix b/users/crumb/programs/emacs.nix deleted file mode 100755 index 19be092..0000000 --- a/users/crumb/programs/emacs.nix +++ /dev/null @@ -1,125 +0,0 @@ -{ config, lib, pkgs, inputs, ... }@args: - -let - emacsBasePackage = pkgs'.emacs-unstable-pgtk; - emacsConfigDir = "/persist/dots/users/crumb/programs/emacs"; - - # emacs-overlay = - # import (builtins.fetchTarball { - # url = - # "https://github.com/nix-community/emacs-overlay/archive/master.tar.gz"; - # sha256 = "sha256:02aln37ch9isz8h7dlm9v6jkl60g923z0dij0rjsxq7xi61fas2j"; - # }); - - # Create a new instance of nixpkgs with emacs-overlay applied. This is a - # little unorthodox, but we do it - # 1. for the sake of organisation — For pure aesthetics and a clean - # codebase, I want everything Emacs to stay in this file; - # 2. and, there's simply no need to leak emacs-overlay's packages into the - # global nixpkgs instance when nothing else is using it! - pkgs' = import inputs.nixpkgs { - system = args.system; - overlays = [ inputs.emacs-overlay.overlays.emacs ]; - }; - - emacsDataDir = "${config.xdg.dataHome}/emacs"; - emacsCacheDir = "${emacsDataDir}/cache"; - straightBaseDir = "${emacsDataDir}/straight"; - - fontPackages = [ - pkgs.julia-mono - pkgs.nerd-fonts.victor-mono - pkgs.ibm-plex - ]; - - my-aspell = pkgs.aspellWithDicts - (dicts: with dicts; [ - en en-computers en-science - ]); - - my-emacs = - let ewp = (pkgs.emacsPackagesFor emacsBasePackage).emacsWithPackages - (epkgs: with epkgs; [ - jinx - pdf-tools - treesit-grammars.with-all-grammars - ]); - in pkgs.symlinkJoin { - name = "sydmacs"; - paths = [ ewp ]; - nativeBuildInputs = [ pkgs.makeWrapper ]; - buildInputs = [ - pkgs.git # Dependency of Straight.el. - my-aspell - pkgs.direnv - ]; - postBuild = '' - find "$out/bin" -name emacs -or -name "emacs-*" \ - | while IFS= read -r emacs; do - echo "emacs: $emacs" - wrapProgram "$emacs" \ - --add-flags "--init-directory \"${emacsConfigDir}\"" \ - --set EMACS_STRAIGHT_BASE_DIR "${straightBaseDir}" \ - --set EMACS_CACHE_DIR "${emacsCacheDir}" \ - --set EMACS_DATA_DIR "${emacsDataDir}" \ - --prefix PATH : "${pkgs.git}/bin" \ - --prefix PATH : "${my-aspell}/bin" \ - --prefix PATH : "${pkgs.direnv}/bin" \ - --prefix PATH : "${pkgs.texliveFull}/bin" \ - --set ASPELL_CONF "dict-dir ${my-aspell}/lib/aspell" - done - ''; - meta = emacsBasePackage.meta; - version = emacsBasePackage.version; - }; - - emacsclient-or-emacs = pkgs.writeShellScriptBin "emacsclient-or-emacs" '' - emacsclient --alternate-editor=${config.programs.emacs.finalPackage}/bin/emacs "$@" - ''; -in { - programs.emacs = { - enable = true; - package = my-emacs; - }; - - sydnix.impermanence.cache.directories = - # Impermanence expects the path to be relative to ~. - map (lib.removePrefix config.home.homeDirectory) [ - straightBaseDir - emacsCacheDir - emacsDataDir - ]; - - # Set emacsclient as the default editor for the time being. - home.sessionVariables = - let e = "${emacsclient-or-emacs}/bin/emacsclient-or-emacs"; - in { - "EDITOR" = e; - "VISUAL" = e; - }; - - home.file = - let default = - lib.removePrefix "${config.home.homeDirectory}/" - "${straightBaseDir}/straight/versions/default.el"; - in { - ${default}.source = - config.lib.file.mkOutOfStoreSymlink - "/persist/dots/users/crumb/programs/emacs/straight-lockfile.el"; - }; - - home.packages = [ - emacsclient-or-emacs - ] ++ fontPackages; - - # There's probably a better place to put this, but the current setup demands - # Fontconfig for Emacs to find my fonts. - fonts.fontconfig.enable = true; - - # TODO: Make sure this is using the right package for Emacs... - services.emacs = { - enable = true; - # Generate a desktop entry for emacsclient. - client.enable = true; - }; -} diff --git a/users/crumb/programs/firefox.nix b/users/crumb/programs/firefox.nix deleted file mode 100644 index 424b4ea..0000000 --- a/users/crumb/programs/firefox.nix +++ /dev/null @@ -1,134 +0,0 @@ -{ config, lib, pkgs, inputs, ... }@args: - -let - pkgs' = import inputs.nixpkgs { - system = args.system; - overlays = [ inputs.nur.overlays.default ]; - }; -in { - programs.firefox = { - enable = true; - - # Available language codes can be found on the releases page: - # https://releases.mozilla.org/pub/firefox/releases/134.0.2/linux-x86_64/xpi/. - # The string `134.0.2` may be substituted for any other Firefox release - # number. - languagePacks = [ - "en-US" - "en-GB" - ]; - - # Available options can be found at https://mozilla.github.io/policy-templates/. - policies = { - DisableTelemetry = true; - DisableFirefoxStudies = false; - EnableTrackingProtection = { - Value = true; - Locked = true; - Cryptomining = true; - Fingerprinting = true; - }; - FirefoxHome = { - Search = true; - TopSites = true; - SponsoredTopSites = false; - Highlights = false; - Pocket = false; - SponsoredPocket = false; - Snippets = false; - Locked = false; - }; - # Weird advertiser shit. - FirefoxSuggest = { - WebSuggestions = false; - SponsoredSuggestions = false; - ImproveSuggest = false; - Locked = false; - }; - # Weird advertiser shit. - DisablePocket = true; - DisableFirefoxAccounts = true; - DisableAccounts = true; - # Firefox has an in-built screenshot tool that I do not need. - DisableFirefoxScreenshots = true; - # Disable pop-up windows that appear after installation and updates. - OverrideFirstRunPage = ""; - OverridePostUpdatePage = ""; - # You think you're so important, don't you, Firefox? - DontCheckDefaultBrowser = true; - # Only tabs not yet visiting a page. Alternatives: `always`, `never`, - # `newtab`. - DisplayBookmarksToolbar = "newtab"; - # Alternatives: `always`, `never`, `default-on`, `default-on`. - DisplayMenuBar = "default-off"; - # Alternative: `unified`, `separate`. - SearchBar = "unified"; - }; - - profiles."msyds" = { - bookmarks = []; - - # Check about:support for extension/add-on ID strings. - extensions = { - # Override non-declared settings. - force = true; - packages = with pkgs'.nur.repos.rycee.firefox-addons; [ - ublock-origin - darkreader - privacy-badger - vimium - kagi-search - duckduckgo-privacy-essentials - edit-with-emacs - copy-as-org-mode - clearurls - ]; - }; - - search = { - # Override non-declared settings. - force = true; - # Precedence of search engines. - order = [ "Kagi" "DuckDuckGo" ]; - default = "Kagi"; - privateDefault = "DuckDuckGo"; - engines = { - "Nixpkgs" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; - icon = - "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "!np" ]; - }; - }; - }; - - # See `about:config` in Firefox for available settings. - settings = { - # Disable suggestions. - "browser.search.suggest.enabled" = false; - # Enable dark theme for non-website UI; the URL bar and such. - "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; - "browser.theme.content-theme" = 0; - "browser.theme.toolbar-theme" = 0; - "browser.in-content.dark-mode" = true; - "ui.systemUsesDarkTheme" = 1; - # Disable sponsored suggestions. - "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; - "browser.newtabpage.activity-stream.system.showSponsored" = false; - "browser.newtabpage.activity-stream.showSponsored" = false; - "browser.urlbar.sponsoredTopSites" = false; - "services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsored" - = false; - "services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSites" - = false; - }; - }; - }; -} - diff --git a/users/crumb/programs/git.nix b/users/crumb/programs/git.nix deleted file mode 100755 index c24a1c7..0000000 --- a/users/crumb/programs/git.nix +++ /dev/null @@ -1,75 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - # TODO: Move somewhere else. - my-email = "lomiskiam@gmail.com"; - my-name = "Madeleine Sydney"; -in lib.mkMerge [ - { - ### Git - programs.git = { - enable = true; - userEmail = my-email; - userName = my-name; - }; - - home.shellAliases = { - ga = "git add"; - gb = "git branch"; - gc = "git commit"; - gcl = "git clone"; - gco = "git checkout"; - gd = "git diff"; - gl = "git log"; - glo = "git log --pretty=oneline"; - glol = "git log --graph --oneline --decorate"; - gp = "git push"; - gr = "git remote"; - grs = "git remote show"; - gs = "git status"; - gtd = "git tag --delete"; - }; - } - - { - ### Jujutsu - programs.jujutsu = { - enable = true; - settings.user = { - email = my-email; - name = my-name; - }; - }; - - home.shellAliases = { - jb = "jj bookmark"; - jdi = "jj diff"; - jd = "jj describe"; - je = "jj edit"; - jgcl = "jj git clone"; - jgp = "jj git push"; - jgr = "jj git remote"; - jl = "jj log"; - jn = "jj new"; - js = "jj status"; - jsp = "jj split"; - }; - } - - { - ### Github CLI - programs.gh = { - enable = true; - settings = { - git_protocol = "ssh"; - }; - }; - - sydnix.sops.secrets.github-oauth = {}; - } - - { - ### Gitlab CLI - programs.glab.enable = true; - } -] diff --git a/users/crumb/programs/haskell.nix b/users/crumb/programs/haskell.nix deleted file mode 100644 index f0b12bb..0000000 --- a/users/crumb/programs/haskell.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - # Convenient shorthand for quickly opening Haskell REPLs. - programs.bash.profileExtra = '' - # Start a GHCi REPL with the given packages made available. - ghci-with-packages () { - nix-shell -p "haskellPackages.ghcWithPackages (p: with p; [ $@ ])" \ - --run ghci - } - - # Run GHC with the given packages made available. - ghc-with-packages () { - getopt -o "p" -- "$@" - while true; do - case "$1" in - -p) - packages="$1" - shift 2 - ;; - --) - shift - break - ;; - esac - done - - if [ $? -ne 0 ]; then - echo "Invalid options provided" - exit 1 - fi - - eval set -- "$options" - - nix-shell -p "haskellPackages.ghcWithPackages (p: with p; [ $packages ])" \ - --run "ghc $@" - } - ''; - - sydnix.impermanence.cache.directories = - let xdg-cache-dir = - config.home.cacheHome - or "${config.home.homeDirectory}/.cache"; - in [ - # We don't want to rebuild Hackage simply due to a reboot, do we? }:) - (lib.removePrefix "${config.home.homeDirectory}/" - "${xdg-cache-dir}/cabal") - ]; - - # # Some global Cabal configuration. - # xdg.configFile."cabal/config".text = '' - # repository hackage.haskell.org - # url: http://hackage.haskell.org/ - - # nix: True - # remote-repo-cache: /home/crumb/.cache/cabal/packages - # build-summary: /home/crumb/.cache/cabal/logs/build.log - # jobs: $ncpus - # remote-build-reporting: none - # ''; -} diff --git a/users/crumb/programs/mpd.nix b/users/crumb/programs/mpd.nix deleted file mode 100755 index 6e1c031..0000000 --- a/users/crumb/programs/mpd.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - sydnix.sops.secrets = { - lastfm-password = {}; - librefm-password = {}; - }; - - sydnix.mpd = { - enable = true; - scrobbling.endpoints = { - "last.fm" = { - passwordFile = - "/home/crumb/.config/sops-nix/secrets/lastfm-password"; - username = "crumb1"; - }; - "libre.fm" = { - passwordFile = - "/home/crumb/.config/sops-nix/secrets/librefm-password"; - username = "crumbtoo"; - }; - }; - }; - - # mpdscribble uses our password files, so it is imperative that the service - # runs only after said password files are brought into existence. }:) - systemd.user.services.mpdscribble.Unit.After = [ "sops-nix.service" ]; -} diff --git a/users/crumb/programs/nvim.nix b/users/crumb/programs/nvim.nix deleted file mode 100755 index e131388..0000000 --- a/users/crumb/programs/nvim.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - my-vimrc = - pkgs.writeTextFile { - name = "vimrc"; - text = '' - imap jk - xmap JK - set number - set relativenumber - ''; - }; - - my-neovim = - pkgs.symlinkJoin { - name = "neovim"; - paths = [ pkgs.neovim ]; - buildInputs = [ pkgs.makeWrapper ]; - postBuild = '' - wrapProgram $out/bin/nvim \ - --add-flags "-u ${my-vimrc}" - # Symlink {v,vi,vim} to nvim. - for i in {v,vi,vim}; do - ln -s $out/bin/nvim $out/bin/$i - done - ''; - }; -in { - home.packages = [ my-neovim ]; -} diff --git a/users/crumb/programs/passage.nix b/users/crumb/programs/passage.nix deleted file mode 100755 index 5eb8f9c..0000000 --- a/users/crumb/programs/passage.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ config, lib, pkgs, ... }: - -let mutableSymlink = config.lib.file.mkOutOfStoreSymlink; -in { - home.packages = [ pkgs.passage ]; - - home.file.".passage/identities".source = - mutableSymlink config.sydnix.sops.keyFile; - - sydnix.impermanence.directories = [ - ".passage/store" - ]; - - home.shellAliases."pass" = "${pkgs.passage}/bin/passage"; - - # TODO: - # systemd.user.services.sync-password-store = { - # Unit = { - # Description = "Pull and push user password store."; - # }; - # Service = { - # Environment = "PATH=/run/current-system/sw/bin"; - # ExecStart = - # let script = '' - # set -xe -o pipefail - # ''; - # in pkgs.writeShellScript "sync-password-store" script; - # }; - # Install = { - # WantedBy = ["default.target"]; - # }; - # }; -}