Re-add Vaultwarden
This commit is contained in:
parent
712828efc4
commit
c94447d0c1
4 changed files with 72 additions and 0 deletions
|
@ -3,5 +3,6 @@
|
|||
./homepage
|
||||
./samba.nix
|
||||
./uptime-kuma.nix
|
||||
./vaultwarden.nix
|
||||
];
|
||||
}
|
||||
|
|
68
hosts/nixedo/services/vaultwarden.nix
Normal file
68
hosts/nixedo/services/vaultwarden.nix
Normal file
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = homelab.services.${service};
|
||||
homelab = config.features.homelab;
|
||||
service = "vaultwarden";
|
||||
in
|
||||
{
|
||||
options.features.homelab.services.${service} = {
|
||||
enable = mkEnableOption "Enable ${service}";
|
||||
|
||||
url = mkOption {
|
||||
default = "${service}.${homelab.baseDomain}";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
homepage.name = mkOption {
|
||||
default = "Vaultwarden";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
homepage.description = mkOption {
|
||||
default = "Unofficial Bitwarden compatible server written in Rust";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
homepage.icon = mkOption {
|
||||
default = "bitwarden";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
homepage.category = mkOption {
|
||||
default = "Services";
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services = {
|
||||
${service} = {
|
||||
enable = true;
|
||||
|
||||
config = {
|
||||
DOMAIN = "https://${cfg.url}";
|
||||
ROCKET_PORT = 8222;
|
||||
SIGNUPS_ALLOWED = false;
|
||||
};
|
||||
};
|
||||
|
||||
nginx.virtualHosts.${cfg.url} = {
|
||||
forceSSL = true;
|
||||
useACMEHost = homelab.baseDomain;
|
||||
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString config.services.${service}.config.ROCKET_PORT}";
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue