Skip to content

Commit

Permalink
feat: add wallos
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgon committed Dec 20, 2024
1 parent 40a8d55 commit cb14fc1
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions machines/deedee/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ rec {
vaultwarden.enable = true;
vikunja.enable = false;
wakapi.enable = true;
wallos.enable = true;
whoogle.enable = true;
};

Expand Down
1 change: 1 addition & 0 deletions modules/system/containers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ _: {
./vaultwarden
./vikunja
./wakapi
./wallos
./wg-easy
./whoogle
./zigbee2mqtt
Expand Down
71 changes: 71 additions & 0 deletions modules/system/containers/wallos/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
config,
lib,
svc,
...
}:
let
cfg = config.mySystemApps.wallos;
in
{
options.mySystemApps.wallos = {
enable = lib.mkEnableOption "wallos container";
backup = lib.mkEnableOption "data backup" // {
default = true;
};
dataDir = lib.mkOption {
type = lib.types.str;
description = "Path to directory containing data.";
default = "/var/lib/wallos";
};
};

config = lib.mkIf cfg.enable {
warnings = [ (lib.mkIf (!cfg.backup) "WARNING: Backups for wallos are disabled!") ];

virtualisation.oci-containers.containers.wallos = svc.mkContainer {
cfg = {
image = "ghcr.io/deedee-ops/wallos:2.41.0@sha256:14fc6f16aef48873df160863004ce53b8761e15eb0cb79a92f592ac01b3332e4";
volumes = [
"${cfg.dataDir}/config:/config"
"${cfg.dataDir}/data:/data"
];
};
opts = {
# fetching logos
allowPublic = true;
};
};

services = {
nginx.virtualHosts.wallos = svc.mkNginxVHost {
host = "wallos";
proxyPass = "http://wallos.docker:9000";
};
restic.backups = lib.mkIf cfg.backup (
svc.mkRestic {
name = "wallos";
paths = [ cfg.dataDir ];
}
);
};

systemd.services.docker-wallos = {
preStart = lib.mkAfter ''
mkdir -p "${cfg.dataDir}/config" "${cfg.dataDir}/data"
chown 65000:65000 "${cfg.dataDir}/config" "${cfg.dataDir}/data"
'';
};

environment.persistence."${config.mySystem.impermanence.persistPath}" =
lib.mkIf config.mySystem.impermanence.enable
{ directories = [ cfg.dataDir ]; };

mySystemApps.homepage = {
services.Apps.wallos = svc.mkHomepage "wallos" // {
icon = "wallos.png";
description = "Subscriptions manager";
};
};
};
}

0 comments on commit cb14fc1

Please sign in to comment.