-
Notifications
You must be signed in to change notification settings - Fork 4
Nix flake as an installation option #36
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| dist/ | ||
| .DS_Store |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { pkgs ? import <nixpkgs> {}, version ? "dev" }: | ||
|
|
||
| pkgs.buildGoModule rec { | ||
| pname = "tdl"; | ||
| inherit version; | ||
|
|
||
| src = ./.; | ||
|
|
||
| subPackages = [ "tdl" ]; | ||
|
|
||
| vendorHash = "sha256-Q3MwzslcVv9h3QZAfqnAYmkdVtWeJnhXqYvhZmb3hps="; | ||
|
|
||
| ldflags = [ | ||
| "-s" "-w" | ||
| "-X main.version=${version}" | ||
| ]; | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| description = "ThreeDotsLabs CLI"; | ||
|
|
||
| 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 | ||
| pkgs = nixpkgs.legacyPackages.${system}; | ||
| version = if self ? rev then self.rev else "dev"; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just to double check, will it work with our tags/github semver releases?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, it works perfectly with tags Users can install a specific release by just appending the tag, like |
||
| in | ||
| { | ||
| packages.default = pkgs.buildGoModule { | ||
| pname = "tdl"; | ||
| version = version; | ||
| src = ./.; | ||
|
|
||
| subPackages = [ "tdl" ]; | ||
|
|
||
| vendorHash = "sha256-Q3MwzslcVv9h3QZAfqnAYmkdVtWeJnhXqYvhZmb3hps="; | ||
|
|
||
| ldflags = [ | ||
| "-s" "-w" | ||
| "-X main.version=${version}" | ||
| "-X main.commit=${if self ? rev then self.rev else "dirty"}" | ||
| ]; | ||
| }; | ||
| } | ||
| ); | ||
| } | ||
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 it will require re-generation?
could it make sense to add script in makefile to regenerate it and if it may change often add CI task that can verify it?
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.
It will only require regeneration whenever the Go dependencies (
go.mod/go.sum) change.