mirror of
https://github.com/hyprwm/hyprland-infra.git
synced 2025-05-13 05:40:39 +01:00
hosts/caesar: initial networking config; separate virt
This commit is contained in:
parent
7bf5168b53
commit
7599920aad
2 changed files with 43 additions and 31 deletions
|
@ -1,17 +1,16 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/virtualisation/qemu-vm.nix")
|
||||
];
|
||||
|
||||
}: let
|
||||
inherit (lib.modules) mkForce;
|
||||
inherit (lib.meta) getExe;
|
||||
in {
|
||||
imports = [./virt.nix];
|
||||
config = {
|
||||
zramSwap.enable = lib.mkForce false;
|
||||
services.thermald.enable = lib.mkForce false;
|
||||
zramSwap.enable = mkForce false;
|
||||
services.thermald.enable = mkForce false;
|
||||
|
||||
boot = {
|
||||
initrd.supportedFilesystems = ["ext4"];
|
||||
|
@ -23,31 +22,10 @@
|
|||
enable = true;
|
||||
enableCompletion = true;
|
||||
promptInit = ''
|
||||
eval "$(${lib.getExe pkgs.starship} init zsh)"
|
||||
eval "$(${getExe pkgs.starship} init zsh)"
|
||||
'';
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
memorySize = 8000;
|
||||
diskSize = 200000;
|
||||
cores = 8;
|
||||
|
||||
# fs
|
||||
useDefaultFilesystems = false;
|
||||
rootDevice = "/dev/disk/by-label/NIXOS_ROOT";
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "${config.virtualisation.rootDevice}";
|
||||
fsType = "xfs";
|
||||
};
|
||||
};
|
||||
|
||||
interfaces = {
|
||||
vm0.vlan = 1;
|
||||
};
|
||||
};
|
||||
|
||||
boot.initrd.preLVMCommands = with pkgs; ''
|
||||
if ! test -b /dev/vda2; then
|
||||
${pkgs.parted}/bin/parted --script /dev/vda -- mklabel msdos
|
||||
|
|
34
hosts/caesar/virt.nix
Normal file
34
hosts/caesar/virt.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
config,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [(modulesPath + "/virtualisation/qemu-vm.nix")];
|
||||
|
||||
virtualisation = {
|
||||
memorySize = 8000;
|
||||
diskSize = 200000;
|
||||
cores = 8;
|
||||
|
||||
# fs
|
||||
useDefaultFilesystems = false;
|
||||
rootDevice = "/dev/disk/by-label/NIXOS_ROOT";
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "${config.virtualisation.rootDevice}";
|
||||
fsType = "xfs";
|
||||
};
|
||||
};
|
||||
|
||||
interfaces = {
|
||||
vm0.vlan = 1;
|
||||
};
|
||||
|
||||
qemu.networkingOptions = [
|
||||
"-net nic,netdev=user.0,model=virtio"
|
||||
"-netdev user,id=user.0,\${QEMU_NET_OPTS:+,$QEMU_NET_OPTS}"
|
||||
"hostfwd=tcp::2222-:2222"
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue