about summary refs log tree commit diff stats
path: root/modules/by-name/di/disks/module.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/by-name/di/disks/module.nix34
1 files changed, 30 insertions, 4 deletions
diff --git a/modules/by-name/di/disks/module.nix b/modules/by-name/di/disks/module.nix
index c0e5bcfd..3e9d4614 100644
--- a/modules/by-name/di/disks/module.nix
+++ b/modules/by-name/di/disks/module.nix
@@ -1,13 +1,23 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 {
   config,
   lib,
   pkgs,
+  modules,
   ...
 }: let
   # FIXME: The iso redeploy requires a bigger efi partition  <2024-05-12>
   cfg = config.soispha.disks;
   defaultMountOptions = [
-    "compress-force=zstd:15" # This saves disk space, at a performance cost
+    "compress=zstd:3" # This saves disk space, at a performance cost
     "noatime" # should have some performance upsides, and I don't use it anyways
     "lazytime" # make time changes in memory
   ];
@@ -37,6 +47,10 @@ in {
     };
   };
 
+  imports = [
+    modules.disko.nixosModules.default
+  ];
+
   config = lib.mkIf cfg.enable {
     systemd = lib.recursiveUpdate (import ./hibernate.nix {inherit pkgs;}) (import ./fstrim.nix {inherit pkgs lib cfg;});
 
@@ -72,7 +86,10 @@ in {
                       };
                       "swap" = {
                         mountpoint = "/swap";
-                        mountOptions = defaultMountOptions;
+                        mountOptions = [
+                          "noatime" # should have some performance upsides, and I don't use it anyways
+                          "lazytime" # make time changes in memory
+                        ];
                       };
                     };
                   };
@@ -95,11 +112,20 @@ in {
       nodev = {
         "/" = {
           fsType = "tmpfs";
-          mountOptions = ["defaults" "size=4G" "mode=755"];
+          mountOptions = ["defaults" "size=25%" "mode=0755"];
         };
         "/tmp" = {
           fsType = "tmpfs";
-          mountOptions = ["defaults" "size=16G" "mode=755"];
+          mountOptions = ["defaults" "size=50%" "mode=0755"];
+        };
+        "/nix/var/nix/b" = {
+          fsType = "tmpfs";
+          mountOptions = [
+            "defaults"
+            "noswap" # Otherwise, we might run into io-based slowdowns
+            "size=80%"
+            "mode=0755"
+          ];
         };
       };
     };