-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9771 from hercules-ci/2.3-flake
[2.3] Add flake for testing purposes
- Loading branch information
Showing
5 changed files
with
87 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
# A very basic flake to conveniently `nix run nix/2.3` for testing. | ||
# Note that this release has no built-in support for flakes, | ||
# and this flake declaration is provided on a best-effort basis. | ||
outputs = { self, nixpkgs, ... }: | ||
let | ||
inherit (nixpkgs) lib; | ||
inherit (lib) flip genAttrs mapAttrs substring; | ||
rev = self.sourceInfo.rev or self.sourceInfo.dirtyRev or ""; | ||
revCount = self.sourceInfo.revCount or 0; | ||
shortRev = self.sourceInfo.shortRev or (substring 0 7 rev); | ||
release = import ./release.nix { | ||
nix = { | ||
outPath = ./.; | ||
inherit rev revCount shortRev; | ||
}; | ||
nixpkgs = nixpkgs.outPath; | ||
officialRelease = false; | ||
}; | ||
in | ||
{ | ||
# inherit release; | ||
packages = | ||
mapAttrs | ||
(system: nix: { | ||
default = nix; | ||
nix = nix; | ||
}) | ||
release.build; | ||
apps = | ||
mapAttrs | ||
(system: packages: | ||
let | ||
appFor = mainProgram: { | ||
type = "app"; | ||
program = lib.getExe' packages.nix mainProgram; | ||
}; | ||
in flip genAttrs appFor [ | ||
"nix" | ||
"nix-build" | ||
"nix-channel" | ||
"nix-collect-garbage" | ||
"nix-copy-closure" | ||
"nix-daemon" | ||
"nix-env" | ||
"nix-hash" | ||
"nix-instantiate" | ||
"nix-prefetch-url" | ||
"nix-shell" | ||
"nix-store" | ||
]) | ||
self.packages; | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters