1password: add background service instead of spawn-at-startup
Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
parent
c35f995fed
commit
cdbcb7bca2
2 changed files with 23 additions and 1 deletions
|
@ -53,7 +53,6 @@ in {
|
||||||
home = hm.home.homeDirectory;
|
home = hm.home.homeDirectory;
|
||||||
in
|
in
|
||||||
[
|
[
|
||||||
{command = [_1password "--silent"];} # Launch password manager in background
|
|
||||||
{command = [audio "--init"];} # Enforce audio profile state
|
{command = [audio "--init"];} # Enforce audio profile state
|
||||||
{command = [rm "${home}/.cache/walker/clipboard.gob"];} # Clear clipboard history
|
{command = [rm "${home}/.cache/walker/clipboard.gob"];} # Clear clipboard history
|
||||||
{command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing
|
{command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing
|
||||||
|
|
|
@ -6,11 +6,14 @@
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.custom.programs._1password;
|
cfg = config.custom.programs._1password;
|
||||||
|
|
||||||
|
_1password = getExe config.programs._1password-gui.package;
|
||||||
in {
|
in {
|
||||||
options.custom.programs._1password = {
|
options.custom.programs._1password = {
|
||||||
enable = mkOption {default = false;};
|
enable = mkOption {default = false;};
|
||||||
agent = mkOption {default = true;};
|
agent = mkOption {default = true;};
|
||||||
browser = mkOption {default = null;};
|
browser = mkOption {default = null;};
|
||||||
|
service = mkOption {default = true;};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
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} = {
|
home-manager.users.${config.custom.username} = {
|
||||||
programs.ssh.extraConfig = mkIf cfg.agent ''
|
programs.ssh.extraConfig = mkIf cfg.agent ''
|
||||||
Host *
|
Host *
|
||||||
|
|
Loading…
Add table
Reference in a new issue