pueue: add module

This commit is contained in:
AndersonTorres 2022-08-12 23:37:04 -03:00 committed by Robert Helgesson
parent ae474885f7
commit 7bb4576f46
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89
4 changed files with 70 additions and 0 deletions

2
.github/CODEOWNERS vendored
View File

@ -421,6 +421,8 @@ Makefile @thiagokokada
/modules/services/poweralertd.nix @ThibautMarty
/modules/services/pueue.nix @AndersonTorres
/modules/services/pulseeffects.nix @jonringer
/modules/services/random-background.nix @rycee

View File

@ -653,6 +653,14 @@ in
A new module is available: 'programs.bashmount'.
'';
}
{
time = "2022-08-25T21:01:37+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.pueue'.
'';
}
];
};
}

View File

@ -244,6 +244,7 @@ let
./services/plex-mpv-shim.nix
./services/polybar.nix
./services/poweralertd.nix
./services/pueue.nix
./services/pulseeffects.nix
./services/random-background.nix
./services/recoll.nix

View File

@ -0,0 +1,59 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.pueue;
yamlFormat = pkgs.formats.yaml { };
configFile = yamlFormat.generate "pueue.yaml" cfg.settings;
in {
meta.maintainers = [ maintainers.AndersonTorres ];
options.services.pueue = {
enable = mkEnableOption "Pueue, CLI process scheduler and manager";
package = mkPackageOption pkgs "pueue" { };
settings = mkOption {
type = yamlFormat.type;
default = { };
example = literalExpression ''
{
daemon = {
default_parallel_tasks = 2;
};
}
'';
description = ''
Configuration written to
<filename>$XDG_CONFIG_HOME/pueue/pueue.yml</filename>.
'';
};
};
config = mkIf cfg.enable {
assertions =
[ (hm.assertions.assertPlatform "services.pueue" pkgs platforms.linux) ];
home.packages = [ cfg.package ];
xdg.configFile."pueue/pueue.yml".source = configFile;
systemd.user = {
services.pueued = {
Unit = {
Description = "Pueue Daemon - CLI process scheduler and manager";
};
Service = {
Restart = "on-failure";
ExecStart = "${cfg.package}/bin/pueued -v -c ${configFile}";
};
Install.WantedBy = [ "default.target" ];
};
};
};
}