Skip to content
Snippets Groups Projects
Verified Commit b17e3884 authored by Legy (Beini)'s avatar Legy (Beini)
Browse files

Add build support for nix

parent b6ca87e0
No related branches found
No related tags found
No related merge requests found
{ pkgs ? import <nixpkgs> {}, haskellPackages ? pkgs.haskellPackages, args ? {}}:
let
inherit (pkgs) lib haskell;
rawdrv = haskellPackages.callCabal2nix "qbar" ./. args;
drv = haskell.lib.generateOptparseApplicativeCompletions [ "qbar" ] rawdrv;
in
if lib.inNixShell then drv.env else drv
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1616527350,
"narHash": "sha256-VkMevY2WLU+K7T/P4wVj18Ms8zyeRfp05ILf556m5Y8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d3f7e969b9860fb80750147aeb56dab1c730e756",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
{
outputs = { self, nixpkgs }: let
lib = nixpkgs.lib;
systems = lib.platforms.unix;
forAllSystems = f: lib.genAttrs systems (system: f system);
in {
packages = forAllSystems (system: {
qbar = import ./. {
pkgs = nixpkgs.legacyPackages."${system}";
};
});
overlay = self: super: {
qbar = self.haskellPackages.qd;
haskell = super.haskell // {
packageOverrides = hself: hsuper: super.haskell.packageOverrides hself hsuper // {
qbar = import ./. { pkgs = self; haskellPackages = hself; };
};
};
};
defaultPackage = forAllSystems (system: self.packages.${system}.qbar);
devShell = forAllSystems (system: self.packages.${system}.qbar.env);
};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment