nixos-config/nixos/components/gui/pass.nix

42 lines
1 KiB
Nix

{ lib, pkgs, config, ... }:
with lib;
let
# desktop file
# ------------
# makes it possible to be used by other programs
desktopFile = name: bin:
pkgs.writeTextFile {
name = "${name}.desktop";
destination = "/share/applications/${name}.desktop";
text = ''
[Desktop Entry]
Categories=Application;Utility;
Comment=password dialog
Encoding=UTF-8
Exec=${bin}
Icon=gnome-lockscreen
Name=${name}
Terminal=false
Type=Application
'';
};
in
{
config = mkIf config.components.gui.enable {
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")
pkgs.otpmenu
# todo ein script machen was hier tut
# zbarimg -q --raw 2018-12-18-114509.png | pass otp insert mindcurv/cloudamqp/otp
pkgs.zbar
];
};
}