nixos-config/components/gui/pass.nix

51 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2023-05-28 20:22:23 +02:00
{ pkgs, config, lib, ... }:
2019-10-24 02:20:38 +02:00
with lib;
let
# desktop file
# ------------
# makes it possible to be used by other programs
desktopFile = name: bin:
pkgs.writeTextFile {
2019-12-20 05:54:26 +01:00
name = "${name}.desktop";
2019-10-24 02:20:38 +02:00
destination = "/share/applications/${name}.desktop";
2019-12-20 05:54:26 +01:00
text = ''
2019-10-24 02:20:38 +02:00
[Desktop Entry]
Categories=Application;Utility;
Comment=password dialog
Encoding=UTF-8
Exec=${bin}
Icon=gnome-lockscreen
Name=${name}
Terminal=false
Type=Application
'';
};
2021-11-01 09:20:42 +01:00
in
{
2023-05-28 20:22:23 +02:00
options.components.gui.pass.enable = mkOption {
type = lib.types.bool;
default = config.components.gui.enable;
};
config = mkIf (config.components.gui.pass.enable) {
2019-10-24 02:20:38 +02:00
2023-02-17 00:59:29 +01:00
environment.systemPackages = [
(pkgs.pass.withExtensions (ext: [ ext.pass-otp ]))
# todo : use upstream desktop file creator
(desktopFile "passmenu" "${pkgs.pass.withExtensions (ext: [ext.pass-otp])}/bin/passmenu --type -l 10")
2019-10-24 02:20:38 +02:00
2023-02-17 00:59:29 +01:00
pkgs.otpmenu
2019-10-24 02:20:38 +02:00
2023-02-17 00:59:29 +01:00
# todo ein script machen was hier tut
# zbarimg -q --raw 2018-12-18-114509.png | pass otp insert mindcurv/cloudamqp/otp
pkgs.zbar
2023-07-05 22:16:40 +02:00
pkgs.ctmg
pkgs.pinentry
pkgs.pinentry-curses
2023-02-17 00:59:29 +01:00
];
};
2019-10-24 02:20:38 +02:00
}