mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
chore: clean up flake
This commit is contained in:
parent
178d51cde6
commit
6ca7717d3e
63 changed files with 5134 additions and 1157 deletions
|
|
@ -1,23 +1,29 @@
|
|||
{ self, lib, config, pkgs, ... }:
|
||||
let
|
||||
servicePort = 3254;
|
||||
serviceUser = "mpd";
|
||||
serviceGroup = serviceUser;
|
||||
serviceName = "mpd";
|
||||
in
|
||||
{
|
||||
options.swarselsystems.modules.server.mpd = lib.mkEnableOption "enable mpd on server";
|
||||
config = lib.mkIf config.swarselsystems.modules.server.mpd {
|
||||
options.swarselsystems.modules.server.${serviceName} = lib.mkEnableOption "enable ${serviceName} on server";
|
||||
config = lib.mkIf config.swarselsystems.modules.server.${serviceName} {
|
||||
users = {
|
||||
groups = {
|
||||
mpd = { };
|
||||
};
|
||||
|
||||
users = {
|
||||
mpd = {
|
||||
${serviceUser} = {
|
||||
isSystemUser = true;
|
||||
group = "mpd";
|
||||
group = serviceGroup;
|
||||
extraGroups = [ "audio" "utmp" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sops = {
|
||||
secrets.mpdpass = { owner = "mpd"; };
|
||||
secrets.mpdpass = { owner = serviceUser; group = serviceGroup; mode = "0440"; };
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
|
@ -26,19 +32,19 @@
|
|||
mpv
|
||||
];
|
||||
|
||||
topology.self.services.mpd = {
|
||||
name = "MPD";
|
||||
info = "http://localhost:3254";
|
||||
icon = "${self}/topology/images/mpd.png";
|
||||
topology.self.services.${serviceName} = {
|
||||
name = lib.toUpper serviceName;
|
||||
info = "http://localhost:${builtins.toString servicePort}";
|
||||
icon = "${self}/topology/images/${serviceName}.png";
|
||||
};
|
||||
|
||||
services.mpd = {
|
||||
services.${serviceName} = {
|
||||
enable = true;
|
||||
musicDirectory = "/media";
|
||||
user = "mpd";
|
||||
group = "mpd";
|
||||
user = serviceUser;
|
||||
group = serviceGroup;
|
||||
network = {
|
||||
port = 3254;
|
||||
port = servicePort;
|
||||
listenAddress = "any";
|
||||
};
|
||||
credentials = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue