aboutsummaryrefslogtreecommitdiff
path: root/modules/services/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/services/default.nix')
-rw-r--r--modules/services/default.nix66
1 files changed, 37 insertions, 29 deletions
diff --git a/modules/services/default.nix b/modules/services/default.nix
index b95a3e6..a7b523d 100644
--- a/modules/services/default.nix
+++ b/modules/services/default.nix
@@ -1,4 +1,11 @@
-{ self, config, lib, pkgs, nixgl, ... }:
+{
+ self,
+ config,
+ lib,
+ pkgs,
+ nixgl,
+ ...
+}:
let
cfg = config.modules.services;
@@ -26,45 +33,46 @@ in
description = "Whether to enable the user service manager module.";
};
coreServices = mkOption {
- type = types.listOf types.str;
+ type = types.listOf types.str;
description = "List of services to start first";
example = [ "dbus" ];
- default = [];
+ default = [ ];
};
services = mkOption {
description = "List of user services to run on login";
- type = types.attrsOf (types.submodule {
- options = {
- run = mkOption {
- type = types.str;
- description = "The 'run' script for the service";
- example =
- ''#!/bin/sh
+ type = types.attrsOf (
+ types.submodule {
+ options = {
+ run = mkOption {
+ type = types.str;
+ description = "The 'run' script for the service";
+ example = ''
+ #!/bin/sh
- exec chpst -e "$TURNSTILE_ENV_DIR" foo
- '';
- };
- log = mkOption {
- type = types.nullOr types.str;
- description = "The log/run script for the service. A pipe is opened from the output of the 'run' process to this script";
- example =
- ''#!/bin/sh
+ exec chpst -e "$TURNSTILE_ENV_DIR" foo
+ '';
+ };
+ log = mkOption {
+ type = types.nullOr types.str;
+ description = "The log/run script for the service. A pipe is opened from the output of the 'run' process to this script";
+ example = ''
+ #!/bin/sh
- exec vlogger -t dbus-$(id -u) -p daemon
- '';
- default = "";
+ exec vlogger -t dbus-$(id -u) -p daemon
+ '';
+ default = "";
+ };
};
- };
- });
+ }
+ );
};
};
- config = lib.mkIf cfg.enable {
- xdg.configFile = (lib.concatMapAttrs mkService cfg.services)
- // {
- "service/turnstile-ready/conf" = {
- text = ''core_services="${lib.strings.concatStringsSep " " cfg.coreServices}"'';
- };
+ config = lib.mkIf cfg.enable {
+ xdg.configFile = (lib.concatMapAttrs mkService cfg.services) // {
+ "service/turnstile-ready/conf" = {
+ text = ''core_services="${lib.strings.concatStringsSep " " cfg.coreServices}"'';
};
+ };
};
}