@@ -1,9 +1,42 @@
{ config , pkgs , . . . }:
let
polkitAgent = pkgs . lxqt . lxqt-policykit ;
in
{
#### Fingerprint stack #######################################################
services . fprintd . enable = true ;
services . fprintd . tod . enable = true ;
# Change the driver if your sensor isn’ t Goodix.
services . fprintd . tod . driver = pkgs . libfprint-2-tod1-goodix ;
#### Polkit (needed for Bitwarden’ s “system authentication” prompt) ###########
security . polkit . enable = true ;
services . dbus . enable = true ;
systemd . user . services . polkit-agent = {
description = " P o l k i t a u t h e n t i c a t i o n a g e n t " ;
after = [ " g r a p h i c a l - s e s s i o n . t a r g e t " ] ;
wantedBy = [ " g r a p h i c a l - s e s s i o n . t a r g e t " ] ;
serviceConfig . ExecStart = " ${ polkitAgent } / b i n / l x q t - p o l i c y k i t - a g e n t " ;
serviceConfig . Restart = " o n - f a i l u r e " ;
} ;
#### Autostart Bitwarden desktop in your user session ########################
systemd . user . services . bitwarden = {
description = " B i t w a r d e n D e s k t o p " ;
after = [ " g r a p h i c a l - s e s s i o n . t a r g e t " ] ;
wantedBy = [ " g r a p h i c a l - s e s s i o n . t a r g e t " ] ;
serviceConfig . ExecStart = " ${ pkgs . bitwarden } / b i n / b i t w a r d e n " ;
serviceConfig . Restart = " o n - a b o r t " ;
} ;
#### Handy tools #############################################################
environment . systemPackages = with pkgs ; [
goldwarden
bitwarden
bitwarden-cli
fprintd
lxqt . lxqt-policykit
] ;
environment . shellAliases = {
@@ -14,4 +47,43 @@
environment . shellInit = ''
m k d i r - p ~ / . c o n f i g / b i t w a r d e n - c l i - e p i c e n t e r ~ / . c o n f i g / b i t w a r d e n - c l i - c l o o n a r
'' ;
# environment.systemPackages = with pkgs; [
# bitwarden
# bitwarden-cli
# (runCommand "bitwarden-polkit-policy" {} ''
# mkdir -p $out/share/polkit-1/actions
# cat > $out/share/polkit-1/actions/com.bitwarden.Bitwarden.policy <<'EOF'
# <?xml version="1.0" encoding="UTF-8"?>
# <!DOCTYPE policyconfig PUBLIC
# "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
# "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
# <policyconfig>
# <action id="com.bitwarden.Bitwarden.unlock">
# <description>Unlock Bitwarden</description>
# <message>Authenticate to unlock Bitwarden</message>
# <defaults>
# <allow_any>no</allow_any>
# <allow_inactive>no</allow_inactive>
# <allow_active>auth_self</allow_active>
# </defaults>
# </action>
# </policyconfig>
# EOF
# '')
# ];
# systemd.user.services.polkit-gnome-authentication-agent-1 = {
# description = "polkit-gnome-authentication-agent-1";
# wantedBy = [ "graphical-session.target" ];
# wants = [ "graphical-session.target" ];
# after = [ "graphical-session.target" ];
# serviceConfig = {
# Type = "simple";
# ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
# Restart = "on-failure";
# RestartSec = 1;
# TimeoutStopSec = 10;
# };
# };
}