2019-02-14 15:29:42 +08:00
|
|
|
{ pkgs ? import <nixpkgs> {}}:
|
|
|
|
let
|
2019-02-14 20:16:56 +08:00
|
|
|
artiqSrc = <artiqSrc>;
|
2019-02-14 19:31:46 +08:00
|
|
|
generatedNix = pkgs.runCommand "generated-nix" { buildInputs = [ pkgs.nix pkgs.git ]; }
|
2019-02-14 15:29:42 +08:00
|
|
|
''
|
|
|
|
cp --no-preserve=mode,ownership -R ${./artiq} $out
|
2019-02-14 19:31:46 +08:00
|
|
|
REV=`git --git-dir ${artiqSrc}/.git rev-parse HEAD`
|
|
|
|
HASH=`nix-hash --type sha256 --base32 ${artiqSrc}`
|
|
|
|
cat > $out/pkgs/artiq-src.nix << EOF
|
|
|
|
{ fetchgit }:
|
|
|
|
fetchgit {
|
|
|
|
url = "git://github.com/m-labs/artiq.git";
|
|
|
|
rev = "$REV";
|
|
|
|
sha256 = "$HASH";
|
|
|
|
leaveDotGit = true;
|
|
|
|
}
|
|
|
|
EOF
|
2019-02-14 15:29:42 +08:00
|
|
|
'';
|
2019-02-15 18:17:34 +08:00
|
|
|
artiqpkgs = import "${generatedNix}/default.nix" { inherit pkgs; };
|
|
|
|
jobs = builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) artiqpkgs;
|
2019-02-14 15:29:42 +08:00
|
|
|
in
|
|
|
|
jobs // {
|
2019-02-14 17:26:52 +08:00
|
|
|
channel = pkgs.releaseTools.channel {
|
|
|
|
name = "main";
|
2019-02-14 17:49:40 +08:00
|
|
|
src = generatedNix;
|
2019-02-14 15:29:42 +08:00
|
|
|
constituents = builtins.attrValues jobs;
|
|
|
|
};
|
|
|
|
}
|