1
0
Fork 0
mirror of https://git.sr.ht/~roxwize/.dotfiles synced 2025-05-03 20:23:08 +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. # Auto-generated using compose2nix v0.3.1.
{ pkgs, lib, ... }: { { pkgs, lib, ... }:
{
# Runtime # Runtime
virtualisation.docker = { virtualisation.docker = {
enable = true; enable = true;
@ -12,12 +14,8 @@
image = "ghcr.io/gethomepage/homepage:latest"; image = "ghcr.io/gethomepage/homepage:latest";
volumes = [ volumes = [
"/etc/homepage-dashboard:/app/config:rw" "/etc/homepage-dashboard:/app/config:rw"
"/home/rae/.dotfiles/assets/wallpapers:/app/public/images:rw"
"/var/run/docker.sock:/var/run/docker.sock:rw" "/var/run/docker.sock:/var/run/docker.sock:rw"
]; ];
ports = [
"3000:3000/tcp"
];
log-driver = "journald"; log-driver = "journald";
extraOptions = [ extraOptions = [
"--network-alias=homepage" "--network-alias=homepage"

View file

@ -4,6 +4,10 @@
in { in {
options.r5e.containers.homepage = { options.r5e.containers.homepage = {
enable = lib.mkEnableOption "homepage"; enable = lib.mkEnableOption "homepage";
listenPort = {
type = lib.types.int;
default = 3000;
};
openFirewall = lib.mkOption { openFirewall = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = false; default = false;
@ -18,6 +22,10 @@ in {
description = "See https://gethomepage.dev/widgets/"; description = "See https://gethomepage.dev/widgets/";
default = []; default = [];
}; };
imagesDir = lib.mkOption {
type = lib.types.path;
default = "";
}
}; };
config = lib.mkMerge [ config = lib.mkMerge [
@ -29,7 +37,12 @@ in {
}; };
networking.firewall = lib.mkIf cfg.openFirewall { 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: volumes:
- /etc/homepage-dashboard:/app/config # Make sure your local config directory exists - /etc/homepage-dashboard:/app/config # Make sure your local config directory exists
- /var/run/docker.sock:/var/run/docker.sock # (optional) For docker integrations - /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 # maybe make your own dashboard page yourself or something
homepage = { homepage = {
enable = false; enable = false;
listenPort = 80;
openFirewall = true; openFirewall = true;
settings = { settings = {
title = "near"; title = "near";
@ -51,6 +52,7 @@
}; };
} }
]; ];
imagesDir = /home/rae/.dotfiles/assets/wallpapers;
}; };
}; };