From f51f8e398fffe33dcbb4b9f9db95708e7a3dde82 Mon Sep 17 00:00:00 2001 From: tzlil Date: Tue, 13 Dec 2022 15:21:30 +0200 Subject: stuff --- hosts/vm/cfg.nix | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 6 deletions(-) (limited to 'hosts/vm/cfg.nix') 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 -- cgit 1.4.1