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

43 lines
1.2 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
# For cross-architecture builds
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
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-17 13:51:17 +02:00
# Generic Tailscale configs are in /nixos/common/services/tailscale.nix
# Set up the secrets file:
sops.secrets.nixos-vm-01_tailscale_key = {
owner = "root";
sopsFile = ../../../secrets/tailscale.yaml;
restartUnits = [
"tailscaled.service"
"tailscaled-autoconnect.service"
];
};
services.tailscale.authKeyFile = "/run/secrets/nixos-vm-01_tailscale_key";
2023-09-17 13:04:23 +02:00
networking.firewall.allowedTCPPorts = [ 22 ];
2023-09-17 12:07:48 +02:00
}