refactor(example-vm): don't import nixpkgs
This should save on evaluation time.
This commit is contained in:
parent
165c403072
commit
ecc37b8fc3
2 changed files with 10 additions and 9 deletions
|
@ -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";
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue