about summary refs log tree commit diff
path: root/users/tazjin/home/shared.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin/home/shared.nix')
-rw-r--r--users/tazjin/home/shared.nix71
1 files changed, 38 insertions, 33 deletions
diff --git a/users/tazjin/home/shared.nix b/users/tazjin/home/shared.nix
index 070639c05c..38d8add4ac 100644
--- a/users/tazjin/home/shared.nix
+++ b/users/tazjin/home/shared.nix
@@ -3,39 +3,15 @@
 { depot, pkgs, ... }: # readTree
 { config, lib, ... }: # home-manager
 
-{
-  imports = [ "${depot.third_party.impermanence}/home-manager.nix" ];
-
-  home.persistence."/persist/tazjin/home" = {
-    allowOther = true;
-
-    directories = [
-      ".cargo"
-      ".config/audacity"
-      ".config/google-chrome"
-      ".config/quassel-irc.org"
-      ".config/unity3d"
-      ".gnupg"
-      ".local/share/audacity"
-      ".local/share/direnv"
-      ".local/share/fish"
-      ".local/share/keyrings"
-      ".local/share/zoxide"
-      ".mozilla/firefox"
-      ".password-store"
-      ".rustup"
-      ".ssh"
-      ".steam"
-      ".telega"
-      "go"
-      "mail"
-    ];
-
-    files = [
-      ".notmuch-config"
-    ];
-  };
 
+let
+  # URL handler to open `tg://` URLs in telega.el
+  telega-launcher = pkgs.writeShellScriptBin "telega-launcher" ''
+    echo "Opening ''${1} in telega.el ..."
+    ${depot.users.tazjin.emacs.emacs}/bin/emacsclient -e "(telega-browse-url \"''${1}\")"
+  '';
+in
+{
   home.activation.screenshots = lib.hm.dag.entryAnywhere ''
     $DRY_RUN_CMD mkdir -p $HOME/screenshots
   '';
@@ -54,23 +30,49 @@
   programs.fish = {
     enable = true;
     interactiveShellInit = ''
+      # emacs vterm integration
+      source (find '${pkgs.emacsPackages.vterm}' -name 'emacs-vterm.fish')
+
+      # z
       ${pkgs.zoxide}/bin/zoxide init fish | source
     '';
   };
 
   services.screen-locker = {
     enable = true;
-    enableDetectSleep = true;
     inactiveInterval = 10; # minutes
     lockCmd = "${depot.users.tazjin.screenLock}/bin/tazjin-screen-lock";
   };
 
+  home.packages = [ telega-launcher ];
+
+  xdg.desktopEntries.telega-launcher = {
+    name = "Telega Launcher";
+    exec = "${telega-launcher}/bin/telega-launcher";
+    terminal = false;
+    mimeType = [ "x-scheme-handler/tg" ];
+  };
+
+  xdg.mimeApps = {
+    enable = true;
+    defaultApplications = {
+      "x-scheme-handler/tg" = [ "telega-launcher.desktop" ];
+      "text/html" = [ "firefox.desktop" ];
+      "x-scheme-handler/http" = [ "firefox.desktop" ];
+      "x-scheme-handler/https" = [ "firefox.desktop" ];
+      "x-scheme-handler/about" = [ "firefox.desktop" ];
+      "x-scheme-handler/unknown" = [ "firefox.desktop" ];
+    };
+  };
+
   services.picom = {
     enable = true;
     vSync = true;
     backend = "glx";
   };
 
+  services.syncthing.enable = true;
+
   # Enable the dunst notification daemon, but force the
   # configuration file separately instead of going via the strange
   # Nix->dunstrc encoding route.
@@ -83,4 +85,7 @@
   };
 
   systemd.user.startServices = true;
+
+  # Previous default version, see https://github.com/nix-community/home-manager/blob/master/docs/release-notes/rl-2211.adoc
+  home.stateVersion = "18.09";
 }