From 2abd5f2084b77b3d16ba7d78d069cde980d30b50 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Fri, 24 May 2024 23:11:36 +0200 Subject: [PATCH 1/2] Set to 24.05 stateVersion --- home/default.nix | 2 +- modules/system.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/home/default.nix b/home/default.nix index 4420680..fe30178 100644 --- a/home/default.nix +++ b/home/default.nix @@ -20,7 +20,7 @@ username = "florian"; homeDirectory = "/home/florian"; - stateVersion = "23.11"; + stateVersion = "24.05"; }; programs.home-manager.enable = true; diff --git a/modules/system.nix b/modules/system.nix index 8bf4d6e..47a6898 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -56,5 +56,5 @@ # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.11"; # Did you read the comment? + system.stateVersion = "24.05"; # Did you read the comment? } From f043d47382690dfdd024d6609e1ca19769db430a Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Fri, 24 May 2024 23:31:04 +0200 Subject: [PATCH 2/2] Add VM conf --- README.md | 25 +++++++++++++++++++++++++ hosts/nixos-test/default.nix | 10 ++++++++++ 2 files changed, 35 insertions(+) diff --git a/README.md b/README.md index 0032687..983ed12 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,31 @@ nixos-rebuild switch --flake flake_path_directory#hostname nix flake update --extra-experimental-features "nix-command flakes" ``` +## Configure VM + +Configure VM +```nix +users.users..initialPassword = ""; +virtualisation.vmVariant = { + # following configuration is added only when building VM with build-vm + virtualisation = { + memorySize = ; # Use 8192MiB memory. + cores = ; + # And more here https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/virtualisation/qemu-vm.nix + }; +}; +``` + +Build +```bash +nixos-rebuild build-vm --flake .#nixos-test +``` + +Run +```bash +./result/bin/run-nixos-vm-vm +``` + ## Show changements between revisions diff --git a/hosts/nixos-test/default.nix b/hosts/nixos-test/default.nix index 4f14e7f..2c68260 100644 --- a/hosts/nixos-test/default.nix +++ b/hosts/nixos-test/default.nix @@ -30,5 +30,15 @@ }; }; + # Configure for testing in vm + users.users.florian.initialPassword = "test"; + virtualisation.vmVariant = { + # following configuration is added only when building VM with build-vm + virtualisation = { + memorySize = 8192; # Use 8192MiB memory. + cores = 8; + }; + }; + networking.hostName = "nixos-vm"; # Define your hostname. }