From 859896c9b29931c92b2ca5b3fd0e44fee83ba89f Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Tue, 11 Oct 2022 20:46:44 +0200 Subject: [PATCH] [WIP] Stuff --- doom.d/config.el | 7 ++++++- doom.d/init.el | 12 ++++++------ hmModules/emacs/default.nix | 18 +++++++++++++++++- hosts/pbp/default.nix | 1 + hosts/thinkpad/default.nix | 1 + modules/printing/default.nix | 12 ++++++++++++ 6 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 modules/printing/default.nix diff --git a/doom.d/config.el b/doom.d/config.el index 65febdc..26d2411 100644 --- a/doom.d/config.el +++ b/doom.d/config.el @@ -80,4 +80,9 @@ (setenv "SSH_AUTH_SOCK" "/run/user/1000/gnupg/S.gpg-agent.ssh") -(set-formatter! 'nix-flake "nix --no-warn-dirty fmt -- --quiet" :modes '(nix-mode)) +(set-formatter! 'nix-flake "nixFormat 2>/dev/null" :modes '(nix-mode)) + +(defun doom-modeline-set-vcs-modeline () nil) ; FIXME + +(setq +format-on-save-enabled-modes + '(not latex-mode)) diff --git a/doom.d/init.el b/doom.d/init.el index fe9a1aa..914160c 100644 --- a/doom.d/init.el +++ b/doom.d/init.el @@ -30,13 +30,13 @@ :ui ;;deft ; notational velocity for Emacs doom ; what makes DOOM look the way it does - doom-dashboard ; a nifty splash screen for Emacs + ;;doom-dashboard ; a nifty splash screen for Emacs ;;doom-quit ; DOOM quit-message prompts when you quit Emacs - ;;(emoji +unicode) ; 🙂 + (emoji +unicode) ; 🙂 hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW ;;hydra ;;indent-guides ; highlighted indent columns - ;;ligatures ; ligatures and symbols to make your code pretty again + ligatures ; ligatures and symbols to make your code pretty again minimap ; show a map of the code on the side modeline ; snazzy, Atom-inspired modeline, plus API ;;nav-flash ; blink cursor line after big motions @@ -59,8 +59,8 @@ (format +onsave) ; automated prettiness ;;god ; run Emacs commands without modifier keys ;;lispy ; vim for lisp, for people who don't like vim - ;;multiple-cursors ; editing in many places at once - ;;objed ; text object editing for the innocent + multiple-cursors ; editing in many places at once + ;; objed ; text object editing for the innocent ;;parinfer ; turn lisp into python, sort of ;;rotate-text ; cycle region at point between text candidates snippets ; my elves. They type so I don't have to @@ -95,7 +95,7 @@ (eval +overlay) ; run code, run (also, repls) ;;gist ; interacting with github gists lookup ; navigate your code and its documentation - ;;lsp ; M-x vscode + lsp ; M-x vscode magit ; a git porcelain for Emacs make ; run make tasks from Emacs pass ; password manager for nerds diff --git a/hmModules/emacs/default.nix b/hmModules/emacs/default.nix index 6dab36d..b86a644 100644 --- a/hmModules/emacs/default.nix +++ b/hmModules/emacs/default.nix @@ -16,7 +16,21 @@ defaultEditor = true; }; - home.packages = with pkgs; [ + home.packages = with pkgs; let + path = pkgs.lib.makeBinPath (with pkgs; [ + nix + nixpkgs-fmt + git + ]); + nixFormat = writeScriptBin "nixFormat" '' + export PATH=${pkgs.lib.escapeShellArg path} + + if [[ ! "$(nix fmt $@)" ]] + then + nixpkgs-fmt $@ + fi + ''; + in [ binutils (ripgrep.override {withPCRE2 = true;}) gnutls @@ -24,6 +38,8 @@ imagemagick sqlite maim + nixFormat + jq xclip ]; } diff --git a/hosts/pbp/default.nix b/hosts/pbp/default.nix index 1ea7339..a49f821 100644 --- a/hosts/pbp/default.nix +++ b/hosts/pbp/default.nix @@ -15,6 +15,7 @@ "mara" "xfce" "battery" + "printing" ]; ccr.enable = true; diff --git a/hosts/thinkpad/default.nix b/hosts/thinkpad/default.nix index cc58556..f450234 100644 --- a/hosts/thinkpad/default.nix +++ b/hosts/thinkpad/default.nix @@ -26,6 +26,7 @@ "fprintd" "binfmt" "udisks2" + "printing" ]; ccr = { diff --git a/modules/printing/default.nix b/modules/printing/default.nix new file mode 100644 index 0000000..2403aba --- /dev/null +++ b/modules/printing/default.nix @@ -0,0 +1,12 @@ +{ + config, + lib, + pkgs, + ... +}: { + services.avahi.enable = true; + # Important to resolve .local domains of printers, otherwise you get an error + # like "Impossible to connect to XXX.local: Name or service not known" + services.avahi.nssmdns = true; + services.printing.enable = true; +}