From 750dd941b9098b3309b132d60d4afc5bc656fbc1 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Tue, 30 Jul 2024 20:06:32 +0200 Subject: [PATCH] test-vm: Add host `test-vm` --- .gitignore | 2 ++ flake.nix | 6 ++++++ hosts/test-vm/configuration.nix | 31 +++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 .gitignore create mode 100644 hosts/test-vm/configuration.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0214a90 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.qcow2 +result \ No newline at end of file diff --git a/flake.nix b/flake.nix index 5fbf834..dc85815 100644 --- a/flake.nix +++ b/flake.nix @@ -68,6 +68,12 @@ ./hosts/tadpole/home.nix ]; }; + + test-vm = inputs.nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ ./hosts/test-vm/configuration.nix ]; + }; }; }; } diff --git a/hosts/test-vm/configuration.nix b/hosts/test-vm/configuration.nix new file mode 100644 index 0000000..d6c5e2c --- /dev/null +++ b/hosts/test-vm/configuration.nix @@ -0,0 +1,31 @@ +{ pkgs, ... }: +{ + imports = []; + + config = { + boot.kernelPackages = pkgs.linuxPackages_latest; + + networking.hostName = "test-vm"; + + mod = {}; + + users.users.a = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + password = "a"; + }; + + virtualisation.vmVariant = { + # following configuration is added only when building VM with build-vm + virtualisation = { + memorySize = 2048; + cores = 3; + graphics = false; + }; + }; + + environment.systemPackages = []; + + system.stateVersion = "24.05"; + }; +}