From c3413cbe847e4e972d40505e671a32d01ab44300 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 17 Sep 2025 03:30:25 +0200 Subject: [PATCH 1/7] Add host `vm` --- hosts/default.nix | 3 +++ hosts/vm/configuration.nix | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 hosts/vm/configuration.nix diff --git a/hosts/default.nix b/hosts/default.nix index 357302f..f50aaec 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -29,4 +29,7 @@ in hardware.framework-16-7040-amd ]; }; + vm = { + system = "x86_64-linux"; + }; } diff --git a/hosts/vm/configuration.nix b/hosts/vm/configuration.nix new file mode 100644 index 0000000..22430f1 --- /dev/null +++ b/hosts/vm/configuration.nix @@ -0,0 +1,24 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + htop + ]; + + boot = { + loader.grub.devices = [ "/dev/vda" ]; + initrd = { + enable = true; + systemd.enable = true; + }; + }; + + services.getty.autologinUser = "root"; + + fileSystems."/" = { + fsType = "tmpfs"; + options = [ "mode=0755" ]; + }; + + system.stateVersion = "25.05"; +} From efb3ac119e93d3bdd7e56a5ad1fdaca04b07dffa Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 17 Sep 2025 20:23:22 +0200 Subject: [PATCH 2/7] Add mount for /nix --- hosts/vm/configuration.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hosts/vm/configuration.nix b/hosts/vm/configuration.nix index 22430f1..7b77541 100644 --- a/hosts/vm/configuration.nix +++ b/hosts/vm/configuration.nix @@ -17,7 +17,12 @@ fileSystems."/" = { fsType = "tmpfs"; - options = [ "mode=0755" ]; + }; + + fileSystems."/nix" = { + fsType = "btrfs"; + device = "/dev/vda2"; + options = [ "nodev,noatime,compress-force=zstd:1,discard=async" ]; }; system.stateVersion = "25.05"; From 864cd65fa5de9e85d7ac1e18ab5a4069d3133d0d Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Thu, 9 Oct 2025 13:45:10 +0200 Subject: [PATCH 3/7] Revert "Add mount for /nix" This reverts commit efb3ac119e93d3bdd7e56a5ad1fdaca04b07dffa. --- hosts/vm/configuration.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hosts/vm/configuration.nix b/hosts/vm/configuration.nix index 7b77541..22430f1 100644 --- a/hosts/vm/configuration.nix +++ b/hosts/vm/configuration.nix @@ -17,12 +17,7 @@ fileSystems."/" = { fsType = "tmpfs"; - }; - - fileSystems."/nix" = { - fsType = "btrfs"; - device = "/dev/vda2"; - options = [ "nodev,noatime,compress-force=zstd:1,discard=async" ]; + options = [ "mode=0755" ]; }; system.stateVersion = "25.05"; From a5e6f5dd7cc7cca14fede8acd764a1c58fef3773 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Thu, 9 Oct 2025 13:46:15 +0200 Subject: [PATCH 4/7] Add user `jalr` --- hosts/vm/configuration.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hosts/vm/configuration.nix b/hosts/vm/configuration.nix index 22430f1..fb1d7eb 100644 --- a/hosts/vm/configuration.nix +++ b/hosts/vm/configuration.nix @@ -1,5 +1,10 @@ { pkgs, ... }: +let + sshKeys = { + jalr = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH3l+Yixrsjhze20CSjvUK4Qj/BNqbTNitgk20vuzPej cardno:25_750_479" ]; + }; +in { environment.systemPackages = with pkgs; [ htop @@ -20,5 +25,16 @@ options = [ "mode=0755" ]; }; + services.openssh.enable = true; + users.users = { + jalr = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + openssh.authorizedKeys.keys = sshKeys.jalr; + }; + root.openssh.authorizedKeys.keys = sshKeys.jalr; + }; + security.sudo.wheelNeedsPassword = false; + system.stateVersion = "25.05"; } From c0845067ef6fec1b168dc12c79fa7067d3a98e42 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Thu, 9 Oct 2025 14:03:56 +0200 Subject: [PATCH 5/7] Remove bootloader --- hosts/vm/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/vm/configuration.nix b/hosts/vm/configuration.nix index fb1d7eb..19a942f 100644 --- a/hosts/vm/configuration.nix +++ b/hosts/vm/configuration.nix @@ -11,7 +11,7 @@ in ]; boot = { - loader.grub.devices = [ "/dev/vda" ]; + loader.grub.enable = false; initrd = { enable = true; systemd.enable = true; From 8aa655b7e5275c40d32bc957e947efe0030f79d6 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Fri, 10 Oct 2025 11:01:25 +0200 Subject: [PATCH 6/7] Add targetHost --- hosts/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/default.nix b/hosts/default.nix index f50aaec..b80d9a5 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -31,5 +31,6 @@ in }; vm = { system = "x86_64-linux"; + targetHost = "192.168.122.110"; }; } From afc57dd0f7e0c7d3fb645bfbf01e8d9c60d3b0fc Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Mon, 20 Oct 2025 12:09:52 +0200 Subject: [PATCH 7/7] Add gnome --- hosts/vm/configuration.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/hosts/vm/configuration.nix b/hosts/vm/configuration.nix index 19a942f..a2ba66e 100644 --- a/hosts/vm/configuration.nix +++ b/hosts/vm/configuration.nix @@ -36,5 +36,23 @@ in }; security.sudo.wheelNeedsPassword = false; + + services.xserver = { + enable = true; + desktopManager.gnome.enable = true; + displayManager = { + autoLogin = { + enable = true; + user = "jalr"; + }; + gdm = { + autoSuspend = false; + enable = true; + wayland = true; + }; + }; + exportConfiguration = true; + }; + system.stateVersion = "25.05"; }