-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
nixos/gnome-keyring: add SSH support by exporting SSH_AUTH_SOCK #310978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
47f2e3d
d65b98e
5288c6c
f6cc2fa
d7b6c9b
4e26750
f27533c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,9 @@ | ||||||||||||
| # GNOME Keyring daemon. | ||||||||||||
|
|
||||||||||||
| { config, pkgs, lib, ... }: | ||||||||||||
|
|
||||||||||||
| let | ||||||||||||
| cfg = config.services.gnome.gnome-keyring; | ||||||||||||
| in | ||||||||||||
| { | ||||||||||||
|
|
||||||||||||
| meta = { | ||||||||||||
|
|
@@ -24,14 +26,23 @@ | |||||||||||
| ''; | ||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| enableSSHSupport = lib.mkOption { | ||||||||||||
| type = lib.types.bool; | ||||||||||||
| default = false; | ||||||||||||
| description = '' | ||||||||||||
| Enable SSH agent support in Gnome Keyring by setting SSH_AUTH_SOCK | ||||||||||||
| environment variable correctly. | ||||||||||||
| ''; | ||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| ###### implementation | ||||||||||||
|
|
||||||||||||
| config = lib.mkIf config.services.gnome.gnome-keyring.enable { | ||||||||||||
| config = lib.mkIf cfg.enable { | ||||||||||||
|
|
||||||||||||
| environment.systemPackages = [ pkgs.gnome.gnome-keyring ]; | ||||||||||||
|
|
||||||||||||
|
|
@@ -48,6 +59,12 @@ | |||||||||||
| source = "${pkgs.gnome.gnome-keyring}/bin/gnome-keyring-daemon"; | ||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| environment.extraInit = lib.mkIf cfg.enableSSHSupport '' | ||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. Is there no easy way to express this with
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At first I was trying to use something like this: Then I relied on what is done with SSH and GnuPG, I thought it was a better practice.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This The current way is not that bad though: nixpkgs/nixos/modules/services/security/yubikey-agent.nix Lines 48 to 52 in 8535fb9
|
||||||||||||
| if [ -z "$SSH_AUTH_SOCK" -a -n "$XDG_RUNTIME_DIR" ]; then | ||||||||||||
| export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/keyring/ssh" | ||||||||||||
| fi | ||||||||||||
| ''; | ||||||||||||
|
|
||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| } | ||||||||||||
Uh oh!
There was an error while loading. Please reload this page.