This repository has been archived on 2024-01-28. You can view files and clone it, but cannot push or open issues or pull requests.
ecg-prog-filtered/flake.nix

73 lines
2 KiB
Nix

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
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;
checkInputs = [ ];
});
mkClang = drv: drv.override (o: {
stdenv = pkgs.clangStdenv;
});
in
{
packages = lib.foldAttrs lib.const { }
(lib.flatten (lib.mapAttrsToList
(name: v: {
"${name}" = v;
"${name}-nocheck" = mkNocheck v;
"${name}-clang" = mkClang v;
"${name}-nocheck-clang" = mkClang (mkNocheck v);
})
rec {
u01 = pkgs.callPackage
({ stdenv, catch2_3, cmake }: stdenv.mkDerivation {
name = "ecg-u01";
src = ./u01;
nativeBuildInputs = [ cmake ];
checkInputs = [ catch2_3 ];
doCheck = true;
})
{ };
u02 = pkgs.callPackage
({ stdenv, catch2_3, cmake, freeglut, libGL, libGLU }: stdenv.mkDerivation {
name = "ecg-u02";
src = ./u02;
nativeBuildInputs = [ cmake ];
buildInputs = [ freeglut libGL libGLU ];
checkInputs = [ catch2_3 ];
doCheck = true;
})
{ };
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 clang cmake freeglut libGL libGLU reuse ];
};
});
}