From feefcfc89b00d4955dbb3314c20be035f3db206f Mon Sep 17 00:00:00 2001 From: tzlil Date: Sat, 29 Jul 2023 20:53:14 +0300 Subject: disko for laptop, wip rewrite --- hosts/vm/cfg.nix | 92 ---------------------------------------------------- hosts/vm/default.nix | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 92 deletions(-) delete mode 100644 hosts/vm/cfg.nix create mode 100644 hosts/vm/default.nix (limited to 'hosts/vm') diff --git a/hosts/vm/cfg.nix b/hosts/vm/cfg.nix deleted file mode 100644 index 99ed8b9..0000000 --- a/hosts/vm/cfg.nix +++ /dev/null @@ -1,92 +0,0 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - ../../profiles/core.nix - ../../profiles/user.nix - ../../profiles/ssh.nix - ../../profiles/graphical.nix - ../../mixins/tailscale.nix - ../../mixins/cli.nix - ../../mixins/greet.nix - ../../mixins/pipewire.nix - # ../../mixins/hyprland.nix - ../../mixins/sway.nix - # (modulesPath + "/profiles/qemu-guest.nix") - # (modulesPath + "/virtualisation/qemu-vm.nix") - ]; - - config = { - _module.args.nixinate = { - host = "vm"; - sshUser = "tzlil"; - buildOn = "remote"; # valid args are "local" or "remote" - substituteOnTarget = true; # if buildOn is "local" then it will substitute on the target, "-s" - hermetic = false; - }; - networking.hostName = "vm"; - - # dont do this - users.users.root.initialPassword = "hunter2"; - - boot.supportedFilesystems = ["9p"]; - boot = { - initrd = { - supportedFilesystems = ["btrfs"]; - availableKernelModules = ["ata_piix" "uhci_hcd" "floppy" "sd_mod" "sr_mod"]; - }; - kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; - kernelParams = [ - "console=ttyS0" - ]; - 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"; - }; - - hardware.opengl = { - enable = true; - extraPackages = with pkgs; [rocm-opencl-icd rocm-opencl-runtime]; - driSupport = true; - driSupport32Bit = true; - }; - - greeter.initialSession = "env WLR_RENDERER=pixman ${pkgs.sway.out}/bin/sway"; - # home-manager.users.tzlil.wayland.windowManager.sway.config.input."type:keyboard".xkb_variant = lib.mkForce ""; - - # nice to work with - security.sudo.wheelNeedsPassword = false; - }; -} diff --git a/hosts/vm/default.nix b/hosts/vm/default.nix new file mode 100644 index 0000000..99ed8b9 --- /dev/null +++ b/hosts/vm/default.nix @@ -0,0 +1,92 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + ../../profiles/core.nix + ../../profiles/user.nix + ../../profiles/ssh.nix + ../../profiles/graphical.nix + ../../mixins/tailscale.nix + ../../mixins/cli.nix + ../../mixins/greet.nix + ../../mixins/pipewire.nix + # ../../mixins/hyprland.nix + ../../mixins/sway.nix + # (modulesPath + "/profiles/qemu-guest.nix") + # (modulesPath + "/virtualisation/qemu-vm.nix") + ]; + + config = { + _module.args.nixinate = { + host = "vm"; + sshUser = "tzlil"; + buildOn = "remote"; # valid args are "local" or "remote" + substituteOnTarget = true; # if buildOn is "local" then it will substitute on the target, "-s" + hermetic = false; + }; + networking.hostName = "vm"; + + # dont do this + users.users.root.initialPassword = "hunter2"; + + boot.supportedFilesystems = ["9p"]; + boot = { + initrd = { + supportedFilesystems = ["btrfs"]; + availableKernelModules = ["ata_piix" "uhci_hcd" "floppy" "sd_mod" "sr_mod"]; + }; + kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; + kernelParams = [ + "console=ttyS0" + ]; + 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"; + }; + + hardware.opengl = { + enable = true; + extraPackages = with pkgs; [rocm-opencl-icd rocm-opencl-runtime]; + driSupport = true; + driSupport32Bit = true; + }; + + greeter.initialSession = "env WLR_RENDERER=pixman ${pkgs.sway.out}/bin/sway"; + # home-manager.users.tzlil.wayland.windowManager.sway.config.input."type:keyboard".xkb_variant = lib.mkForce ""; + + # nice to work with + security.sudo.wheelNeedsPassword = false; + }; +} -- cgit 1.4.1