From b65a49785b080ce382c70b211fb575e36ef83cb9 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 1 Mar 2022 16:33:44 +0100 Subject: gkleen@sif: ... --- accounts/gkleen@sif/default.nix | 35 +++++++++++++++++------------------ accounts/gkleen@sif/emacs.el | 5 ++--- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index a4d9dab6..11bd221c 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -1,15 +1,7 @@ -{ flake, userName, pkgs, customUtils, lib, config, ... }@inputs: +{ flake, flakeInputs, userName, pkgs, customUtils, lib, config, ... }@inputs: let cfg = config.home-manager.users.${userName}; xmonad = import ./xmonad pkgs.haskellPackages; - emacsclientDesktopItem = pkgs.makeDesktopItem { - name = "emacsclient"; - genericName = "Text Editor"; - desktopName = "emacsclient"; - icon = "emacs"; - mimeTypes = ["text/english" "text/plain" "text/x-makefile" "text/x-c++hdr" "text/x-c++src" "text/x-chdr" "text/x-csrc" "text/x-java" "text/x-moc" "text/x-pascal" "text/x-tcl" "text/x-tex" "application/x-shellscript" "text/x-c" "text/x-c++"]; - exec = "${config.home-manager.users.${userName}.programs.emacs.package}/bin/emacsclient -a \"\" %F"; - }; emacsScratch = pkgs.stdenv.mkDerivation rec { pname = "scratch"; version = "0077334cc299aa7885f804d88f52cdb1b35caf71"; @@ -142,13 +134,17 @@ in { }; zsh.initExtra = "source ${./zshrc}"; - zsh.dirHashes = { + zsh.dirHashes = let + flakeHashes = lib.mapAttrs' (n: v: lib.nameValuePair (inputNames.${n} or n) (toString v)) flakeInputs; + inputNames = { + "nixpkgs" = "nixos"; + }; + in flakeHashes // { u2w = "$HOME/projects/uni2work"; docs = "$HOME/documents"; dl = "$HOME/Downloads"; flk = "$HOME/config/nixos-flakes"; - fsk-timi = "$HOME/projects/21s/fsk-timi"; - fsk-timi-exam = "$HOME/projects/21s/fsk-timi-exam"; + rz = "$HOME/projects/rz"; }; obs-studio = { @@ -173,7 +169,13 @@ in { iconTheme = cfg.gtk.iconTheme; enable = true; }; - emacs.enable = true; + emacs = { + enable = true; + client = { + enable = true; + arguments = lib.mkForce ["-a" "\"\""]; + }; + }; gpg-agent = { enable = true; enableSshSupport = true; @@ -286,7 +288,7 @@ in { google-play-music-desktop-player qt5ct playerctl evince thunderbird wrappedZulip zoom-us steam steam-run wireshark virt-manager rclone cached-nix-shell xournal xmonad worktime - fira-code-symbols emacsclientDesktopItem libreoffice xournalpp + fira-code-symbols libreoffice xournalpp wrappedChrome nixos-shell virt-viewer freerdp gnome-icon-theme paper-icon-theme sshpassSecret weechat helvum wrappedElementDesktop matrix-synapse-tools.synadm @@ -294,10 +296,7 @@ in { ]; file = { - ".emacs" = { - source = ./emacs.el; - onChange = "${pkgs.systemd}/bin/systemctl --user try-restart emacs.service"; - }; + ".emacs".source = ./emacs.el; ".backup-munin".source = ./backup-patterns; ".mozilla/firefox/default/chrome/userChrome.css".source = ./firefox-chrome.css; ".mozilla/firefox/default/chrome/userContent.css".source = ./firefox-content.css; diff --git a/accounts/gkleen@sif/emacs.el b/accounts/gkleen@sif/emacs.el index ad04c9ea..fbbd1ec9 100644 --- a/accounts/gkleen@sif/emacs.el +++ b/accounts/gkleen@sif/emacs.el @@ -84,9 +84,8 @@ (dir (cadr tilde:dir))) (push (cons tilde dir) expand-file-name-custom-tilde-alist))) (mapc #'my/add-to-tilde-alist - (split-string (with-output-to-string - (call-process "zsh" nil standard-output nil "-ic" "hash -d")) - "\n" t)) + (split-string (let ((process-environment (cl-copy-list process-environment))) (setenv "TERM" nil) (with-output-to-string (call-process "script" nil standard-output nil "-qec" "zsh -ic \"hash -d\"" "/dev/null"))) + "\r\n" t)) (defadvice expand-file-name (before expand-file-name-custom-tilde (name &optional default-directory) -- cgit v1.2.3