diff --git a/configurations/nixos/tofu/configuration.nix b/configurations/nixos/tofu/configuration.nix index 07354af..c8dcd00 100644 --- a/configurations/nixos/tofu/configuration.nix +++ b/configurations/nixos/tofu/configuration.nix @@ -1,5 +1,6 @@ { config, pkgs, ... }: { + disko.devices.disk.main.device = "/dev/vda"; services.tty-ips.enable = true; networking.yggdrasil = { diff --git a/configurations/nixos/tofu/disko.nix b/configurations/nixos/tofu/disko.nix new file mode 100644 index 0000000..804896c --- /dev/null +++ b/configurations/nixos/tofu/disko.nix @@ -0,0 +1,47 @@ +{ + lib, + config, + ... +}: +{ + boot.loader.grub.efiSupport = lib.mkDefault true; + boot.loader.grub.efiInstallAsRemovable = lib.mkDefault true; + disko.devices = { + disk = { + "main" = { + # suffix is to prevent disk name collisions + name = "main-" + config.networking.hostName; + type = "disk"; + # device = ; + content = { + type = "gpt"; + partitions = { + "boot" = { + size = "1M"; + type = "EF02"; # for grub MBR + priority = 1; + }; + "ESP" = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "nofail" ]; + }; + }; + "root" = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/configurations/nixos/tofu/hardware-configuration.nix b/configurations/nixos/tofu/hardware-configuration.nix new file mode 100644 index 0000000..3876427 --- /dev/null +++ b/configurations/nixos/tofu/hardware-configuration.nix @@ -0,0 +1,36 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: + +{ + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "virtio_scsi" + "sr_mod" + "virtio_blk" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + # virtualisation.qemu.guestAgent.enable = true; + services.qemuGuest.enable = true; + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; + # networking.interfaces.tailscale0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/modules/nixos/common/disko.nix b/modules/nixos/common/disko.nix deleted file mode 100644 index 39caceb..0000000 --- a/modules/nixos/common/disko.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ - lib, - config, - ... -}: -{ - - # disko.devices.disk.main.device = "/dev/vda"; - options.internal.disko.default.enable = lib.mkEnableOption ""; - config = lib.mkIf config.internal.disko.enable { - boot.loader.grub.efiSupport = lib.mkDefault true; - boot.loader.grub.efiInstallAsRemovable = lib.mkDefault true; - disko.devices = { - disk = { - "main" = { - # suffix is to prevent disk name collisions - name = "main-" + config.networking.hostName; - type = "disk"; - # device = ; - content = { - type = "gpt"; - partitions = { - "boot" = { - size = "1M"; - type = "EF02"; # for grub MBR - priority = 1; - }; - "ESP" = { - size = "512M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ "nofail" ]; - }; - }; - "root" = { - size = "100%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - }; - }; - }; - }; - }; - }; -}