flake: Make building variants easier
This commit is contained in:
parent
c263958d3b
commit
7dacccdbd0
70
flake.nix
70
flake.nix
|
@ -6,6 +6,7 @@
|
|||
|
||||
outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
mkNocheck = drv: drv.overrideAttrs (o: {
|
||||
doCheck = false;
|
||||
|
@ -13,48 +14,51 @@
|
|||
});
|
||||
in
|
||||
{
|
||||
packages = rec {
|
||||
u01 = pkgs.callPackage
|
||||
({ stdenv, catch2_3, cmake }: stdenv.mkDerivation {
|
||||
name = "ecg-u01";
|
||||
|
||||
src = ./u01;
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
checkInputs = [ catch2_3 ];
|
||||
|
||||
doCheck = true;
|
||||
packages = lib.foldAttrs lib.const { }
|
||||
(lib.flatten (lib.mapAttrsToList
|
||||
(name: v: {
|
||||
"${name}" = v;
|
||||
"${name}-nocheck" = mkNocheck v;
|
||||
})
|
||||
{ };
|
||||
rec {
|
||||
u01 = pkgs.callPackage
|
||||
({ stdenv, catch2_3, cmake }: stdenv.mkDerivation {
|
||||
name = "ecg-u01";
|
||||
|
||||
u02 = pkgs.callPackage
|
||||
({ stdenv, catch2_3, cmake, freeglut, libGL, libGLU }: stdenv.mkDerivation {
|
||||
name = "ecg-u02";
|
||||
src = ./u01;
|
||||
|
||||
src = ./u02;
|
||||
nativeBuildInputs = [ cmake ];
|
||||
checkInputs = [ catch2_3 ];
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ freeglut libGL libGLU ];
|
||||
checkInputs = [ catch2_3 ];
|
||||
doCheck = true;
|
||||
})
|
||||
{ };
|
||||
|
||||
doCheck = true;
|
||||
})
|
||||
{ };
|
||||
u02 = pkgs.callPackage
|
||||
({ stdenv, catch2_3, cmake, freeglut, libGL, libGLU }: stdenv.mkDerivation {
|
||||
name = "ecg-u02";
|
||||
|
||||
u03 = pkgs.callPackage
|
||||
({ stdenv, cmake, freeglut, libGL, libGLU }: stdenv.mkDerivation {
|
||||
name = "ecg-u03";
|
||||
src = ./u02;
|
||||
|
||||
src = ./u03;
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ freeglut libGL libGLU ];
|
||||
checkInputs = [ catch2_3 ];
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ freeglut libGL libGLU ];
|
||||
})
|
||||
{ };
|
||||
doCheck = true;
|
||||
})
|
||||
{ };
|
||||
|
||||
u01-nocheck = mkNocheck u01;
|
||||
u02-nocheck = mkNocheck u02;
|
||||
};
|
||||
u03 = pkgs.callPackage
|
||||
({ stdenv, cmake, freeglut, libGL, libGLU }: stdenv.mkDerivation {
|
||||
name = "ecg-u03";
|
||||
|
||||
src = ./u03;
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ freeglut libGL libGLU ];
|
||||
})
|
||||
{ };
|
||||
}));
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [ catch2_3 cmake freeglut libGL libGLU reuse ];
|
||||
|
|
Reference in a new issue