feat: Package program with nix

This commit is contained in:
lwad 2023-11-24 22:05:59 +00:00
parent 6980d07d8f
commit bf4fa2c6d0
4 changed files with 56 additions and 0 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/target
/result

24
flake.lock Normal file
View File

@ -0,0 +1,24 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1700678569,
"narHash": "sha256-2Ki+2UvOidxEb3xB4ADqlbPQ2BZOF4uZMR094O8or2I=",
"path": "/nix/store/jbw0627xpxp92zmlhlry1hra99dacxdf-source",
"rev": "8f1180704ac35baded1a74164365ac7cdfba6f38",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

10
flake.nix Normal file
View File

@ -0,0 +1,10 @@
{
description = "A tmux session navigator written in Rust.";
inputs.nixpkgs.url = "nixpkgs";
outputs = { self, nixpkgs }:
{
packages = nixpkgs.lib.mapAttrs (system: pkgs: {
default = pkgs.callPackage ./package.nix {};
}) nixpkgs.legacyPackages;
};
}

21
package.nix Normal file
View File

@ -0,0 +1,21 @@
{ fetchFromGitea, rustPlatform }:
rustPlatform.buildRustPackage rec {
pname = "navigation";
version = "1.0.0";
src = fetchFromGitea {
domain = "git.disroot.org";
owner = "lwad";
repo = pname;
rev = version;
hash = "sha256-B882aL9Y0bLWhIfNoZNuW1WRri0Nwv5GpbNe5jxzGOE=";
};
cargoHash = "sha256-VDz3S8Akf9VGMFmBe01oAIkMClMjj4xF4DYS88RPQVg=";
meta = {
description = "A tmux session navigator written in Rust.";
homepage = "https://git.disroot.org/lwad/navigator";
};
}