Skip to content

Commit 4394c12

Browse files
committed
Working on a built-in test virtual machine
1 parent 2ae5250 commit 4394c12

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

flake.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,18 @@
88
let pkgs = import nixpkgs { inherit system; };
99
in
1010
{ packages.default = pkgs.callPackage ./default.nix {};
11+
packages.vm = self.nixosConfigurations.testbox.config.system.build.vm;
12+
13+
nixosConfigurations."testbox" =
14+
nixpkgs.lib.nixosSystem {
15+
inherit system;
16+
modules = [
17+
./vm.nix
18+
{ nixpkgs.overlays = [
19+
(self: super: { paperwm = self.packages.${system}.default; })
20+
];
21+
}
22+
];
23+
};
1124
});
1225
}

vm.nix

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{ pkgs, config, lib, ... }:
2+
3+
{
4+
### Make PaperWM available in system environment
5+
environment.systemPackages = with pkgs;
6+
[ paperwm
7+
];
8+
9+
### Set graphical session to auto-login GNOME
10+
services.xserver =
11+
{ enable = true;
12+
displayManager.autoLogin =
13+
{ enable = true;
14+
user = "user";
15+
};
16+
desktopManager.gnome.enable = true;
17+
};
18+
19+
### Set dconf to enable PaperWM out of the box
20+
programs.dconf =
21+
{ enable = true;
22+
profiles."user".databases = [
23+
{ settings =
24+
{ "org/gnome/shell" =
25+
{ enabled-extensions = [ "[email protected]" ];
26+
};
27+
};
28+
}
29+
];
30+
};
31+
32+
### Set default user
33+
users.users."user" =
34+
{ isNormalUser = true;
35+
createHome = true;
36+
home = "/home";
37+
description = "PaperWM test user";
38+
extraGroups = [ "wheel" ];
39+
password = "paperwm";
40+
};
41+
42+
### No-password sudo
43+
security.sudo =
44+
{ enable = true;
45+
extraConfig = "%wheel ALL=(ALL) NOPASSWD: ALL";
46+
};
47+
}

0 commit comments

Comments
 (0)