Container : Fix memory usage.

This commit is contained in:
Dmitry Voronin 2024-06-14 02:58:39 +03:00
parent 3a2ef5068c
commit ceb16560a4
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
14 changed files with 26 additions and 26 deletions

View file

@ -1,4 +1,4 @@
{ container, ... } @args: let
{ container, pkgs, ... } @args: let
cfg = container.config.cloud;
in {
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 ];
services.nextcloud = {
enable = true;

View file

@ -1,4 +1,4 @@
{ container, ... } @args: let
{ container, pkgs, ... } @args: let
cfg = container.config.dns;
in {
containers.dns = container.mkContainer cfg {
@ -14,7 +14,7 @@ in {
}
];
config = { pkgs, lib, ... }: container.mkContainerConfig cfg {
config = { lib, ... }: container.mkContainerConfig cfg {
environment.systemPackages = [
pkgs.cloudflared
];

View file

@ -1,4 +1,4 @@
{ container, ... } @args: let
{ container, pkgs, ... } @args: let
cfg = container.config.git;
in {
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 ];
services.gitea = {

View file

@ -1,5 +1,5 @@
# ISSUE: Broken, can't read/write sda device.
{ container, ... } @args: let
{ container, pkgs, ... } @args: let
cfg = container.config.hdd;
in {
systemd.tmpfiles.rules = container.mkContainerDir cfg [
@ -29,7 +29,7 @@ in {
# additionalCapabilities = [ "CAP_SYS_ADMIN" ];
config = { pkgs, ... }: container.mkContainerConfig cfg {
config = { ... }: container.mkContainerConfig cfg {
environment.systemPackages = with pkgs; [ smartmontools ];
services.scrutiny = {

View file

@ -49,7 +49,7 @@ in {
};
};
config = { pkgs, config, ... }: container.mkContainerConfig cfg {
config = { config, ... }: container.mkContainerConfig cfg {
imports = [
(builtins.fetchTarball {
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-${const.stateVersion}/nixos-mailserver-nixos-${const.stateVersion}.tar.gz";

View file

@ -17,7 +17,7 @@ in {
};
};
config = { lib, pkgs, ... }: container.mkContainerConfig cfg {
config = { lib, ... }: container.mkContainerConfig cfg {
environment.systemPackages = with pkgs; [ postgresql inetutils ];
services.paperless = {

View file

@ -1,5 +1,5 @@
# 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;
in {
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
script = pkgs.writeText "PhotoprocessScript" (util.trimTabs ''
source /data/Notify.sh

View file

@ -1,4 +1,4 @@
{ container, lib, ... } @args: let
{ container, lib, pkgs, ... } @args: let
cfg = container.config.postgres;
in {
systemd.tmpfiles.rules = container.mkContainerDir cfg [
@ -13,7 +13,7 @@ in {
};
};
config = { pkgs, ... }: container.mkContainerConfig cfg {
config = { ... }: container.mkContainerConfig cfg {
services.postgresql = let
# Populate with services here.
configurations = with container.config; {

View file

@ -1,4 +1,4 @@
{ domain, util, container, ... } @args: let
{ domain, util, container, pkgs, ... } @args: let
cfg = container.config.proxy;
virtualHosts = util.catSet (util.ls ./proxy/host) args;
in {
@ -31,7 +31,7 @@ in {
};
};
config = { pkgs, ... }: container.mkContainerConfig cfg {
config = { ... }: container.mkContainerConfig cfg {
environment.systemPackages = with pkgs; [ certbot ];
services.nginx = {

View file

@ -1,4 +1,4 @@
{ container, lib, ... } @args: let
{ container, lib, pkgs, ... } @args: let
cfg = container.config.read;
in {
systemd.tmpfiles.rules = container.mkContainerDir cfg [
@ -16,7 +16,7 @@ in {
// container.attachMedia "manga" cfg.manga true
;
config = { pkgs, ... }: container.mkContainerConfig cfg {
config = { ... }: container.mkContainerConfig cfg {
services.kavita = {
enable = true;
dataDir = "/var/lib/kavita";

View file

@ -1,8 +1,8 @@
{ container, ... } @args: let
{ container, pkgs, ... } @args: let
cfg = container.config.search;
in {
containers.search = container.mkContainer cfg {
config = { pkgs, ... }: container.mkContainerConfig cfg {
config = { ... }: container.mkContainerConfig cfg {
services.searx = {
enable = true;
package = pkgs.searxng;

View file

@ -1,4 +1,4 @@
{ container, ... } @args: let
{ container, pkgs, ... } @args: let
cfg = container.config.vpn;
in {
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 ];
networking.useNetworkd = true;
systemd.network = {

View file

@ -1,8 +1,8 @@
{ container, ... } @args: let
{ container, pkgs, ... } @args: let
cfg = container.config.yt;
in {
containers.yt = container.mkContainer cfg {
config = { pkgs, ... }: container.mkContainerConfig cfg {
config = { ... }: container.mkContainerConfig cfg {
services.invidious = {
enable = true;
domain = cfg.domain;

View file

@ -4,6 +4,7 @@
, storage
, domain
, media
, pkgs
, ... }: {
inherit host;
@ -15,10 +16,9 @@
};
mkContainerConfig = config: cfg: lib.recursiveUpdate cfg {
nixpkgs.pkgs = lib.mkForce pkgs;
system.stateVersion = const.stateVersion;
nixpkgs.config.allowUnfree = true;
users.users.root.password = "";
users.mutableUsers = false;