Skip to content

Commit

Permalink
flake: add vm closure for nixos stable
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyinstarlight committed May 31, 2024
1 parent 7db865c commit 9eaa30e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
19 changes: 18 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";

flake-compat = {
url = "github:nix-community/flake-compat";
flake = false;
};
};

outputs = { self, nixpkgs, ... }: let
outputs = { self, nixpkgs, nixpkgs-stable, ... }: let
forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
in {
lib = {
Expand Down Expand Up @@ -51,7 +53,7 @@
'';
};

vm = let
vm = nixpkgs.lib.makeOverridable ({ nixpkgs }: let
nixosConfig = nixpkgs.lib.nixosSystem {
modules = [
({ lib, pkgs, modulesPath, ... }: {
Expand Down Expand Up @@ -114,7 +116,9 @@
})
];
};
in nixosConfig.config.system.build.vm // { closure = nixosConfig.config.system.build.toplevel; inherit (nixosConfig) config pkgs; };
in nixosConfig.config.system.build.vm // { closure = nixosConfig.config.system.build.toplevel; inherit (nixosConfig) config pkgs; }) { inherit nixpkgs; };

vm-stable = self.legacyPackages.${system}.vm.override { nixpkgs = nixpkgs-stable; };
});
};
}

0 comments on commit 9eaa30e

Please sign in to comment.