mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-22 16:16:50 +01:00
complete rework v3
This commit is contained in:
parent
7409e9ca10
commit
366a0e221a
131 changed files with 20171 additions and 585 deletions
52
parts/vm.nix
52
parts/vm.nix
|
|
@ -1,15 +1,41 @@
|
|||
{mylib, ...}: {
|
||||
perSystem = {system, ...}: {
|
||||
packages.vm = mylib.mkVm [
|
||||
./modules/base.nix
|
||||
./modules/graphical.nix
|
||||
{
|
||||
user.username = "vm";
|
||||
system.stateVersion = "24.11";
|
||||
monitor.primary.resolution = "1920x1080";
|
||||
services.qemuGuest.enable = true;
|
||||
services.spice-vdagentd.enable = true;
|
||||
}
|
||||
];
|
||||
{
|
||||
hostname,
|
||||
version,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
username = "vm";
|
||||
in {
|
||||
perSystem = {
|
||||
system,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
packages.vm = inputs.nixos-generators.nixosGenerate {
|
||||
specialArgs = {
|
||||
inherit inputs system pkgs hostname version username;
|
||||
};
|
||||
|
||||
modules = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
inputs.agenix.nixosModules.default
|
||||
inputs.agenix-rekey.nixosModules.default
|
||||
./modules/base/user.nix
|
||||
./modules/required.nix
|
||||
./modules/shell.nix
|
||||
./modules/graphical.nix
|
||||
{
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
extraGroups = ["wheel" "networkmanager" "libvirt" "kvm"];
|
||||
};
|
||||
monitors = [{resolution="1920x1080";}];
|
||||
services.qemuGuest.enable = true;
|
||||
services.spice-vdagentd.enable = true;
|
||||
}
|
||||
];
|
||||
inherit system;
|
||||
format = "qcow";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue