summary refs log tree commit diff
path: root/hosts/vm
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/vm')
-rw-r--r--hosts/vm/cfg.nix63
1 files changed, 57 insertions, 6 deletions
diff --git a/hosts/vm/cfg.nix b/hosts/vm/cfg.nix
index 1b17ea6..30f55a7 100644
--- a/hosts/vm/cfg.nix
+++ b/hosts/vm/cfg.nix
@@ -1,17 +1,68 @@
-{config}: {
+{config, lib, pkgs, ...}: {
   imports = [
-    "../profiles/core.nix"
-    "../profiles/user.nix"
-    "../mixins/tailscale.nix"
-  ]
+    ../../profiles/core.nix
+    ../../profiles/user.nix
+    ../../profiles/ssh.nix
+    ../../profiles/graphical.nix
+    ../../mixins/tailscale.nix
+    ../../mixins/cli.nix
+    ../../mixins/greet.nix
+    ../../mixins/sway.nix
+  ];
 
   config = {
+    networking.hostName = "vm";
     boot.supportedFilesystems = ["9p"];
     fileSystems."/flake" = {
       fsType = "9p";
       device = "host0";
       options = ["_netdev"];
     };
-    boot.kernelParams = [ "console=ttyS0" ];
+    boot = {
+      initrd = {
+        supportedFilesystems = ["btrfs"];
+      };
+      kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
+      kernelParams = [
+        "console=ttyS0"
+        "init_on_free=1"
+        "page_poison=1"
+        "page_alloc.shuffle=1"
+        "slab_nomerge"
+        "vsyscall=none"
+      ];
+      cleanTmpDir = true;
+      loader = {
+        systemd-boot = {
+          enable = true;
+        };
+        efi = {
+          canTouchEfiVariables = true;
+          efiSysMountPoint = "/boot";
+        };
+      };
+    };
+
+    time.timeZone = lib.mkDefault "Israel";
+
+    fileSystems = {
+      "/" = {
+        device = "none";
+        fsType = "tmpfs";
+        options = ["noexec" "defaults" "size=2G" "mode=755"];
+      };
+      "/nix" = {
+        device = "/dev/disk/by-partlabel/nix";
+        options = ["noatime" "compress=zstd"];
+      };
+      "/boot" = {
+        device = "/dev/disk/by-partlabel/boot";
+      };
+    };
+
+    zramSwap = {
+      enable = true;
+      algorithm = "zstd";
+    };
   };
 }
\ No newline at end of file