1
0
Fork 0
mirror of https://git.sr.ht/~roxwize/.dotfiles synced 2025-03-13 16:03:25 +00:00
This commit is contained in:
Rae 5e 2025-03-07 16:47:51 -05:00
parent 304b2ea086
commit deeed5f5ba
Signed by: rae
GPG key ID: 5B1A0FAB9BAB81EE
4 changed files with 61 additions and 49 deletions

View file

@ -1,5 +1,7 @@
# Auto-generated using compose2nix v0.3.1.
{ pkgs, lib, ... }: {
{ pkgs, lib, ... }:
{
# Runtime
virtualisation.docker = {
enable = true;
@ -12,12 +14,8 @@
image = "ghcr.io/gethomepage/homepage:latest";
volumes = [
"/etc/homepage-dashboard:/app/config:rw"
"/home/rae/.dotfiles/assets/wallpapers:/app/public/images:rw"
"/var/run/docker.sock:/var/run/docker.sock:rw"
];
ports = [
"3000:3000/tcp"
];
log-driver = "journald";
extraOptions = [
"--network-alias=homepage"

View file

@ -4,6 +4,10 @@
in {
options.r5e.containers.homepage = {
enable = lib.mkEnableOption "homepage";
listenPort = {
type = lib.types.int;
default = 3000;
};
openFirewall = lib.mkOption {
type = lib.types.bool;
default = false;
@ -18,6 +22,10 @@ in {
description = "See https://gethomepage.dev/widgets/";
default = [];
};
imagesDir = lib.mkOption {
type = lib.types.path;
default = "";
}
};
config = lib.mkMerge [
@ -29,7 +37,12 @@ in {
};
networking.firewall = lib.mkIf cfg.openFirewall {
allowedTCPPorts = [ 3000 ];
allowedTCPPorts = [ builtins.toString cfg.listenPort ];
};
virtualisation.oci-containers.containers.homepage = {
ports = [ builtins.toString cfg.listenPort + ":3000/tcp" ];
volumes = lib.mkIf cfg.imagesDir [ builtins.toString cfg.imagesDir + "/app/public/images:rw" ];
};
}
];

View file

@ -8,4 +8,3 @@ services:
volumes:
- /etc/homepage-dashboard:/app/config # Make sure your local config directory exists
- /var/run/docker.sock:/var/run/docker.sock # (optional) For docker integrations
- /home/rae/.dotfiles/assets/wallpapers:/app/public/images

View file

@ -18,6 +18,7 @@
# maybe make your own dashboard page yourself or something
homepage = {
enable = false;
listenPort = 80;
openFirewall = true;
settings = {
title = "near";
@ -51,6 +52,7 @@
};
}
];
imagesDir = /home/rae/.dotfiles/assets/wallpapers;
};
};