nixos/reposilite: remove with lib;
This commit is contained in:
parent
fc6087bc8d
commit
403f79d7aa
1 changed files with 11 additions and 24 deletions
|
@ -5,36 +5,23 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
cfg = config.services.reposilite;
|
cfg = config.services.reposilite;
|
||||||
|
|
||||||
inherit
|
|
||||||
(lib)
|
|
||||||
getExe
|
|
||||||
literalExpression
|
|
||||||
mdDoc
|
|
||||||
mkDefault
|
|
||||||
mkEnableOption
|
|
||||||
mkIf
|
|
||||||
mkOption
|
|
||||||
mkPackageOption
|
|
||||||
types
|
|
||||||
;
|
|
||||||
in {
|
in {
|
||||||
options.services.reposilite = {
|
options.services.reposilite = {
|
||||||
enable = mkEnableOption "reposilite";
|
enable = lib.mkEnableOption "reposilite";
|
||||||
package = mkPackageOption pkgs "reposilite" {};
|
package = lib.mkPackageOption pkgs "reposilite" {};
|
||||||
environmentFile = mkOption {
|
environmentFile = lib.mkOption {
|
||||||
description = mdDoc ''
|
description = lib.mdDoc ''
|
||||||
Environment file as defined in {manpage}`systemd.exec(5)`
|
Environment file as defined in {manpage}`systemd.exec(5)`
|
||||||
'';
|
'';
|
||||||
type = types.nullOr types.path;
|
type = lib.types.nullOr lib.types.path;
|
||||||
default = null;
|
default = null;
|
||||||
example = literalExpression ''
|
example = lib.literalExpression ''
|
||||||
"/run/agenix.d/1/reposilite"
|
"/run/agenix.d/1/reposilite"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
users = {
|
users = {
|
||||||
users.reposilite = {
|
users.reposilite = {
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
|
@ -46,17 +33,17 @@ in {
|
||||||
|
|
||||||
systemd.services."reposilite" = {
|
systemd.services."reposilite" = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wantedBy = mkDefault ["multi-user.target"];
|
wantedBy = lib.mkDefault ["multi-user.target"];
|
||||||
after = mkDefault ["network.target"];
|
after = lib.mkDefault ["network.target"];
|
||||||
script = ''
|
script = ''
|
||||||
${getExe cfg.package}
|
${lib.getExe cfg.package}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
|
|
||||||
EnvironmentFile = mkIf (cfg.environmentFile != null) cfg.environmentFile;
|
EnvironmentFile = lib.mkIf (cfg.environmentFile != null) cfg.environmentFile;
|
||||||
|
|
||||||
StateDirectory = "reposilite";
|
StateDirectory = "reposilite";
|
||||||
StateDirectoryMode = "0700";
|
StateDirectoryMode = "0700";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue