diff --git a/flake.lock b/flake.lock index 500a8c8e..11ed6bbf 100644 --- a/flake.lock +++ b/flake.lock @@ -32,10 +32,27 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1717090882, + "narHash": "sha256-Up5tvtY9YlVEyVn9hfZcxFQi5qVhQ5hdVNGPQOUchNw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d24e7fdcfaecdca496ddd426cae98c9e2d12dfe8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable" } } }, diff --git a/flake.nix b/flake.nix index f92ee87f..72d841ff 100644 --- a/flake.nix +++ b/flake.nix @@ -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 = { @@ -51,7 +53,7 @@ ''; }; - vm = let + vm = nixpkgs.lib.makeOverridable ({ nixpkgs }: let nixosConfig = nixpkgs.lib.nixosSystem { modules = [ ({ lib, pkgs, modulesPath, ... }: { @@ -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; }; }); }; }