first commit
This commit is contained in:
44
hosts/test-kvm/default.nix
Normal file
44
hosts/test-kvm/default.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
pkgs,
|
||||
username,
|
||||
hostname,
|
||||
modulesPath,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
in
|
||||
{
|
||||
imports = builtins.trace "${inputs.mysecrets}" [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
./disk-config.nix
|
||||
./hardware-configuration.nix
|
||||
../../modules/core
|
||||
../../modules/optionnal/hosts/${hostname}.nix
|
||||
];
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
time.timeZone = "Europe/Paris";
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
## Enable flakes
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
## Users trusted to use flake command
|
||||
trusted-users = [
|
||||
"root"
|
||||
"${username}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
services.openssh.enable = true;
|
||||
|
||||
networking.hostName = "${hostname}";
|
||||
|
||||
system.stateVersion = "25.11";
|
||||
}
|
||||
36
hosts/test-kvm/disk-config.nix
Normal file
36
hosts/test-kvm/disk-config.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/vda";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
type = "8300";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "btrfs";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
29
hosts/test-kvm/hardware-configuration.nix
Normal file
29
hosts/test-kvm/hardware-configuration.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ahci"
|
||||
"xhci_pci"
|
||||
"virtio_pci"
|
||||
"sr_mod"
|
||||
"virtio_blk"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
Reference in New Issue
Block a user