wip vault
This commit is contained in:
parent
4bab9c4f86
commit
2bec46813c
1 changed files with 50 additions and 8 deletions
|
@ -1,19 +1,52 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
name = "vaultwarden";
|
||||
hostDataDir = "/var/lib/${name}";
|
||||
localAddress = "192.168.100.111";
|
||||
|
||||
binds = [
|
||||
{
|
||||
containers.vaultwarden = {
|
||||
host = "${hostDataDir}/data";
|
||||
container = "/data?";
|
||||
user = config.users.users.vaultwarden.name;
|
||||
}
|
||||
];
|
||||
in
|
||||
{
|
||||
users = lib.foldl (
|
||||
acc: bind:
|
||||
{
|
||||
users.${bind.user} = {
|
||||
isSystemUser = true;
|
||||
home = bind.host;
|
||||
createHome = true;
|
||||
group = bind.user;
|
||||
};
|
||||
groups.${bind.user} = { };
|
||||
}
|
||||
// acc
|
||||
) { } binds;
|
||||
|
||||
containers.${name} = {
|
||||
ephemeral = true;
|
||||
autoStart = true;
|
||||
privateNetwork = true;
|
||||
hostAddress = "192.168.100.2";
|
||||
localAddress = "192.168.100.12";
|
||||
bindMounts = {
|
||||
"/incontainer" = {
|
||||
hostPath = "/asd";
|
||||
localAddress = localAddress;
|
||||
bindMounts = lib.foldl (
|
||||
acc: bind:
|
||||
{
|
||||
"${bind.container}" = {
|
||||
hostPath = bind.host;
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
// acc
|
||||
) { } binds;
|
||||
config =
|
||||
{ ... }:
|
||||
{
|
||||
|
@ -28,4 +61,13 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."vault.joshuabell.xyz" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations = {
|
||||
"/" = {
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue