1
1
Fork 0

1password: add background service instead of spawn-at-startup

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2025-01-28 15:29:19 -06:00
parent c35f995fed
commit cdbcb7bca2
Signed by: Myned
GPG key ID: C7224454F7881A34
2 changed files with 23 additions and 1 deletions

View file

@ -53,7 +53,6 @@ in {
home = hm.home.homeDirectory;
in
[
{command = [_1password "--silent"];} # Launch password manager in background
{command = [audio "--init"];} # Enforce audio profile state
{command = [rm "${home}/.cache/walker/clipboard.gob"];} # Clear clipboard history
{command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing

View file

@ -6,11 +6,14 @@
}:
with lib; let
cfg = config.custom.programs._1password;
_1password = getExe config.programs._1password-gui.package;
in {
options.custom.programs._1password = {
enable = mkOption {default = false;};
agent = mkOption {default = true;};
browser = mkOption {default = null;};
service = mkOption {default = true;};
};
config = mkIf cfg.enable {
@ -38,6 +41,26 @@ in {
};
};
systemd.user.services."1password" = mkIf cfg.service {
enable = true;
wantedBy = ["graphical-session.target"];
unitConfig = {
Description = "Launch 1Password in the background";
After =
["graphical-session.target"]
++ optionals config.custom.services.xwayland-satellite.enable ["xwayland-satellite.service"];
};
serviceConfig = {
Type = "simple";
# FIXME: 1password clipboard does not work in wayland
ExecStart = "${_1password} --silent --ozone-platform=x11";
};
};
home-manager.users.${config.custom.username} = {
programs.ssh.extraConfig = mkIf cfg.agent ''
Host *