diff --git a/nix/ci.nix b/nix/ci.nix index 91f1a0f..4cf9309 100644 --- a/nix/ci.nix +++ b/nix/ci.nix @@ -1,6 +1,37 @@ -args@{ pkgs ? import ./default.nix args, system ? null, ... }: +let + sources = import ./sources.nix; + lib = import (sources."nixpkgs" + "/lib"); + inherit (import sources."project.nix" { inherit lib; }) dimension; +in -{ - inherit (pkgs) arion tests; - doc = pkgs.recurseIntoAttrs (import ../doc { inherit pkgs; }); -} +dimension "Nixpkgs version" { + "nixos-19_03" = { + nixpkgsSource = "nixpkgs"; + }; + "nixos-unstable" = { + nixpkgsSource = "nixos-unstable"; + + # Broken on unstable, wontfix because doc tooling will be changed. + # TODO: reenable + enableDoc = false; + }; + } ( + _name: { nixpkgsSource, enableDoc ? true }: + + + dimension "System" { + "x86_64-linux" = {}; + # TODO: darwin + # "x86_64-darwin" = { enableNixOSTests = false; }; + } ( + system: {}: + let + pkgs = import ./. { inherit system; nixpkgsSrc = sources.${nixpkgsSource}; }; + in + { + inherit (pkgs) arion tests; + } // lib.optionalAttrs enableDoc { + doc = pkgs.recurseIntoAttrs (import ../doc { inherit pkgs; }); + } + ) + ) diff --git a/nix/default.nix b/nix/default.nix index 12e5b95..7393d12 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -1,9 +1,6 @@ -/** - * This is the entry-point for all nix execution in this project. - */ { sources ? import ./sources.nix , nixpkgsSrc ? sources.nixpkgs -, system ? null +, system ? builtins.currentSystem , ... }: @@ -15,6 +12,5 @@ import nixpkgsSrc ({ # all the packages are defined there: (import ./overlay.nix) ]; -} // (if system == null then {} else { inherit system; -})) +}) diff --git a/nix/overlay.nix b/nix/overlay.nix index 5c3fa01..be6a8e1 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -8,7 +8,7 @@ let in { - arion = import ./arion.nix { pkgs = self; }; + inherit (import ./.. { pkgs = self; }) arion; tests = super.callPackage ../tests {}; doc = super.callPackage ../doc {}; diff --git a/nix/sources.json b/nix/sources.json index efa1ae1..fc22e3a 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -11,6 +11,19 @@ "url": "https://github.com/nmattia/niv/archive/1dd094156b249586b66c16200ecfd365c7428dc0.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, + "nixos-unstable": { + "branch": "nixos-unstable", + "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", + "homepage": "https://github.com/NixOS/nixpkgs", + "owner": "NixOS", + "repo": "nixpkgs-channels", + "rev": "cb4332e3eb6dfdb653f1fc7397a0292df228a533", + "sha256": "1722wphznqhpfny08rcy19l85r2l893ckjc3h1vfivj6aj64fwjr", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs-channels/archive/cb4332e3eb6dfdb653f1fc7397a0292df228a533.tar.gz", + "url_template": "https://github.com///archive/.tar.gz", + "version": "" + }, "nixpkgs": { "branch": "nixos-19.03", "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", @@ -22,5 +35,17 @@ "type": "tarball", "url": "https://github.com/NixOS/nixpkgs-channels/archive/6420e2649fa9e267481fb78e602022dab9d1dcd1.tar.gz", "url_template": "https://github.com///archive/.tar.gz" + }, + "project.nix": { + "branch": "master", + "description": "A configuration manager for your projects", + "homepage": null, + "owner": "hercules-ci", + "repo": "project.nix", + "rev": "33e5f3cb25feff4ccd00f8c60a05976e2ee01802", + "sha256": "0c3q3il5h6q3ms8m6da51knvjsfvpz12sh3a3av4d2a5ikm5ncl1", + "type": "tarball", + "url": "https://github.com/hercules-ci/project.nix/archive/33e5f3cb25feff4ccd00f8c60a05976e2ee01802.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" } }