Skip to content

Commit

Permalink
nas: add mealie
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzBischof committed Jan 28, 2025
1 parent b4861d3 commit 09c2777
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ switch-override: add
deploy: add
nixos-rebuild switch --flake .#nas --target-host nas --use-remote-sudo

.PHONY: deploy-override
deploy-override: add
nixos-rebuild switch --flake .#nas --override-input nix-secrets ../nix-secrets --target-host nas --use-remote-sudo

.PHONY: dry-build-nas
dry-build-nas: add
NIXPKGS_ALLOW_INSECURE=1 nixos-rebuild dry-build --flake .#nas --impure
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions hosts/nas/authelia.nix
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,15 @@ in
];
consent_mode = "implicit";
}
{
client_id = "mealie";
client_secret = secrets.authelia-clients-mealie;
authorization_policy = "one_factor";
redirect_uris = [
"https://mealie.${domain}/login"
];
consent_mode = "implicit";
}
];
};
};
Expand Down
1 change: 1 addition & 0 deletions hosts/nas/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ in
./scrutiny.nix
./open-webui.nix
./homeassistant.nix
./mealie.nix
];

homelab.domain = lib.mkDefault secrets.prod-domain;
Expand Down
31 changes: 31 additions & 0 deletions hosts/nas/mealie.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
config,
pkgs,
lib,
secrets,
...
}:
{
services.mealie = {
enable = true;
settings = {
OIDC_AUTH_ENABLED = "true";
OIDC_SIGNUP_ENABLED = "true";
OIDC_CONFIGURATION_URL = "https://auth.${config.homelab.domain}/.well-known/openid-configuration";
OIDC_CLIENT_ID = "mealie";
OIDC_AUTO_REDIRECT = "true"; # WARNING: a default local admin user is created by default!
};
credentialsFile = config.age.secrets.mealie-credentials.path;
};
services.nginx.virtualHosts."mealie.${config.homelab.domain}" = {
forceSSL = true;
useACMEHost = config.homelab.domain;
locations."/" = {
proxyPass = "http://localhost:${toString config.services.mealie.port}";
proxyWebsockets = true;
recommendedProxySettings = true;
};
};

homelab.dashboard.Services.Mealie.href = "https://mealie.${config.homelab.domain}";
}

0 comments on commit 09c2777

Please sign in to comment.