Skip to content

Commit

Permalink
Nix/HM module: add security.pam instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
fufexan committed Mar 2, 2024
1 parent 4286cfb commit 97548ec
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions nix/hm-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,31 @@ self: {
inherit (lib.modules) mkIf;
inherit (lib.options) mkOption mkEnableOption;

boolToString = x: if x then "true" else "false";
boolToString = x:
if x
then "true"
else "false";
cfg = config.programs.hyprlock;
in {
options.programs.hyprlock = {
enable = mkEnableOption "Hyprlock, Hyprland's GPU-accelerated lock screen utility";
enable =
mkEnableOption ""
// {
description = ''
Whether to enable Hyprlock, Hyprland's GPU-accelerated lock screen utility.
Note that PAM must be configured to enable hyprlock to perform
authentication. The package installed through home-manager
will *not* be able to unlock the session without this
configuration.
On NixOS, it can be enabled using:
```nix
security.pam.services.hyprlock = {};

This comment has been minimized.

Copy link
@0fie

0fie Mar 3, 2024

I don't have this line anywhere in my NixOS configuration but Hyprlock is functioning perfectly, as intended. Am I misunderstanding something?

This comment has been minimized.

Copy link
@fufexan

fufexan Mar 3, 2024

Author Member

You need to update for this to take effect. Since a few commits ago, hyprlock uses its own pam file instead of calling su.

This comment has been minimized.

Copy link
@vaxerski

vaxerski Mar 3, 2024

Member

I added a su fallback fwiw

This comment has been minimized.

Copy link
@0fie

0fie Mar 3, 2024

Understood, thanks.

```
'';
};

package = mkOption {
description = "The hyprlock package";
Expand Down Expand Up @@ -110,7 +130,7 @@ in {
};
});
default = [
{ }
{}
];
};

Expand Down Expand Up @@ -224,7 +244,7 @@ in {
};
});
default = [
{ }
{}
];
};

Expand Down Expand Up @@ -290,13 +310,13 @@ in {
};
});
default = [
{ }
{}
];
};
};

config = mkIf cfg.enable {
home.packages = [ cfg.package ];
home.packages = [cfg.package];

xdg.configFile."hypr/hyprlock.conf".text = ''
general {
Expand Down

0 comments on commit 97548ec

Please sign in to comment.