Restructure to focus on nix.
This commit is contained in:
parent
6952570818
commit
588fdbd9f2
19 changed files with 4 additions and 25 deletions
51
common/services/vaultwarden.nix
Normal file
51
common/services/vaultwarden.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf mkOption;
|
||||
|
||||
cfg = config.foehammer.services.vaultwarden;
|
||||
in {
|
||||
options.foehammer.services.vaultwarden = {
|
||||
enable = mkEnableOption "Enable Vaultwarden Server";
|
||||
|
||||
port = mkOption {
|
||||
type = lib.types.port;
|
||||
default = 8222;
|
||||
description = ''
|
||||
What external port to serve over.
|
||||
'';
|
||||
};
|
||||
|
||||
signups = mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
envPath = mkOption {
|
||||
type = lib.types.path;
|
||||
};
|
||||
|
||||
domain = mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.vaultwarden = {
|
||||
enable = true;
|
||||
|
||||
config = {
|
||||
ROCKET_ADDRESS = "127.0.0.1";
|
||||
ROCKET_PORT = cfg.port;
|
||||
DOMAIN = cfg.domain;
|
||||
ROCKET_LOG = "critical";
|
||||
SIGNUPS_ALLOWED = cfg.signups;
|
||||
};
|
||||
|
||||
environmentFile = cfg.envPath;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue