configuration.nix/flake-modules/example-vm.nix
Jalil David Salamé Messina e03cd65e87
All checks were successful
/ check (push) Successful in 20s
/ build (audiomenu) (push) Successful in 2s
/ build (docs) (push) Successful in 2s
/ build (jpassmenu) (push) Successful in 2s
/ build (nixosConfigurations.vm.config.system.build.toplevel) (push) Successful in 2s
/ build (nvim) (push) Successful in 1s
feat: use flake-parts to clean up the flake.nix
This is much more manageable!
2024-10-04 23:50:12 +02:00

46 lines
1.3 KiB
Nix

{ inputs, lib, ... }:
{
# Example vm configuration
flake.nixosConfigurations.vm =
let
system = "x86_64-linux";
overlays = builtins.attrValues inputs.self.overlays;
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "steam-original" ];
pkgs = import inputs.nixpkgs { inherit system overlays config; };
in
lib.nixosSystem {
inherit system pkgs;
modules = [
inputs.self.nixosModules.vm # import vm module
{
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
users.users.jdoe = {
password = "example";
isNormalUser = true;
extraGroups = [
"wheel"
"video"
"networkmanager"
];
};
home-manager.users.jdoe = {
home = {
username = "jdoe";
homeDirectory = "/home/jdoe";
};
jhome = {
enable = true;
gui.enable = true;
dev.rust.enable = true;
};
};
nix.registry.nixpkgs.flake = inputs.nixpkgs;
jconfig = {
enable = true;
gui.enable = true;
};
}
];
};
}