This commit is contained in:
Dmitry Voronin 2024-06-09 16:26:05 +03:00
parent 2cc71a7a34
commit 0e04f0ccd6
4 changed files with 31 additions and 42 deletions

27
container/Cloud.nix Normal file
View file

@ -0,0 +1,27 @@
{ storage
, mkContainer
, mkContainerConfig
, mkContainerDir
, ... } @args: let
address = "10.1.0.13";
path = "${storage}/cloud";
in {
systemd.tmpfiles.rules = map (dir: mkContainerDir "${path}/${dir}") [
"data"
];
containers.postgres = mkContainer address {
bindMounts = {
"/var/www/html" = {
hostPath = "${path}/data";
isReadOnly = false;
};
};
config = { ... }: mkContainerConfig {
services.nextcloud = {
enable = true;
};
};
};
}

View file

@ -1,6 +1,5 @@
{ pkgs { pkgs
, storage , storage
, const
, domain , domain
, util , util
, mkContainer , mkContainer
@ -39,23 +38,8 @@ in {
}; };
}; };
config = { config, lib, ... }: mkContainerConfig { config = { config, ... }: mkContainerConfig {
system.stateVersion = const.stateVersion; environment.systemPackages = [ package ];
users.users.root.password = "";
users.mutableUsers = false;
networking = {
useHostResolvConf = lib.mkForce false;
firewall.enable = false;
};
environment = {
systemPackages = [ package pkgs.neovim ];
variables = {
};
};
systemd.packages = [ package ]; systemd.packages = [ package ];
users.users.paste = { users.users.paste = {

View file

@ -1,5 +1,4 @@
{ storage { storage
, const
, host , host
, mkContainer , mkContainer
, mkContainerConfig , mkContainerConfig
@ -20,17 +19,7 @@ in {
}; };
}; };
config = { lib, pkgs, ... }: mkContainerConfig { config = { pkgs, ... }: mkContainerConfig {
system.stateVersion = const.stateVersion;
users.users.root.password = "";
users.mutableUsers = false;
networking = {
useHostResolvConf = lib.mkForce false;
firewall.enable = false;
};
services.postgresql = let services.postgresql = let
databases = [ databases = [
"privatebin" "privatebin"

View file

@ -1,5 +1,4 @@
{ storage { storage
, const
, util , util
, domain , domain
, mkContainer , mkContainer
@ -27,17 +26,7 @@ in {
}; };
}; };
config = { lib, pkgs, ... }: mkContainerConfig { config = { pkgs, ... }: mkContainerConfig {
system.stateVersion = const.stateVersion;
users.users.root.password = "";
users.mutableUsers = false;
networking = {
useHostResolvConf = lib.mkForce false;
firewall.enable = false;
};
environment.systemPackages = with pkgs; [ certbot ]; environment.systemPackages = with pkgs; [ certbot ];
services.nginx = { services.nginx = {