-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nix): command completions + flakes support
- Loading branch information
Showing
3 changed files
with
129 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,38 @@ | ||
{}: let | ||
pkgs = import <nixpkgs> {}; | ||
in | ||
pkgs.buildGoModule rec { | ||
pname = "nao"; | ||
version = "3.0.0"; | ||
src = ./.; | ||
buildTarget = "./cmd/nao"; | ||
|
||
vendorSha256 = "sha256-sDLbIHeY2Jdos8pgRaR6vbjwRPunAukasKz0m7sMIek="; | ||
|
||
doCheck = false; | ||
ldflags = ["-X main.version=${version}"]; | ||
} | ||
{ | ||
installShellFiles, | ||
buildGoModule, | ||
lib, | ||
}: | ||
buildGoModule rec { | ||
pname = "nao"; | ||
version = "3.2.2"; | ||
|
||
src = builtins.path { | ||
name = "nao"; | ||
path = ./.; | ||
}; | ||
|
||
vendorSha256 = "sha256-MTVJWksGWva+Xet+T2aIOXzkxB7w9raJVwa/p1bwkOo="; | ||
doCheck = false; | ||
|
||
buildTarget = "./cmd/nao"; | ||
ldflags = ["-X main.version=${version}"]; | ||
|
||
nativeBuildInputs = [ | ||
installShellFiles | ||
]; | ||
|
||
postInstall = '' | ||
installShellCompletion --cmd nao \ | ||
--bash <($out/bin/nao --debug completion bash) \ | ||
--fish <($out/bin/nao --debug completion fish) \ | ||
--zsh <($out/bin/nao --debug completion zsh) | ||
''; | ||
|
||
meta = with lib; { | ||
description = "A CLI tool to take notes without worrying about the path where the file is"; | ||
homepage = "https://github.com/luisnquin/nao"; | ||
license = licenses.mit; | ||
maintainers = with maintainers; [luisnquin]; | ||
}; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
description = "A CLI tool to take notes without worrying about the path where the file is"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = inputs: | ||
with inputs; | ||
flake-utils.lib.eachDefaultSystem ( | ||
system: let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
}; | ||
|
||
defaultPackage = pkgs.callPackage ./default.nix {}; | ||
in { | ||
inherit defaultPackage; | ||
|
||
defaultApp = flake-utils.lib.mkApp { | ||
drv = defaultPackage; | ||
}; | ||
|
||
devShell = pkgs.mkShell { | ||
buildInputs = [defaultPackage]; | ||
}; | ||
} | ||
); | ||
} |