Add empty rust env

main
Cyryl Płotnicki 2022-04-23 10:11:27 +01:00
commit b70499a54b
5 changed files with 162 additions and 0 deletions

2
.envrc Normal file
View File

@ -0,0 +1,2 @@
use flake

2
.hgignore Normal file
View File

@ -0,0 +1,2 @@
.direnv

91
flake.lock Normal file
View File

@ -0,0 +1,91 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1641205782,
"narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"naersk": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1639947939,
"narHash": "sha256-pGsM8haJadVP80GFq4xhnSpNitYNQpaXk4cnA796Cso=",
"owner": "nix-community",
"repo": "naersk",
"rev": "2fc8ce9d3c025d59fee349c1f80be9785049d653",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "naersk",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1646470760,
"narHash": "sha256-dQISyucVCCPaFioUhy5ZgfBz8rOMKGI8k13aPDFTqEs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1fc7212a2c3992eedc6eedf498955c321ad81cc2",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1646470760,
"narHash": "sha256-dQISyucVCCPaFioUhy5ZgfBz8rOMKGI8k13aPDFTqEs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1fc7212a2c3992eedc6eedf498955c321ad81cc2",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"flake-compat": "flake-compat",
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
"utils": "utils"
}
},
"utils": {
"locked": {
"lastModified": 1644229661,
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

53
flake.nix Normal file
View File

@ -0,0 +1,53 @@
{
description = "legdur: verify integrity of large directories over time";
inputs = {
utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, utils, naersk, flake-compat }:
utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
naersk-lib = naersk.lib."${system}";
in rec {
# `nix build`
packages.legdur = naersk-lib.buildPackage {
pname = "legdur";
root = ./.;
};
defaultPackage = packages.legdur;
# `nix run`
apps.legdur = utils.lib.mkApp { drv = packages.legdur; };
defaultApp = apps.legdur;
# `nix develop`
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
cacert
cargo
cargo-edit
cargo-outdated
cargo-release
cargo-tarpaulin
cargo-watch
clippy
git
llvmPackages_13.llvm
nixpkgs-fmt
openssh
openssl
pkg-config
rustc
rustfmt
];
RUST_SRC_PATH =
"${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
};
});
}

14
shell.nix Normal file
View File

@ -0,0 +1,14 @@
(import
(
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{
src = ./.;
}).shellNix