mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 22:59:15 +00:00
nix!: refactored nixosModules
This commit is contained in:
parent
3753271d60
commit
18f7c70bc9
17 changed files with 25 additions and 32 deletions
|
|
@ -1,56 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.services.parrot;
|
||||
t = lib.types;
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
options = {
|
||||
|
||||
services.parrot = {
|
||||
|
||||
enable = lib.mkEnableOption "parrot";
|
||||
|
||||
environmentFile = lib.mkOption {
|
||||
description = "Path to an environment file, you can set the token there";
|
||||
type = t.path;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
users.users."parrot" = {
|
||||
group = "parrot";
|
||||
isSystemUser = true;
|
||||
};
|
||||
users.groups."parrot" = { };
|
||||
|
||||
systemd.services."parrot" = {
|
||||
description = " A hassle-free, highly performant, self-hosted Discord music bot with YouTube and Spotify support. Powered by yt-dlp.";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
User = "parrot";
|
||||
Group = "parrot";
|
||||
|
||||
EnvironmentFile = cfg.environmentFile;
|
||||
|
||||
ExecStart = "${lib.getExe pkgs.parrot}";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue