From 87be0d3dd54e71f33b9d8a757273ae4f2170e3f0 Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 18 Jan 2026 21:17:14 -0600 Subject: Multiple configs --- hosts/hyper-v/configuration.nix | 34 ++++++++++++++++++++++++++++++++ hosts/hyper-v/hardware-configuration.nix | 31 +++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 hosts/hyper-v/configuration.nix create mode 100644 hosts/hyper-v/hardware-configuration.nix (limited to 'hosts/hyper-v') diff --git a/hosts/hyper-v/configuration.nix b/hosts/hyper-v/configuration.nix new file mode 100644 index 0000000..f7bc699 --- /dev/null +++ b/hosts/hyper-v/configuration.nix @@ -0,0 +1,34 @@ +{config, lib, pkgs, inputs, ...}: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../modules/common.nix + ]; + + networking.hostName = "hyper-v"; + + + # Hyper-V setup + virtualisation.hypervGuest.enable = true; + services.xrdp.enable = true; + services.xrdp.defaultWindowManager = "xmonad"; + + systemd.services.xrdp.serviceConfig = { + # Remove the --port in the invokation of xrdp (it overwrites the option in the config) + ExecStart = lib.mkForce "${pkgs.xrdp}/bin/xrdp --nodaemon --config ${config.services.xrdp.confDir}/xrdp.ini"; + }; + + services.xrdp.extraConfDirCommands = '' + substituteInPlace $out/xrdp.ini \ + --replace-fail "port=3389" "port=vsock://-1:3389" \ + --replace-fail "#vmconnect=true" "vmconnect=true" \ + --replace-fail "security_layer=negotiate" "security_layer=rdp" \ + --replace-fail "crypt_level=high" "crypt_level=none" \ + ''; + + services.xserver.displayManager.lightdm.enable = false; + + system.stateVersion = "25.11"; +} diff --git a/hosts/hyper-v/hardware-configuration.nix b/hosts/hyper-v/hardware-configuration.nix new file mode 100644 index 0000000..0417079 --- /dev/null +++ b/hosts/hyper-v/hardware-configuration.nix @@ -0,0 +1,31 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = [ ]; + + boot.initrd.availableKernelModules = [ "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/11857814-2a7a-4aaa-82bd-7ecea40117d3"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/1FB1-AF5C"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/5cfd31ff-439c-4829-b575-92ea76bec3c4"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + virtualisation.hypervGuest.enable = true; +} -- cgit v1.2.3