This commit is contained in:
mjallen18
2024-04-15 15:10:31 -05:00
parent 620fad6d22
commit df83fa93d4
5 changed files with 165 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
{ lib, pkgs, config, ... }:
with lib;
let cfg = config.nas-apps.homarr;
in {
imports = [ ./options.nix ];
config = mkIf cfg.enable {
virtualisation.oci-containers.containers."${cfg.name}" = {
autoStart = cfg.autoStart;
image = cfg.image;
ports = [ "${cfg.httpPort}:7575" ];
volumes = [
"${cfg.configPath}/configs:/app/data/configs"
"${cfg.configPath}/icons:/app/public/icons"
"${cfg.configPath}/data:/data"
"/var/run/docker.sock:/var/run/docker.sock"
"/var/run/podman/podman.sock:/var/run/podman.sock"
];
environment = {
# PUID = cfg.puid;
# PGID = cfg.pgid;
TZ = cfg.timeZone;
};
};
};
}

View File

@@ -0,0 +1,46 @@
{ lib, ... }:
with lib; {
options.nas-apps.homarr = {
enable = mkEnableOption "homarr docker service";
autoStart = mkOption {
type = types.bool;
default = true;
};
httpPort = mkOption {
type = types.str;
default = "7575";
};
name = mkOption {
type = types.str;
default = "homarr";
};
image = mkOption {
type = types.str;
default = "ghcr.io/ajnart/homarr";
};
configPath = mkOption {
type = types.str;
default = "/mnt/ssd/ssd_app_data/homarr";
};
puid = mkOption {
type = types.str;
default = "911";
};
pgid = mkOption {
type = types.str;
default = "1000";
};
timeZone = mkOption {
type = types.str;
default = "America/Chicago";
};
};
}