From 4172b5b29081bb8ff0b113bbfa55f7983589c6e0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 8 May 2019 13:28:02 +0200 Subject: [PATCH] Add flake.nix --- flake.lock | 9 +++++++++ flake.nix | 21 +++++++++++++++++++++ release.nix | 3 ++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..9848cb99 --- /dev/null +++ b/flake.lock @@ -0,0 +1,9 @@ +{ + "nonFlakeRequires": {}, + "requires": { + "nixpkgs": { + "uri": "github:edolstra/nixpkgs/a4d896e89932e873c4117908d558db6210fa3b56" + } + }, + "version": 1 +} \ No newline at end of file diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..1e9bc312 --- /dev/null +++ b/flake.nix @@ -0,0 +1,21 @@ +{ + name = "hydra"; + + description = "A Nix-based continuous build system"; + + epoch = 2019; + + requires = [ "nixpkgs" ]; + + provides = deps: rec { + + hydraJobs = import ./release.nix { + hydraSrc = deps.self; + nixpkgs = deps.nixpkgs; + }; + + packages.hydra = hydraJobs.build.x86_64-linux; + + defaultPackage = packages.hydra; + }; +} diff --git a/release.nix b/release.nix index dd28cef0..9d060d6d 100644 --- a/release.nix +++ b/release.nix @@ -30,7 +30,8 @@ let environment.systemPackages = [ pkgs.perlPackages.LWP pkgs.perlPackages.JSON ]; }; - version = builtins.readFile ./version + "." + toString hydraSrc.revCount + "." + hydraSrc.rev; + # FIXME: use commit date. + version = builtins.readFile ./version + "." + toString hydraSrc.revCount or 0 + "." + hydraSrc.shortRev or "0000000"; in