diff options
Diffstat (limited to 'hosts')
| -rw-r--r-- | hosts/default.nix | 8 | ||||
| -rw-r--r-- | hosts/utm/configuration.nix | 48 | ||||
| -rw-r--r-- | hosts/utm/default.nix | 27 | ||||
| -rw-r--r-- | hosts/utm/hardware-configuration.nix | 21 |
4 files changed, 103 insertions, 1 deletions
diff --git a/hosts/default.nix b/hosts/default.nix index 9cf3550..6c7a864 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -42,6 +42,10 @@ minimalOptions = { inherit commonModules; } // commonInherits; + + macInherits = { + inherit inputs kansaiPkgs self; + }; in [ (import ./akashi pcOptions) @@ -49,6 +53,8 @@ (import ./hoka minimalOptions) (import ./kansai pcOptions) (import ./kioku minimalOptions) - (import ./nara { inherit inputs kansaiPkgs self; }) + (import ./nara macInherits) + + (import ./utm (macInherits // { inherit lib; })) ]; } diff --git a/hosts/utm/configuration.nix b/hosts/utm/configuration.nix new file mode 100644 index 0000000..b355e05 --- /dev/null +++ b/hosts/utm/configuration.nix @@ -0,0 +1,48 @@ +{ + modulesPath, + lib, + pkgs, + ... +}: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + disko.devices.disk.disk1.device = "/dev/vda"; + + boot.loader.grub = { + efiSupport = true; + efiInstallAsRemovable = true; + }; + + environment.systemPackages = + with pkgs; + map lib.lowPrio [ + curl + gitMinimal + ]; + + virtualisation.rosetta.enable = true; + networking.hostName = "utm-vm-nixos-builder"; + + services = { + openssh.enable = true; + + avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + + publish = { + enable = true; + userServices = true; + addresses = true; + }; + }; + }; + + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOeo/QyAKaDxiRah+Drf91P7jvw3uB3S28GlzrwHuE8k" + ]; + + system.stateVersion = "24.11"; +} diff --git a/hosts/utm/default.nix b/hosts/utm/default.nix new file mode 100644 index 0000000..8d6aaaa --- /dev/null +++ b/hosts/utm/default.nix @@ -0,0 +1,27 @@ +{ + inputs, + kansaiPkgs, + self, + lib, + ... +}: +let + pkgs = + (kansaiPkgs { + nixpkgsExtraConfig = { + allowUnsupportedSystem = true; + }; + })."aarch64-linux"; +in +{ + flake.nixosConfigurations.utm = lib.nixosSystem { + inherit pkgs; + + modules = with inputs; [ + ./configuration.nix + ./hardware-configuration.nix + "${self}/disks/utm.nix" + disko.nixosModules.disko + ]; + }; +} diff --git a/hosts/utm/hardware-configuration.nix b/hosts/utm/hardware-configuration.nix new file mode 100644 index 0000000..d34d94e --- /dev/null +++ b/hosts/utm/hardware-configuration.nix @@ -0,0 +1,21 @@ +{ lib, ... }: +{ + boot = { + initrd = { + availableKernelModules = [ + "virtio_pci" + "xhci_pci" + "usb_storage" + "usbhid" + ]; + + kernelModules = [ ]; + }; + + kernelModules = [ ]; + extraModulePackages = [ ]; + }; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +} |