nix/nixos/hosts/nixos-vm-01/default.nix

55 lines
1.5 KiB
Nix
Raw Normal View History

2023-09-17 12:07:48 +02:00
{ config, lib, pkgs, modulesPath, desktop, username, ... }: {
imports = [ ];
nixpkgs.config.allowUnfree = false;
boot.initrd.availableKernelModules = [ "ata_piix" "ohci_pci" "ehci_pci" "ahci" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
2023-09-18 09:46:41 +02:00
2023-10-07 10:47:18 +02:00
# Testing remote builldings
2023-10-07 10:58:22 +02:00
users.users.${username}.openssh.authorizedKeys.keyFiles = [ ../../../keys/ssh/builder-keys.txt ];
2023-10-07 10:47:18 +02:00
2023-09-18 09:46:41 +02:00
# For cross-architecture builds
2023-09-19 03:54:33 +02:00
boot.binfmt.emulatedSystems = [
"aarch64-linux"
2023-12-14 12:54:46 +01:00
"armv7l-linux"
2023-09-19 03:54:33 +02:00
];
2023-09-17 12:07:48 +02:00
2023-09-21 12:44:23 +02:00
environment.systemPackages = with pkgs; [
# Currently used for building the Linode image
qemu_kvm
2023-12-14 12:05:41 +01:00
binutils.bintools
2023-09-21 12:44:23 +02:00
];
2023-09-17 12:07:48 +02:00
fileSystems."/" = {
device = "/dev/disk/by-label/ROOT";
fsType = "ext4";
};
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
virtualisation.virtualbox.guest.enable = true;
time.timeZone = "Asia/Tokyo";
networking.hostName = "nixos-vm-01";
2023-09-17 12:54:51 +02:00
2023-09-17 12:56:45 +02:00
boot.loader.grub = {
enable = true;
device = "/dev/sda";
useOSProber = true;
};
2023-09-17 13:04:23 +02:00
2023-09-18 12:09:51 +02:00
# Generic Tailscale configs are in /nixos/common/services/tailscale.nix
2023-09-17 13:51:17 +02:00
# Set up the secrets file:
2023-09-18 13:54:09 +02:00
sops.secrets."tailscale_keys/nixos-vm-01" = {
2023-09-17 13:51:17 +02:00
owner = "root";
sopsFile = ../../../secrets/tailscale.yaml;
2023-09-18 12:09:51 +02:00
restartUnits = [
2023-09-17 13:51:17 +02:00
"tailscaled.service"
"tailscaled-autoconnect.service"
];
};
2023-09-18 13:49:11 +02:00
services.tailscale.authKeyFile = "/run/secrets/tailscale_keys/nixos-vm-01";
2023-09-18 12:09:51 +02:00
# networking.firewall.allowedTCPPorts = [ 22 ];
2023-09-17 12:07:48 +02:00
}