From f7943d981bb1e9c5e53f1eacee908646f9c0808f Mon Sep 17 00:00:00 2001 From: ahtlon Date: Sat, 25 Jan 2025 01:21:05 +0100 Subject: [PATCH 1/5] [nextcloud] add some attributes --- machines/nextcloud/configuration.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/machines/nextcloud/configuration.nix b/machines/nextcloud/configuration.nix index eea2e2d..e577bdd 100644 --- a/machines/nextcloud/configuration.nix +++ b/machines/nextcloud/configuration.nix @@ -55,6 +55,12 @@ with lib; }; settings = { trusted_domains = ["10.0.0.13"]; + "maintenance_window_start" = "1"; + "default_phone_region" = "DE"; + }; + phpOptions = { + "realpath_cache_size" = "0"; + "opcache.interned_strings_buffer" = "23"; }; }; -- 2.51.2 From e94410ca54281a41b0d48cd82634d9560917cf03 Mon Sep 17 00:00:00 2001 From: ahtlon Date: Tue, 28 Jan 2025 12:19:53 +0100 Subject: [PATCH 2/5] Fix #67 --- machines/nextcloud/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/machines/nextcloud/configuration.nix b/machines/nextcloud/configuration.nix index e577bdd..a2cacdf 100644 --- a/machines/nextcloud/configuration.nix +++ b/machines/nextcloud/configuration.nix @@ -37,6 +37,7 @@ with lib; hostName = "cloud.malobeo.org"; config.adminpassFile = config.sops.secrets.nextcloudAdminPass.path; #https = true; #disable for testing + datadir = "/data/services/nextcloud/"; database.createLocally = true; config.dbtype = "pgsql"; configureRedis = true; -- 2.51.2 From 67399b462da5f0a6d71256e56efb136c11e70874 Mon Sep 17 00:00:00 2001 From: ahtlon Date: Thu, 6 Feb 2025 15:40:25 +0100 Subject: [PATCH 3/5] Add microvm data dirs (untested because virtiofs mounts currently dont work) --- .gitignore | 1 + machines/fanny/configuration.nix | 5 +++++ machines/modules/disko/default.nix | 4 ++++ machines/modules/host_builder.nix | 7 +++++++ 4 files changed, 17 insertions(+) diff --git a/.gitignore b/.gitignore index a2fa571..8bea5d2 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ result .direnv/ book/ fanny-efi-vars.fd +nix-store-overlay.img diff --git a/machines/fanny/configuration.nix b/machines/fanny/configuration.nix index 1d16e76..f862630 100644 --- a/machines/fanny/configuration.nix +++ b/machines/fanny/configuration.nix @@ -56,6 +56,11 @@ in }; }; + systemd.tmpfiles.rules = [ + "L /var/lib/microvms/data - - - - /data/microvms" + "d /data/microvms 0755 root root" #not needed for real host? + ]; + malobeo.initssh = { enable = true; authorizedKeys = sshKeys.admins; diff --git a/machines/modules/disko/default.nix b/machines/modules/disko/default.nix index 6174bf3..9ffd02c 100644 --- a/machines/modules/disko/default.nix +++ b/machines/modules/disko/default.nix @@ -252,6 +252,10 @@ in type = "zfs_fs"; mountpoint = "/data"; }; + "encrypted/data/microvm" = { + type = "zfs_fs"; + mountpoint = "/data/microvm"; + }; reserved = { # for cow delete if pool is full options = { diff --git a/machines/modules/host_builder.nix b/machines/modules/host_builder.nix index 772ce49..c75f6f0 100644 --- a/machines/modules/host_builder.nix +++ b/machines/modules/host_builder.nix @@ -70,6 +70,13 @@ rec { proto = "virtiofs"; socket = "var.socket"; } + { + source = "/var/lib/microvms/data/${hostName}"; + mountPoint = "/data"; + tag = "data"; + proto = "virtiofs"; + socket = "microdata.socket"; + } ]; interfaces = [ -- 2.51.2 From 46ed793529c4c9d2e45ac5a198c69fa36fa7d000 Mon Sep 17 00:00:00 2001 From: kalipso Date: Thu, 6 Feb 2025 17:36:25 +0100 Subject: [PATCH 4/5] [disko] no encrypted swap when encryption disabled --- machines/modules/disko/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/machines/modules/disko/default.nix b/machines/modules/disko/default.nix index 9ffd02c..e8770f6 100644 --- a/machines/modules/disko/default.nix +++ b/machines/modules/disko/default.nix @@ -102,7 +102,7 @@ in mountOptions = [ "umask=0077" ]; }; }; - encryptedSwap = { + encryptedSwap = lib.mkIf cfg.encryption { size = cfg.root.swap; content = { type = "swap"; -- 2.51.2 From 9f62e03d954b5cca684aa7fe8d7603fd3fabb78b Mon Sep 17 00:00:00 2001 From: kalipso Date: Thu, 6 Feb 2025 17:37:00 +0100 Subject: [PATCH 5/5] [fanny] more ram and cores for vmVariantWithDisko --- machines/fanny/configuration.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/machines/fanny/configuration.nix b/machines/fanny/configuration.nix index f862630..e94896b 100644 --- a/machines/fanny/configuration.nix +++ b/machines/fanny/configuration.nix @@ -20,6 +20,13 @@ in inputs.self.nixosModules.malobeo.metrics ]; + virtualisation.vmVariantWithDisko = { + virtualisation = { + memorySize = 4096; + cores = 3; + }; + }; + malobeo.metrics = { enable = true; enablePromtail = true; -- 2.51.2