summaryrefslogtreecommitdiffstats
path: root/flake.nix
diff options
context:
space:
mode:
authorCyborus <cyborus@noreply.codeberg.org>2024-08-10 17:19:01 +0200
committerCyborus <cyborus@noreply.codeberg.org>2024-08-10 17:19:01 +0200
commitfd6dd52728abb150e56a3fb7f122a699a28d132c (patch)
treef3aadfccd3f2f4722393ee40a59dfbaec95514ce /flake.nix
parentMerge pull request 'bump version to 0.1.1' (#117) from bump-0.1.1 into main (diff)
parentdocs: add Nix instructions to README (diff)
downloadforgejo-cli-fd6dd52728abb150e56a3fb7f122a699a28d132c.tar.xz
forgejo-cli-fd6dd52728abb150e56a3fb7f122a699a28d132c.zip
Merge pull request 'feat: add Nix flake' (#118) from LordMZTE/forgejo-cli:nix-flake into main
Reviewed-on: https://codeberg.org/Cyborus/forgejo-cli/pulls/118 Reviewed-by: Cyborus <cyborus@noreply.codeberg.org>
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..885922e
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,44 @@
+{
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+ utils.url = "github:numtide/flake-utils";
+ };
+
+ outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system:
+ let
+ pkgs = import nixpkgs { inherit system; };
+ in
+ rec {
+ packages.forgejo-cli = pkgs.rustPlatform.buildRustPackage {
+ pname = "forgejo-cli";
+ version = "0.1.1";
+ src = pkgs.lib.cleanSource ./.;
+
+ cargoLock.lockFile = ./Cargo.lock;
+
+ nativeBuildInputs = with pkgs; [ pkg-config ];
+ buildInputs = with pkgs; [ openssl ];
+
+ meta = with pkgs.lib; {
+ description = "CLI tool for Forgejo";
+ homepage = "https://codeberg.org/Cyborus/forgejo-cli/";
+ license = with licenses; [ asl20 /* or */ mit ];
+ };
+ };
+
+ packages.default = packages.forgejo-cli;
+
+ devShells.default = pkgs.mkShell {
+ inputsFrom = [ packages.default ];
+
+ nativeBuildInputs = with pkgs; [
+ cargo
+ rustc
+ ];
+
+ # Required for rust-analyzer to work
+ RUST_SRC_PATH = "${pkgs.rustPlatform.rustcSrc}/library";
+ };
+ });
+}
+