refactor: switch from modules to import arrays
This commit is contained in:
parent
d893750c09
commit
41eaa38d31
75 changed files with 1870 additions and 2541 deletions
|
|
@ -1,67 +1,51 @@
|
|||
{
|
||||
# keep-sorted start
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
lib,
|
||||
# keep-sorted end
|
||||
...
|
||||
}:
|
||||
let
|
||||
feature = "copyparty";
|
||||
port = "5000";
|
||||
in
|
||||
{
|
||||
imports = [ inputs.copyparty.nixosModules.default ];
|
||||
|
||||
config = lib.mkIf config.${feature}.enable {
|
||||
services = {
|
||||
# service
|
||||
copyparty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
z = true;
|
||||
e2dsa = true;
|
||||
e2ts = true;
|
||||
e2vu = true;
|
||||
p = lib.toInt port;
|
||||
};
|
||||
|
||||
accounts = {
|
||||
will = {
|
||||
passwordFile = config.age.secrets.copyparty-will.path;
|
||||
};
|
||||
};
|
||||
|
||||
volumes = {
|
||||
"/" = {
|
||||
path = "/srv/copyparty";
|
||||
access = {
|
||||
r = "*";
|
||||
A = [ "will" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
services = {
|
||||
copyparty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
z = true;
|
||||
e2dsa = true;
|
||||
e2ts = true;
|
||||
e2vu = true;
|
||||
p = lib.toInt port;
|
||||
};
|
||||
|
||||
# reverse proxy
|
||||
nginx = {
|
||||
virtualHosts."${feature}.fi33.buzz" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "fi33.buzz";
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${port}";
|
||||
# proxyWebsockets = true;
|
||||
};
|
||||
accounts.will.passwordFile = config.age.secrets.copyparty-will.path;
|
||||
|
||||
volumes."/" = {
|
||||
path = "/srv/copyparty";
|
||||
access = {
|
||||
r = "*";
|
||||
A = [ "will" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# secrets
|
||||
age.secrets."copyparty-will" = {
|
||||
file = ../../../secrets/copyparty-will.age;
|
||||
owner = "copyparty";
|
||||
nginx.virtualHosts."copyparty.fi33.buzz" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "fi33.buzz";
|
||||
locations."/".proxyPass = "http://localhost:${port}";
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [ inputs.copyparty.overlays.default ];
|
||||
};
|
||||
|
||||
options.${feature}.enable = lib.mkEnableOption "enables ${feature}";
|
||||
# secrets
|
||||
age.secrets."copyparty-will" = {
|
||||
file = ../../../secrets/copyparty-will.age;
|
||||
owner = "copyparty";
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [ inputs.copyparty.overlays.default ];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue