Use Nix without the flake
This is what we do for `nix-eval-jobs` already. It allows for more fine-grained control over dependencies.
This commit is contained in:
parent
d5d4d19a4c
commit
1001b67704
11
flake.lock
generated
11
flake.lock
generated
@ -1,16 +1,7 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nix": {
|
"nix": {
|
||||||
"inputs": {
|
"flake": false,
|
||||||
"flake-compat": [],
|
|
||||||
"flake-parts": [],
|
|
||||||
"git-hooks-nix": [],
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"nixpkgs-23-11": [],
|
|
||||||
"nixpkgs-regression": []
|
|
||||||
},
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1745420957,
|
"lastModified": 1745420957,
|
||||||
"narHash": "sha256-ZbB3IH9OlJvo14GlQZbYHzJojf/HCDT38GzYTod8DaU=",
|
"narHash": "sha256-ZbB3IH9OlJvo14GlQZbYHzJojf/HCDT38GzYTod8DaU=",
|
||||||
|
63
flake.nix
63
flake.nix
@ -5,14 +5,8 @@
|
|||||||
|
|
||||||
inputs.nix = {
|
inputs.nix = {
|
||||||
url = "github:NixOS/nix/2.28-maintenance";
|
url = "github:NixOS/nix/2.28-maintenance";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
# We want to control the deps precisely
|
||||||
|
flake = false;
|
||||||
# hide nix dev tooling from our lock file
|
|
||||||
inputs.flake-parts.follows = "";
|
|
||||||
inputs.git-hooks-nix.follows = "";
|
|
||||||
inputs.nixpkgs-regression.follows = "";
|
|
||||||
inputs.nixpkgs-23-11.follows = "";
|
|
||||||
inputs.flake-compat.follows = "";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inputs.nix-eval-jobs = {
|
inputs.nix-eval-jobs = {
|
||||||
@ -30,10 +24,27 @@
|
|||||||
|
|
||||||
# A Nixpkgs overlay that provides a 'hydra' package.
|
# A Nixpkgs overlay that provides a 'hydra' package.
|
||||||
overlays.default = final: prev: {
|
overlays.default = final: prev: {
|
||||||
nix-eval-jobs = final.callPackage nix-eval-jobs {};
|
nixDependenciesForHydra = final.lib.makeScope final.newScope
|
||||||
|
(import (nix + "/packaging/dependencies.nix") {
|
||||||
|
pkgs = final;
|
||||||
|
inherit (final) stdenv;
|
||||||
|
inputs = {};
|
||||||
|
});
|
||||||
|
nixComponentsForHydra = final.lib.makeScope final.nixDependenciesForHydra.newScope
|
||||||
|
(import (nix + "packaging/components.nix") {
|
||||||
|
officialRelease = true;
|
||||||
|
inherit (final) lib;
|
||||||
|
pkgs = final;
|
||||||
|
src = nix;
|
||||||
|
maintainers = [ ];
|
||||||
|
});
|
||||||
|
nix-eval-jobs = final.callPackage nix-eval-jobs {
|
||||||
|
nixComponents = final.nixComponentsForHydra;
|
||||||
|
};
|
||||||
hydra = final.callPackage ./package.nix {
|
hydra = final.callPackage ./package.nix {
|
||||||
inherit (nixpkgs.lib) fileset;
|
inherit (final.lib) fileset;
|
||||||
rawSrc = self;
|
rawSrc = self;
|
||||||
|
nixComponents = final.nixComponentsForHydra;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -73,24 +84,26 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
packages = forEachSystem (system: let
|
packages = forEachSystem (system: let
|
||||||
nixComponents = {
|
inherit (nixpkgs) lib;
|
||||||
inherit (nix.packages.${system})
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
nix-util
|
nixDependencies = lib.makeScope pkgs.newScope
|
||||||
nix-store
|
(import (nix + "/packaging/dependencies.nix") {
|
||||||
nix-expr
|
inherit pkgs;
|
||||||
nix-fetchers
|
inherit (pkgs) stdenv;
|
||||||
nix-flake
|
inputs = {};
|
||||||
nix-main
|
});
|
||||||
nix-cmd
|
nixComponents = lib.makeScope nixDependencies.newScope
|
||||||
nix-cli
|
(import (nix + "/packaging/components.nix") {
|
||||||
nix-perl-bindings
|
officialRelease = true;
|
||||||
;
|
inherit lib pkgs;
|
||||||
};
|
src = nix;
|
||||||
|
maintainers = [ ];
|
||||||
|
});
|
||||||
in {
|
in {
|
||||||
nix-eval-jobs = nixpkgs.legacyPackages.${system}.callPackage nix-eval-jobs {
|
nix-eval-jobs = pkgs.callPackage nix-eval-jobs {
|
||||||
inherit nixComponents;
|
inherit nixComponents;
|
||||||
};
|
};
|
||||||
hydra = nixpkgs.legacyPackages.${system}.callPackage ./package.nix {
|
hydra = pkgs.callPackage ./package.nix {
|
||||||
inherit (nixpkgs.lib) fileset;
|
inherit (nixpkgs.lib) fileset;
|
||||||
inherit nixComponents;
|
inherit nixComponents;
|
||||||
inherit (self.packages.${system}) nix-eval-jobs;
|
inherit (self.packages.${system}) nix-eval-jobs;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user