Use 1password as a systemd unit for GUI systems.

This commit is contained in:
James Patrick 2022-03-24 19:39:48 -04:00
parent de52515920
commit 2d190ba3d8
1 changed files with 21 additions and 7 deletions

View File

@ -15,11 +15,25 @@ in with lib; {
};
};
config = mkIf enable {
home-manager.users.james = {
home.packages = with pkgs;
optionals (cfg.gui.enable) [ _1password-gui ]
++ optionals (cfg.cli.enable) [ _1password ];
};
};
config = mkIf enable (mkMerge [
(mkIf cfg.cli.enable {
home-manager.users.james.home.packages = with pkgs; [ _1password ];
})
(mkIf cfg.gui.enable {
home-manager.users.james = {
home.packages = with pkgs; [ _1password-gui ];
};
systemd.user.services._1password = {
enable = true;
description = "1password for linux. (PAM not included)";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${pkgs._1password-gui}/bin/1password --silent";
RestartSec = 5;
Restart = "always";
};
};
})
]);
}