simplify fingerprint module
This commit is contained in:
parent
3c0832158f
commit
61090d1439
@ -1,10 +1,9 @@
|
|||||||
{ inputs, ... }:
|
{ inputs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../modules/greetd.nix
|
../../modules/greetd.nix
|
||||||
../../modules/nvidia-support.nix
|
../../modules/nvidia-support.nix
|
||||||
../../modules/open-fprint-suspend-fix.nix
|
../../modules/fingerprint.nix
|
||||||
inputs.fingerprint-sensor.nixosModules."06cb-009a-fingerprint-sensor"
|
];
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
username = "sadorowo";
|
username = "sadorowo";
|
||||||
fullname = "Franek";
|
fullname = "Franek";
|
||||||
preferredShell = pkgs.fish;
|
preferredShell = pkgs.fish;
|
||||||
in {
|
in {
|
||||||
users.users.${username} = {
|
users.users.${username} = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = fullname;
|
description = fullname;
|
||||||
home = "/home/${username}";
|
home = "/home/${username}";
|
||||||
extraGroups = [ "wheel" "networkmanager" ];
|
extraGroups = [ "wheel" "networkmanager" ];
|
||||||
shell = preferredShell;
|
shell = preferredShell;
|
||||||
ignoreShellProgramCheck = true; # Will do it later in profile configuration
|
ignoreShellProgramCheck = true; # Will do it later in profile configuration
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
51
modules/fingerprint.nix
Normal file
51
modules/fingerprint.nix
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
{ config, lib, pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
options.services.fingerprint-fix.enable = lib.mkEnableOption "Enable support for fingerprint for P51S-like ThinkPads.";
|
||||||
|
options.services.fingerprint-fix.calibDataFile = lib.mkOption {
|
||||||
|
description = "Path to calibration data file.";
|
||||||
|
};
|
||||||
|
|
||||||
|
imports = lib.mkIf config.services.fingerprint-fix.enable [
|
||||||
|
inputs.fingerprint-sensor.nixosModules."06cb-009a-fingerprint-sensor"
|
||||||
|
];
|
||||||
|
|
||||||
|
config = lib.mkIf config.services.fingerprint-fix.enable {
|
||||||
|
# Needed because we're getting TLS error with open-fprintd-resume
|
||||||
|
systemd.services.validity-restart = let
|
||||||
|
targets = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target" ];
|
||||||
|
in {
|
||||||
|
description = "Restart services to fix fingerprint integration";
|
||||||
|
wantedBy = targets;
|
||||||
|
after = targets;
|
||||||
|
serviceConfig = {
|
||||||
|
type = "simple";
|
||||||
|
ExecStart = "systemctl --no-block restart python3-validity.service open-fprintd.service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services."06cb-009a-fingerprint-sensor" = {
|
||||||
|
enable = true;
|
||||||
|
backend = "python-validity";
|
||||||
|
calib-data-file = config.services.fingerprint-fix.calibDataFile;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.open-fprintd.enable = true;
|
||||||
|
|
||||||
|
security.pam.services.login.fprintAuth = true;
|
||||||
|
security.pam.services.greetd.fprintAuth = true;
|
||||||
|
security.pam.services.sudo.fprintAuth = true;
|
||||||
|
security.pam.services.su.fprintAuth = true;
|
||||||
|
|
||||||
|
services.udev.extraRules = ''
|
||||||
|
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="138a", ATTRS{idProduct}=="0097", ATTR{power/persist}="1"
|
||||||
|
'';
|
||||||
|
|
||||||
|
security.pam.services.hyprlock.text = ''
|
||||||
|
# PAM configuration file for hyprlock
|
||||||
|
# the 'login' configuration file (see /etc/pam.d/login)
|
||||||
|
|
||||||
|
auth include login
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
@ -1,31 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
options.services.fingerprint-fix.enable = lib.mkEnableOption "Enable systemd service to restart fingerprint services after suspend.";
|
|
||||||
options.services.fingerprint-fix.calibDataFile = lib.mkOption {
|
|
||||||
description = "Path to calibration data file.";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf config.services.fingerprint-fix.enable {
|
|
||||||
# Needed because we're getting TLS error with open-fprintd-resume
|
|
||||||
systemd.services.validity-restart = let
|
|
||||||
targets = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target" ];
|
|
||||||
in {
|
|
||||||
description = "Restart services to fix fingerprint integration";
|
|
||||||
wantedBy = targets;
|
|
||||||
after = targets;
|
|
||||||
serviceConfig = {
|
|
||||||
type = "oneshot";
|
|
||||||
ExecStart = "systemctl restart python3-validity.service";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services."06cb-009a-fingerprint-sensor" = {
|
|
||||||
enable = true;
|
|
||||||
backend = "python-validity";
|
|
||||||
calib-data-file = config.services.fingerprint-fix.calibDataFile;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.fprintd.enable = lib.mkForce true; # Fprintd is not working with P51s
|
|
||||||
};
|
|
||||||
}
|
|
@ -56,7 +56,6 @@ in {
|
|||||||
greetd.greetd greetd.tuigreet
|
greetd.greetd greetd.tuigreet
|
||||||
playerctl
|
playerctl
|
||||||
adwaita-icon-theme
|
adwaita-icon-theme
|
||||||
darkman
|
|
||||||
android-tools
|
android-tools
|
||||||
filezilla
|
filezilla
|
||||||
bitwarden-desktop
|
bitwarden-desktop
|
||||||
|
@ -16,8 +16,9 @@
|
|||||||
services.darkman = {
|
services.darkman = {
|
||||||
enable = true;
|
enable = true;
|
||||||
darkModeScripts = {
|
darkModeScripts = {
|
||||||
gtk-theme = ''
|
theme = ''
|
||||||
${pkgs.dconf}/bin/dconf write\
|
${pkgs.pywalfox-native}/bin/pywalfox dark
|
||||||
|
${pkgs.dconf}/bin/dconf write\
|
||||||
/org/gnome/desktop/interface/color-scheme "'prefer-dark'"
|
/org/gnome/desktop/interface/color-scheme "'prefer-dark'"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -27,7 +28,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
lightModeScripts = {
|
lightModeScripts = {
|
||||||
gtk-theme = ''
|
theme = ''
|
||||||
|
${pkgs.pywalfox-native}/bin/pywalfox light
|
||||||
${pkgs.dconf}/bin/dconf write\
|
${pkgs.dconf}/bin/dconf write\
|
||||||
/org/gnome/desktop/interface/color-scheme "'prefer-light'"
|
/org/gnome/desktop/interface/color-scheme "'prefer-light'"
|
||||||
'';
|
'';
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
{ pkgs, inputs, ... }:
|
{ pkgs, inputs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
nerdfonts = (pkgs.nerdfonts.override {
|
nerdfonts = (pkgs.nerdfonts.override {
|
||||||
fonts = [
|
fonts = [
|
||||||
"CascadiaCode"
|
"CascadiaCode"
|
||||||
"JetBrainsMono"
|
"JetBrainsMono"
|
||||||
"FiraCode"
|
"FiraCode"
|
||||||
"SpaceMono"
|
"SpaceMono"
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
cursor-theme = "Bibata-Modern-Classic";
|
cursor-theme = "Bibata-Modern-Classic";
|
||||||
cursor-pkg = pkgs.bibata-cursors;
|
cursor-pkg = pkgs.bibata-cursors;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home = {
|
home = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user