safeeyes: add module

This adds a basic module for Safe Eyes based off of the one in
Nixpkgs.
This commit is contained in:
Rosario Pulella 2022-09-25 15:47:53 -04:00 committed by Robert Helgesson
parent 3eaadd82b8
commit 9b91709899
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89
4 changed files with 55 additions and 0 deletions

2
.github/CODEOWNERS vendored
View File

@ -448,6 +448,8 @@ Makefile @thiagokokada
/modules/services/redshift-gammastep @rycee @petabyteboy @thiagokokada
/tests/modules/redshift-gammastep @thiagokokada
/modules/services/safeeyes @Rosuavio
/modules/services/screen-locker.nix @jrobsonchase @rszamszur
/tests/modules/services/screen-locker @jrobsonchase @rszamszur

View File

@ -704,6 +704,14 @@ in
A new module is available: 'xsession.windowManager.fluxbox'.
'';
}
{
time = "2022-09-25T21:00:05+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.safeeyes'.
'';
}
];
};
}

View File

@ -256,6 +256,7 @@ let
./services/redshift-gammastep/gammastep.nix
./services/redshift-gammastep/redshift.nix
./services/rsibreak.nix
./services/safeeyes.nix
./services/screen-locker.nix
./services/sctd.nix
./services/spotifyd.nix

View File

@ -0,0 +1,44 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.safeeyes;
in {
meta.maintainers = [ hm.maintainers.rosuavio ];
options = {
services.safeeyes = {
enable = mkEnableOption "The Safe Eyes OSGI service";
package = mkPackageOption pkgs "safeeyes" { };
};
};
config = mkIf cfg.enable {
assertions = [
(hm.assertions.assertPlatform "services.safeeyes" pkgs platforms.linux)
];
home.packages = [ cfg.package ];
systemd.user.services.safeeyes = {
Install.WantedBy = [ "graphical-session.target" ];
Unit = {
Description = "Safe Eyes";
PartOf = [ "graphical-session.target" ];
StartLimitIntervalSec = 350;
StartLimitBurst = 30;
};
Service = {
ExecStart = getExe pkgs.safeeyes;
Restart = "on-failure";
RestartSec = 3;
};
};
};
}