-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
core = { | ||
detection_notice = false; | ||
timeout_notice = true; | ||
no_confirmation = false; | ||
suppress_unknown = false; | ||
abort_if_ssh = true; | ||
abort_if_lid_closed = true; | ||
disabled = false; | ||
use_cnn = false; | ||
workaround = "off"; | ||
}; | ||
|
||
video = { | ||
certainty = 3.5; | ||
timeout = 4; | ||
device_path = "/dev/video2"; | ||
warn_no_device = true; | ||
max_height = 320; | ||
frame_width = -1; | ||
frame_height = -1; | ||
dark_threshold = 60; | ||
recording_plugin = "opencv"; | ||
device_format = "v4l2"; | ||
force_mjpeg = false; | ||
exposure = -1; | ||
device_fps = -1; | ||
rotate = 0; | ||
}; | ||
|
||
snapshots = { | ||
save_failed = false; | ||
save_successful = false; | ||
}; | ||
|
||
rubberstamps = { | ||
enabled = false; | ||
stamp_rules = "nod 5s failsafe min_distance=12"; | ||
}; | ||
|
||
debug = { | ||
end_report = false; | ||
verbose_stamps = false; | ||
gtk_stdout = false; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: | ||
let | ||
cfg = config.services.howdy; | ||
settingsType = pkgs.formats.ini { }; | ||
in | ||
{ | ||
options = { | ||
services.howdy = { | ||
enable = lib.mkEnableOption "" // { | ||
description = '' | ||
Howdy and PAM module for face recognition. See | ||
`services.linux-enable-ir-emitter` for enabling the IR emitter support. | ||
''; | ||
}; | ||
|
||
package = lib.mkPackageOption pkgs "howdy" { }; | ||
|
||
settings = lib.mkOption { | ||
inherit (settingsType) type; | ||
default = import ./config.nix; | ||
description = '' | ||
Howdy configuration file. Refer to | ||
<https://github.com/boltgolt/howdy/blob/beta/howdy/src/config.ini> | ||
for options. | ||
''; | ||
}; | ||
}; | ||
}; | ||
|
||
config = lib.mkMerge [ | ||
(lib.mkIf cfg.enable { | ||
environment.systemPackages = [ cfg.package ]; | ||
environment.etc."howdy/config.ini".source = settingsType.generate "howdy-config.ini" cfg.settings; | ||
assertions = [ | ||
{ | ||
assertion = !(builtins.elem "v4l2loopback" config.boot.kernelModules); | ||
message = "Adding 'v4l2loopback' to `boot.kernelModules` causes Howdy to no longer work. Consider adding it to `boot.extraModulePackages` instead."; | ||
} | ||
]; | ||
}) | ||
{ | ||
services.howdy.settings = lib.mapAttrsRecursive (name: lib.mkDefault) (import ./config.nix); | ||
} | ||
]; | ||
} |