1
0
Fork 0
mirror of https://git.sr.ht/~roxwize/.dotfiles synced 2025-03-15 08:44:13 +00:00
.dotfiles/nixos/docker/homepage/default.nix

36 lines
937 B
Nix
Raw Normal View History

2025-03-05 16:54:21 -05:00
{ pkgs, lib, ... }: let
2025-03-05 17:06:00 -05:00
cfg = config.containers.homepage;
2025-03-05 07:46:56 -05:00
settingsFormat = pkgs.formats.yaml;
in {
options.containers.homepage = {
2025-03-05 16:54:21 -05:00
enable = lib.mkEnableOption "homepage";
openFirewall = lib.mkOption {
type = lib.types.bool;
default = false;
};
settings = lib.mkOption {
inherit (settingsFormat) type;
description = "See https://gethomepage.dev/configs/settings/";
default = {};
};
widgets = lib.mkOption {
2025-03-05 07:46:56 -05:00
inherit (settingsFormat) type;
2025-03-05 16:54:21 -05:00
description = "See https://gethomepage.dev/widgets/";
default = [];
2025-03-03 23:55:20 -05:00
};
};
2025-03-05 07:46:56 -05:00
config = {
inherit (./compose.nix);
environment.etc = lib.mkIf cfg.enable {
2025-03-05 16:54:21 -05:00
"homepage-dashboard/settings.yaml".source = settingsFormat.generate "settings.yaml" cfg.settings;
2025-03-05 07:46:56 -05:00
"homepage-dashboard/widgets.yaml".source = settingsFormat.generate "widgets.yaml" cfg.widgets;
2025-03-03 23:55:20 -05:00
};
2025-03-05 16:54:21 -05:00
networking.firewall = lib.mkIf cfg.openFirewall {
allowedTCPPorts = [ 3000 ];
};
2025-03-03 23:55:20 -05:00
};
}