feat: use flake-parts to clean up the flake.nix
This is much more manageable!
This commit is contained in:
parent
584945f1e8
commit
e03cd65e87
11 changed files with 250 additions and 198 deletions
flake-modules
46
flake-modules/example-vm.nix
Normal file
46
flake-modules/example-vm.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{ 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;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue