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;
|
||||
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;
|
||||
|
|
|
@ -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
|
||||
];
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -17,7 +17,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
config = { lib, pkgs, ... }: container.mkContainerConfig cfg {
|
||||
config = { lib, ... }: container.mkContainerConfig cfg {
|
||||
environment.systemPackages = with pkgs; [ postgresql inetutils ];
|
||||
|
||||
services.paperless = {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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; {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue