2023-12-01 11:51:55 +00:00
|
|
|
{ nixpkgs }:
|
|
|
|
name :
|
|
|
|
{ dualBoot ? false } :
|
|
|
|
let
|
|
|
|
lib = nixpkgs.lib;
|
2023-12-01 14:18:19 +00:00
|
|
|
configPath = ./machines/${name}.nix;
|
2023-12-01 15:04:29 +00:00
|
|
|
machineConfig =
|
|
|
|
if builtins.pathExists configPath then
|
|
|
|
configPath
|
|
|
|
else
|
|
|
|
./hardware/base.nix;
|
2023-12-01 11:51:55 +00:00
|
|
|
in
|
|
|
|
lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
(
|
2024-04-09 21:10:46 +00:00
|
|
|
{ config, pkgs, lib, ... }: {
|
2023-12-01 15:04:29 +00:00
|
|
|
imports = [
|
|
|
|
machineConfig
|
2023-12-01 11:51:55 +00:00
|
|
|
];
|
2024-04-06 21:43:37 +00:00
|
|
|
|
2024-04-09 21:10:19 +00:00
|
|
|
virtualisation =
|
|
|
|
let
|
|
|
|
config = {
|
2024-04-09 21:10:46 +00:00
|
|
|
boot.loader.efi.efiSysMountPoint = lib.mkVMOverride "/boot";
|
|
|
|
|
2024-04-09 21:10:19 +00:00
|
|
|
virtualisation.qemu.options = [
|
|
|
|
"-display sdl"
|
|
|
|
];
|
2024-04-09 21:08:20 +00:00
|
|
|
|
2024-04-09 21:10:19 +00:00
|
|
|
virtualisation.sharedDirectories = {
|
|
|
|
keys = {
|
|
|
|
source = "/etc/ssh";
|
|
|
|
target = "/etc/ssh";
|
|
|
|
};
|
|
|
|
};
|
2024-04-06 21:43:37 +00:00
|
|
|
};
|
2024-04-09 21:10:19 +00:00
|
|
|
in {
|
|
|
|
vmVariant = config;
|
|
|
|
vmVariantWithBootLoader = config;
|
2024-04-06 21:43:37 +00:00
|
|
|
};
|
2024-04-09 12:30:36 +00:00
|
|
|
|
|
|
|
# Networking
|
|
|
|
networking.hostName = name;
|
2023-12-01 11:51:55 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|