summary refs log tree commit diff
path: root/hosts
diff options
context:
space:
mode:
authortzlil <tzlils@protonmail.com>2022-12-13 15:21:30 +0200
committertzlil <tzlils@protonmail.com>2022-12-13 15:21:30 +0200
commitf51f8e398fffe33dcbb4b9f9db95708e7a3dde82 (patch)
tree08a9c853a29b01c53be526aecc8d2505f5086af5 /hosts
parent24637dfdfdd6dc8d116542f16a07d808c9e43c36 (diff)
stuff
Diffstat (limited to 'hosts')
-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