Init
This commit is contained in:
69
flake.nix
Normal file
69
flake.nix
Normal file
@@ -0,0 +1,69 @@
|
||||
{
|
||||
description = "A simple [[https://orgmode.org/][org]] document parser";
|
||||
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
inputs.nimble.url = "github:floscr/flake-nimble";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
outputs =
|
||||
{ self
|
||||
, nixpkgs
|
||||
, nimble
|
||||
, nixos
|
||||
, flake-utils
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
nimpkgs = nimble.packages.${system};
|
||||
customNimPkgs = import ./nix/packages/nimExtraPackages.nix { inherit pkgs; inherit nimpkgs; };
|
||||
|
||||
buildInputs = with pkgs; [ ];
|
||||
utils = import ./nix/lib/nimBuildGenerator.nix;
|
||||
inherit (nixos.lib) flatten;
|
||||
in
|
||||
rec {
|
||||
packages.nim_org_parse =
|
||||
let
|
||||
pkgName = "nim_org_parse";
|
||||
in
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = pkgName;
|
||||
src = ./.;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
nim
|
||||
];
|
||||
|
||||
buildInputs = buildInputs;
|
||||
|
||||
buildPhase = utils.makeNimBuildScript {
|
||||
srcFile = "./src/${pkgName}.nim";
|
||||
dstName = pkgName;
|
||||
packages = flatten [
|
||||
(with nimpkgs; [
|
||||
])
|
||||
customNimPkgs.fusion
|
||||
customNimPkgs.nimfp
|
||||
];
|
||||
extraLines = [ ];
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib
|
||||
install -Dt \
|
||||
$out/bin \
|
||||
$TMPDIR/${pkgName}
|
||||
'';
|
||||
};
|
||||
|
||||
devShell = import ./shell.nix {
|
||||
inherit pkgs;
|
||||
inherit nimpkgs;
|
||||
inherit buildInputs;
|
||||
};
|
||||
|
||||
defaultPackage = packages.nim_org_parse;
|
||||
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user