Skip to content

Commit

Permalink
use new buildIdris' function
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpolzin committed Sep 9, 2024
1 parent 77aaee8 commit a363e1f
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 69 deletions.
101 changes: 43 additions & 58 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
callPackage,
fetchFromGitHub,
git,
idris2Packages,
buildIdris,
lib,
installShellFiles,
Expand All @@ -15,75 +14,61 @@ let

idrisAdds = buildIdris {
ipkgName = "idris-adds";
version = idrisAddsVersion;
src = fetchFromGitHub {
owner = "mattpolzin";
repo = "idris-adds";
rev = idrisAddsVersion;
hash = "sha256-WEr6oRZ8+50G1qv7Kv62M4DRsgAa6x1BCODC1vDOQUY=";
};
idrisLibraries = [ ];
};
in
buildIdris {
ipkgName = "harmony";
src = builtins.path {
path = ./.;
name = "harmony-pkg-src";
};

harmonyPkg = buildIdris {
version = "5.0.0";
ipkgName = "harmony";
src = builtins.path {
path = ./.;
name = "harmony-pkg-src";
};
extraIdrisLibraries = [ idrisAdds ];

idrisLibraries =
let
ps = idris2Packages;
in
[
idrisAdds
ps.elab-util
ps.parser
ps.parser-json
ps.json
];
nativeBuildInputs = [
installShellFiles
makeBinaryWrapper
];
buildInputs = [
nodejs
git
];
nativeBuildInputs = [
installShellFiles
makeBinaryWrapper
];
buildInputs = [
nodejs
git
];

IDRIS2_DATA = "./support";
IDRIS2_DATA = "./support";

postInstall = ''
wrapProgram $out/bin/harmony \
--prefix PATH : ${
lib.makeBinPath [
nodeDependencies
git
"$out"
]
} \
--prefix NODE_PATH : ${nodeDependencies}/lib/node_modules
'';
postInstall = ''
wrapProgram $out/bin/harmony \
--prefix PATH : ${
lib.makeBinPath [
nodeDependencies
git
"$out"
]
} \
--prefix NODE_PATH : ${nodeDependencies}/lib/node_modules
'';

postFixup = ''
installShellCompletion --cmd harmony \
--bash <($out/bin/harmony --bash-completion-script) \
--zsh <($out/bin/harmony --zsh-completion-script) \
'';
postFixup = ''
installShellCompletion --cmd harmony \
--bash <($out/bin/harmony --bash-completion-script) \
--zsh <($out/bin/harmony --zsh-completion-script) \
'';

installCheckPhase = ''
export harmony=$out/bin/harmony
INTERACTIVE="" make test
'';
installCheckPhase = ''
export harmony=$out/bin/harmony
INTERACTIVE="" make test
'';

meta = with lib; {
description = "Harmony GitHub collaboration tool";
homepage = "https://github.com/mattpolzin/harmony";
license = licenses.mit;
mainProgram = "harmony";
};
meta = with lib; {
description = "Harmony GitHub collaboration tool";
homepage = "https://github.com/mattpolzin/harmony";
license = licenses.mit;
mainProgram = "harmony";
};
in
harmonyPkg.executable
}
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
let
pkgs = nixpkgs.legacyPackages.${system};
idris2Packages = packageset.idris2Packages.${system};
inherit (packageset.packages.${system}) buildIdris;
buildIdris = packageset.packages.${system}.buildIdris';
in
{
harmony = pkgs.callPackage ./default.nix { inherit buildIdris idris2Packages; };
harmony = pkgs.callPackage ./default.nix { inherit buildIdris; };

default = self.packages.${system}.harmony;
}
Expand Down

0 comments on commit a363e1f

Please sign in to comment.