change gpg pinentry to shell script which can determine which session type is used
This commit is contained in:
parent
964ad68305
commit
a8e3cb54ad
4 changed files with 28 additions and 4 deletions
|
|
@ -2,6 +2,7 @@
|
|||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
outputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
|
@ -26,7 +27,7 @@
|
|||
{
|
||||
enable = true;
|
||||
enableSshSupport = true;
|
||||
pinentryPackage = pkgs.pinentry-curses;
|
||||
pinentryPackage = outputs.packages."${pkgs.system}".pinentry-selector;
|
||||
}
|
||||
(lib.mkIf config.youthlic.programs.fish.enable {
|
||||
enableFishIntegration = true;
|
||||
|
|
|
|||
|
|
@ -29,14 +29,14 @@
|
|||
openssh.enable = true;
|
||||
steam.enable = true;
|
||||
};
|
||||
gui.enabled = "niri";
|
||||
gui.enabled = "cosmic";
|
||||
};
|
||||
|
||||
specialisation = {
|
||||
cosmic = {
|
||||
niri = {
|
||||
inheritParentConfig = true;
|
||||
configuration = {
|
||||
youthlic.gui.enabled = lib.mkForce "cosmic";
|
||||
youthlic.gui.enabled = lib.mkForce "niri";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
...
|
||||
}:
|
||||
{
|
||||
pinentry-selector = pkgs.callPackage ./pinentry-selector.nix { };
|
||||
immersive-translate =
|
||||
(pkgs.callPackage "${inputs.firefox-addons}/default.nix" { }).firefox-addons.immersive-translate;
|
||||
}
|
||||
|
|
|
|||
22
pkgs/pinentry-selector.nix
Normal file
22
pkgs/pinentry-selector.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ pkgs }:
|
||||
pkgs.writeShellApplication {
|
||||
name = "pinentry";
|
||||
runtimeInputs = with pkgs; [
|
||||
pinentry-all
|
||||
];
|
||||
text = ''
|
||||
case $(tty) in
|
||||
/dev/tty[1-9])
|
||||
pinentry-curses;;
|
||||
/dev/pts/*)
|
||||
if [ -z "$SSH_CLIENT" ]; then
|
||||
pinentry-qt
|
||||
else
|
||||
pinentry-curses
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
pinentry-curses;;
|
||||
esac
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue