From 3dbd45aa7a4ceacfac968f8a15a364d4fead522c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 26 May 2023 13:52:19 +0200 Subject: ... --- accounts/gkleen@sif/default.nix | 32 +++++++++++++++++++++++++++++++- accounts/gkleen@sif/systemd.nix | 12 ++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index b9a9abe1..3f103b8a 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -45,6 +45,33 @@ let wrappedElementDesktop = wrapElectron { package = pkgs.element-desktop; bin = "element-desktop"; outBin = "element"; }; wrappedRocketChatDesktop = wrapElectron { package = pkgs.rocketchat-desktop; bin = "rocketchat-desktop"; outBin = "rocketchat"; }; wrappedYTMDesktop = wrapElectron { package = pkgs.ytmdesktop; sandbox = false; }; + + wrappedKeepassxc = pkgs.symlinkJoin { + inherit (pkgs.keepassxc) name; + paths = with pkgs; [ + keepassxc + (pkgs.writeTextFile { + name = "org.keepassxc.KeePassXC"; + destination = "/share/dbus-1/services/org.keepassxc.KeePassXC.MainWindow.service"; + text = '' + [D-BUS Service] + Name=org.keepassxc.KeePassXC.MainWindow + Exec=${pkgs.coreutils}/bin/false + SystemdService=keepassxc.service + ''; + }) + (pkgs.writeTextFile { + name = "org.freedesktop.secrets"; + destination = "/share/dbus-1/services/org.freedesktop.secrets.service"; + text = '' + [D-BUS Service] + Name=org.freedesktop.secrets + Exec=${pkgs.coreutils}/bin/false + SystemdService=keepassxc.service + ''; + }) + ]; + }; in { imports = with flake.nixosModules.userProfiles.${userName}; [ mpv yt-dlp (args: import ./xcompose.nix (inputs // args)) @@ -218,6 +245,7 @@ in { }; emacs = { enable = true; + socketActivation.enable = true; client = { enable = true; arguments = mkForce ["-a" "\"\""]; @@ -358,7 +386,7 @@ in { home = { packages = with pkgs; [ fira fira-code powerline-fonts nerdfonts pavucontrol - keepassxc sxiv xclip mumble pulseaudio-ctl pamixer libnotify + wrappedKeepassxc sxiv xclip mumble pulseaudio-ctl pamixer libnotify synergy xorg.xbacklight screen-message wrappedYTMDesktop qt5ct playerctl evince thunderbird wrappedZulip zoom-us steam steam-run wireshark virt-manager rclone @@ -434,6 +462,8 @@ in { | sort | uniq >$out ''); }; + "dbus-1/services/org.keepassxc.KeePassXC.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.keepassxc.KeePassXC.service"; + "dbus-1/services/org.freedesktop.secrets.service.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.freedesktop.secrets.service.service"; }; xdg.mimeApps = { diff --git a/accounts/gkleen@sif/systemd.nix b/accounts/gkleen@sif/systemd.nix index 2fba0404..fe69a757 100644 --- a/accounts/gkleen@sif/systemd.nix +++ b/accounts/gkleen@sif/systemd.nix @@ -143,6 +143,18 @@ in { Restart = "always"; }; }; + keepassxc = { + Service = { + Type = "dbus"; + BusName = "org.keepassxc.KeePassXC.MainWindow"; + WorkingDirectory = "~"; + ExecStart = "${pkgs.keepassxc}/bin/keepassxc"; + }; + Unit = { + Requires = ["graphical-session-pre.target"]; + After = ["graphical-session-pre.target"]; + }; + }; xss-lock = { Service = { Environment = [ "XSECURELOCK_WANT_FIRST_KEYPRESS=1" ]; -- cgit v1.2.3