feat: added media module

This commit is contained in:
Giulio De Pasquale 2025-04-26 16:27:13 +01:00
parent d40f064925
commit eec1a9c66a
4 changed files with 54 additions and 9 deletions

View File

@ -151,15 +151,25 @@ in
smartd.enable = true;
};
pepe.services = {
gitea = {
enable = true;
domain = "git.giugl.io";
pepe = {
core = {
media = {
enable = true;
path = "/media";
};
};
immich = {
enable = true;
domain = "photos.giugl.io";
package = pkgs.unstablePkgs.immich;
services = {
gitea = {
enable = true;
domain = "git.giugl.io";
};
immich = {
enable = true;
domain = "photos.giugl.io";
package = pkgs.unstablePkgs.immich;
};
};
};
}

5
modules/core/default.nix Normal file
View File

@ -0,0 +1,5 @@
{...}: {
imports = [
./media.nix
];
}

27
modules/core/media.nix Normal file
View File

@ -0,0 +1,27 @@
{ config, lib, ... }:
let
cfg = config.pepe.core.media;
in
{
options.pepe.core.media = with lib; {
enable = mkEnableOption "Enable media library";
group = mkOption {
type = types.str;
default = "media";
};
path = mkOption {
type = types.str;
default = null;
};
groupMembers = mkOption {
type = types.listOf types.str;
default = [];
};
};
config = lib.mkIf cfg.enable {
users.groups.${cfg.group}.members = [ cfg.group ] ++ cfg.groupMembers;
};
}

View File

@ -1,4 +1,7 @@
{ ... }: {
imports = [ ./services ];
imports = [
./services
./core
];
}