zaphyra's git: nixfiles

zaphyra's nixfiles

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
{
  inputs,
  systemConfig,
  config,
  lib,
  pkgs,
  ...
}:

{

  options.zaphyra.programs.swaylock.enable = lib.mkOption {
    type = lib.types.bool;
    default = systemConfig.modules.services.swaylock.enable;
  };

  config = lib.mkIf config.zaphyra.programs.swaylock.enable {
    programs.swaylock = {
      enable = true;
      package = pkgs.swaylock-plugin-fprintd;
      settings = {
        # clock = true;

        indicator = true;
        ring-color = "4aa96c";
        show-failed-attempts = true;
        fingerprint = false;

        command = "${lib.getExe pkgs.tgc.shaderbg} '*' --fps 10 ${inputs.self.resources.shaders.background1}";

        # image = "/home/zaphyra/Pictures/Backgrounds/lock.png";
        # scaling = "fit";
        # color = "ffffaf";
      };
    };

    systemd.user.services.swaylock = {
      Unit = {
        OnSuccess = [ "unlock.target" ];
        PartOf = [ "lock.target" ];
        After = [ "lock.target" ];
      };
      Service = {
        ExecStart = lib.getExe config.programs.swaylock.package;
        Restart = "on-failure";
        RestartSec = 0;
      };
      Install.WantedBy = [ "lock.target" ];
    };
  };

}