WIP: Migrate from Docker to NixOS Containers. #67
27
container/Cloud.nix
Normal file
27
container/Cloud.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
{ pkgs
|
||||
, storage
|
||||
, const
|
||||
, domain
|
||||
, util
|
||||
, mkContainer
|
||||
|
@ -39,23 +38,8 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
config = { config, lib, ... }: mkContainerConfig {
|
||||
system.stateVersion = const.stateVersion;
|
||||
|
||||
users.users.root.password = "";
|
||||
users.mutableUsers = false;
|
||||
|
||||
networking = {
|
||||
useHostResolvConf = lib.mkForce false;
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
environment = {
|
||||
systemPackages = [ package pkgs.neovim ];
|
||||
variables = {
|
||||
};
|
||||
};
|
||||
|
||||
config = { config, ... }: mkContainerConfig {
|
||||
environment.systemPackages = [ package ];
|
||||
systemd.packages = [ package ];
|
||||
|
||||
users.users.paste = {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{ storage
|
||||
, const
|
||||
, host
|
||||
, mkContainer
|
||||
, mkContainerConfig
|
||||
|
@ -20,17 +19,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
config = { lib, pkgs, ... }: mkContainerConfig {
|
||||
system.stateVersion = const.stateVersion;
|
||||
|
||||
users.users.root.password = "";
|
||||
users.mutableUsers = false;
|
||||
|
||||
networking = {
|
||||
useHostResolvConf = lib.mkForce false;
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
config = { pkgs, ... }: mkContainerConfig {
|
||||
services.postgresql = let
|
||||
databases = [
|
||||
"privatebin"
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{ storage
|
||||
, const
|
||||
, util
|
||||
, domain
|
||||
, mkContainer
|
||||
|
@ -27,17 +26,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
config = { lib, pkgs, ... }: mkContainerConfig {
|
||||
system.stateVersion = const.stateVersion;
|
||||
|
||||
users.users.root.password = "";
|
||||
users.mutableUsers = false;
|
||||
|
||||
networking = {
|
||||
useHostResolvConf = lib.mkForce false;
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
config = { pkgs, ... }: mkContainerConfig {
|
||||
environment.systemPackages = with pkgs; [ certbot ];
|
||||
|
||||
services.nginx = {
|
||||
|
|
Loading…
Reference in a new issue