nixos/services.soft-serve: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-30 00:46:47 +02:00
parent 288a627154
commit b84a9d0112

View File

@ -1,7 +1,4 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.soft-serve;
configFile = format.generate "config.yaml" cfg.settings;
@ -12,11 +9,11 @@ in
{
options = {
services.soft-serve = {
enable = mkEnableOption "soft-serve";
enable = lib.mkEnableOption "soft-serve";
package = mkPackageOption pkgs "soft-serve" { };
package = lib.mkPackageOption pkgs "soft-serve" { };
settings = mkOption {
settings = lib.mkOption {
type = format.type;
default = { };
description = ''
@ -24,7 +21,7 @@ in
See <${docUrl}>.
'';
example = literalExpression ''
example = lib.literalExpression ''
{
name = "dadada's repos";
log_format = "text";
@ -41,7 +38,7 @@ in
};
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
systemd.tmpfiles.rules = [
# The config file has to be inside the state dir
@ -61,7 +58,7 @@ in
Type = "simple";
DynamicUser = true;
Restart = "always";
ExecStart = "${getExe cfg.package} serve";
ExecStart = "${lib.getExe cfg.package} serve";
StateDirectory = "soft-serve";
WorkingDirectory = stateDir;
RuntimeDirectory = "soft-serve";
@ -95,5 +92,5 @@ in
};
};
meta.maintainers = [ maintainers.dadada ];
meta.maintainers = [ lib.maintainers.dadada ];
}