refactor(example-vm): don't import nixpkgs
All checks were successful
/ check (push) Successful in 8s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 13s
/ build-vm (push) Successful in 1s
/ report-size (push) Successful in 3s

This should save on evaluation time.
This commit is contained in:
Jalil David Salamé Messina 2025-04-21 21:01:41 +02:00
parent 165c403072
commit ecc37b8fc3
Signed by: jalil
GPG key ID: F016B9E770737A0B
2 changed files with 10 additions and 9 deletions

View file

@ -31,4 +31,6 @@
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.11"; # Did you read the comment?
nixpkgs.hostPlatform = "x86_64-linux";
}

View file

@ -1,19 +1,18 @@
{ inputs, lib, ... }:
let
system = "x86_64-linux";
overlays = builtins.attrValues inputs.self.overlays;
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "steam-unwrapped" ];
pkgs = import inputs.nixpkgs { inherit system overlays config; };
in
{
# Example vm configuration
flake.nixosConfigurations.vm = lib.nixosSystem {
inherit pkgs;
modules = [
inputs.self.nixosModules.default
../example-vm # import vm configuration
{ nix.registry.nixpkgs.flake = inputs.nixpkgs; } # pin nixpkgs to the one used by the system
{
nixpkgs = {
overlays = builtins.attrValues inputs.self.overlays;
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "steam-unwrapped" ];
};
# pin nixpkgs to the one used by the system
nix.registry.nixpkgs.flake = inputs.nixpkgs;
}
];
};
}