Container : Fix memory usage.
This commit is contained in:
parent
3a2ef5068c
commit
ceb16560a4
|
@ -1,4 +1,4 @@
|
||||||
{ container, ... } @args: let
|
{ container, pkgs, ... } @args: let
|
||||||
cfg = container.config.cloud;
|
cfg = container.config.cloud;
|
||||||
in {
|
in {
|
||||||
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
||||||
|
@ -13,7 +13,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = { pkgs, config, ... }: container.mkContainerConfig cfg {
|
config = { config, ... }: container.mkContainerConfig cfg {
|
||||||
environment.systemPackages = [ pkgs.postgresql ];
|
environment.systemPackages = [ pkgs.postgresql ];
|
||||||
services.nextcloud = {
|
services.nextcloud = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ container, ... } @args: let
|
{ container, pkgs, ... } @args: let
|
||||||
cfg = container.config.dns;
|
cfg = container.config.dns;
|
||||||
in {
|
in {
|
||||||
containers.dns = container.mkContainer cfg {
|
containers.dns = container.mkContainer cfg {
|
||||||
|
@ -14,7 +14,7 @@ in {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
config = { pkgs, lib, ... }: container.mkContainerConfig cfg {
|
config = { lib, ... }: container.mkContainerConfig cfg {
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.cloudflared
|
pkgs.cloudflared
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ container, ... } @args: let
|
{ container, pkgs, ... } @args: let
|
||||||
cfg = container.config.git;
|
cfg = container.config.git;
|
||||||
in {
|
in {
|
||||||
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
||||||
|
@ -13,7 +13,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = { pkgs, ... }: container.mkContainerConfig cfg {
|
config = { ... }: container.mkContainerConfig cfg {
|
||||||
environment.systemPackages = with pkgs; [ gitea ];
|
environment.systemPackages = with pkgs; [ gitea ];
|
||||||
|
|
||||||
services.gitea = {
|
services.gitea = {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# ISSUE: Broken, can't read/write sda device.
|
# ISSUE: Broken, can't read/write sda device.
|
||||||
{ container, ... } @args: let
|
{ container, pkgs, ... } @args: let
|
||||||
cfg = container.config.hdd;
|
cfg = container.config.hdd;
|
||||||
in {
|
in {
|
||||||
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
||||||
|
@ -29,7 +29,7 @@ in {
|
||||||
|
|
||||||
# additionalCapabilities = [ "CAP_SYS_ADMIN" ];
|
# additionalCapabilities = [ "CAP_SYS_ADMIN" ];
|
||||||
|
|
||||||
config = { pkgs, ... }: container.mkContainerConfig cfg {
|
config = { ... }: container.mkContainerConfig cfg {
|
||||||
environment.systemPackages = with pkgs; [ smartmontools ];
|
environment.systemPackages = with pkgs; [ smartmontools ];
|
||||||
|
|
||||||
services.scrutiny = {
|
services.scrutiny = {
|
||||||
|
|
|
@ -49,7 +49,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = { pkgs, config, ... }: container.mkContainerConfig cfg {
|
config = { config, ... }: container.mkContainerConfig cfg {
|
||||||
imports = [
|
imports = [
|
||||||
(builtins.fetchTarball {
|
(builtins.fetchTarball {
|
||||||
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-${const.stateVersion}/nixos-mailserver-nixos-${const.stateVersion}.tar.gz";
|
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-${const.stateVersion}/nixos-mailserver-nixos-${const.stateVersion}.tar.gz";
|
||||||
|
|
|
@ -17,7 +17,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = { lib, pkgs, ... }: container.mkContainerConfig cfg {
|
config = { lib, ... }: container.mkContainerConfig cfg {
|
||||||
environment.systemPackages = with pkgs; [ postgresql inetutils ];
|
environment.systemPackages = with pkgs; [ postgresql inetutils ];
|
||||||
|
|
||||||
services.paperless = {
|
services.paperless = {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Takes pictures from first photo dir, processes and stores to the second one.
|
# Takes pictures from first photo dir, processes and stores to the second one.
|
||||||
{ container, util, ... } @args: let
|
{ container, util, pkgs, ... } @args: let
|
||||||
cfg = container.config.photoprocess;
|
cfg = container.config.photoprocess;
|
||||||
in {
|
in {
|
||||||
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
||||||
|
@ -23,7 +23,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = { pkgs, lib, ... }: container.mkContainerConfig cfg {
|
config = { lib, ... }: container.mkContainerConfig cfg {
|
||||||
systemd.services.photosprocess = let
|
systemd.services.photosprocess = let
|
||||||
script = pkgs.writeText "PhotoprocessScript" (util.trimTabs ''
|
script = pkgs.writeText "PhotoprocessScript" (util.trimTabs ''
|
||||||
source /data/Notify.sh
|
source /data/Notify.sh
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ container, lib, ... } @args: let
|
{ container, lib, pkgs, ... } @args: let
|
||||||
cfg = container.config.postgres;
|
cfg = container.config.postgres;
|
||||||
in {
|
in {
|
||||||
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
||||||
|
@ -13,7 +13,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = { pkgs, ... }: container.mkContainerConfig cfg {
|
config = { ... }: container.mkContainerConfig cfg {
|
||||||
services.postgresql = let
|
services.postgresql = let
|
||||||
# Populate with services here.
|
# Populate with services here.
|
||||||
configurations = with container.config; {
|
configurations = with container.config; {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ domain, util, container, ... } @args: let
|
{ domain, util, container, pkgs, ... } @args: let
|
||||||
cfg = container.config.proxy;
|
cfg = container.config.proxy;
|
||||||
virtualHosts = util.catSet (util.ls ./proxy/host) args;
|
virtualHosts = util.catSet (util.ls ./proxy/host) args;
|
||||||
in {
|
in {
|
||||||
|
@ -31,7 +31,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = { pkgs, ... }: container.mkContainerConfig cfg {
|
config = { ... }: container.mkContainerConfig cfg {
|
||||||
environment.systemPackages = with pkgs; [ certbot ];
|
environment.systemPackages = with pkgs; [ certbot ];
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ container, lib, ... } @args: let
|
{ container, lib, pkgs, ... } @args: let
|
||||||
cfg = container.config.read;
|
cfg = container.config.read;
|
||||||
in {
|
in {
|
||||||
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
||||||
|
@ -16,7 +16,7 @@ in {
|
||||||
// container.attachMedia "manga" cfg.manga true
|
// container.attachMedia "manga" cfg.manga true
|
||||||
;
|
;
|
||||||
|
|
||||||
config = { pkgs, ... }: container.mkContainerConfig cfg {
|
config = { ... }: container.mkContainerConfig cfg {
|
||||||
services.kavita = {
|
services.kavita = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dataDir = "/var/lib/kavita";
|
dataDir = "/var/lib/kavita";
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{ container, ... } @args: let
|
{ container, pkgs, ... } @args: let
|
||||||
cfg = container.config.search;
|
cfg = container.config.search;
|
||||||
in {
|
in {
|
||||||
containers.search = container.mkContainer cfg {
|
containers.search = container.mkContainer cfg {
|
||||||
config = { pkgs, ... }: container.mkContainerConfig cfg {
|
config = { ... }: container.mkContainerConfig cfg {
|
||||||
services.searx = {
|
services.searx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.searxng;
|
package = pkgs.searxng;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ container, ... } @args: let
|
{ container, pkgs, ... } @args: let
|
||||||
cfg = container.config.vpn;
|
cfg = container.config.vpn;
|
||||||
in {
|
in {
|
||||||
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
||||||
|
@ -18,7 +18,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = { pkgs, ... }: container.mkContainerConfig cfg {
|
config = { ... }: container.mkContainerConfig cfg {
|
||||||
environment.systemPackages = with pkgs; [ wireguard-tools ];
|
environment.systemPackages = with pkgs; [ wireguard-tools ];
|
||||||
networking.useNetworkd = true;
|
networking.useNetworkd = true;
|
||||||
systemd.network = {
|
systemd.network = {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{ container, ... } @args: let
|
{ container, pkgs, ... } @args: let
|
||||||
cfg = container.config.yt;
|
cfg = container.config.yt;
|
||||||
in {
|
in {
|
||||||
containers.yt = container.mkContainer cfg {
|
containers.yt = container.mkContainer cfg {
|
||||||
config = { pkgs, ... }: container.mkContainerConfig cfg {
|
config = { ... }: container.mkContainerConfig cfg {
|
||||||
services.invidious = {
|
services.invidious = {
|
||||||
enable = true;
|
enable = true;
|
||||||
domain = cfg.domain;
|
domain = cfg.domain;
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
, storage
|
, storage
|
||||||
, domain
|
, domain
|
||||||
, media
|
, media
|
||||||
|
, pkgs
|
||||||
, ... }: {
|
, ... }: {
|
||||||
inherit host;
|
inherit host;
|
||||||
|
|
||||||
|
@ -15,10 +16,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
mkContainerConfig = config: cfg: lib.recursiveUpdate cfg {
|
mkContainerConfig = config: cfg: lib.recursiveUpdate cfg {
|
||||||
|
nixpkgs.pkgs = lib.mkForce pkgs;
|
||||||
system.stateVersion = const.stateVersion;
|
system.stateVersion = const.stateVersion;
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
users.users.root.password = "";
|
users.users.root.password = "";
|
||||||
users.mutableUsers = false;
|
users.mutableUsers = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue