-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kcl: init at 0.8.5 #302285
kcl: init at 0.8.5 #302285
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please adjust commit & PR title according to the conventions
pname = "kcl"; | ||
version = "0.8.4"; | ||
|
||
src = if stdenv.isDarwin && stdenv.isAarch64 then fetchurl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When having this many sources, it might be advisable to create a sources.json
and then read the URL endings and hashes from there. For reference, see e.g. the tabnine
package.
sha256 = "9a86ef943ca7df1a21801fb91be8092d04835d1d555c146da89c1149d33a4c42"; | ||
} else throw "Unsupported platform"; | ||
|
||
unpackPhase = "tar -xzf $src"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unpackPhase = "tar -xzf $src"; |
Unpacking TAR files should happen by default: https://nixos.org/manual/nixpkgs/stable/#tar-files
installPhase = '' | ||
mkdir -p $out/bin | ||
cp kcl $out/bin/ | ||
''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
installPhase = '' | |
mkdir -p $out/bin | |
cp kcl $out/bin/ | |
''; | |
installPhase = '' | |
runHook preInstall | |
mkdir -p $out/bin | |
cp kcl $out/bin/ | |
runHook postInstall | |
''; |
Since the source is available on github, why not build from source directly? nix-init almost generates a working package by default Generated package
{ lib
, buildGoModule
, fetchFromGitHub
}:
buildGoModule rec {
pname = "kcl";
version = "0.8.5";
src = fetchFromGitHub {
owner = "kcl-lang";
repo = "cli";
rev = "v${version}";
hash = "sha256-ZjEMgQukhBGY3LWqsGmLj3lKfLtNNaQugQs0cSLMb80=";
};
vendorHash = "sha256-jmqKMB85HxAlwH7FVjHrLCZQYuAJrguRfzIz1yMypjw=";
ldflags = [
"-X=kcl-lang.io/cli/pkg/version.version=${version}"
];
subPackages = [ "cmd/kcl" ];
meta = with lib; {
description = "The KCL Command Line Interface (CLI";
homepage = "https://github.com/kcl-lang/cli";
license = licenses.asl20;
maintainers = with maintainers; [ ];
mainProgram = "cli";
};
} |
Description of changes
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.