0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +03:00

nixos/pocket-id: refactor

This commit is contained in:
Gutyina Gergő 2025-05-26 23:53:08 +02:00
parent cf7ece2830
commit fd9611949f
No known key found for this signature in database

View file

@ -7,13 +7,16 @@
let let
inherit (lib) inherit (lib)
concatMap
concatStringsSep
getExe
maintainers
mkEnableOption mkEnableOption
mkIf mkIf
mkOption mkOption
optionalAttrs
optional
mkPackageOption mkPackageOption
concatMap optional
optionalAttrs
; ;
inherit (lib.types) inherit (lib.types)
bool bool
@ -28,7 +31,7 @@ let
settingsFile = format.generate "pocket-id-env-vars" cfg.settings; settingsFile = format.generate "pocket-id-env-vars" cfg.settings;
in in
{ {
meta.maintainers = with lib.maintainers; [ meta.maintainers = with maintainers; [
gepbird gepbird
ymstnt ymstnt
]; ];
@ -149,7 +152,7 @@ in
User = cfg.user; User = cfg.user;
Group = cfg.group; Group = cfg.group;
WorkingDirectory = cfg.dataDir; WorkingDirectory = cfg.dataDir;
ExecStart = "${cfg.package}/bin/pocket-id"; ExecStart = getExe cfg.package;
Restart = "always"; Restart = "always";
EnvironmentFile = [ EnvironmentFile = [
cfg.environmentFile cfg.environmentFile
@ -188,7 +191,7 @@ in
RestrictRealtime = true; RestrictRealtime = true;
RestrictSUIDSGID = true; RestrictSUIDSGID = true;
SystemCallArchitectures = "native"; SystemCallArchitectures = "native";
SystemCallFilter = lib.concatStringsSep " " [ SystemCallFilter = concatStringsSep " " [
"~" "~"
"@clock" "@clock"
"@cpu-emulation" "@cpu-emulation"