nix: remove naersk
This commit is contained in:
parent
7f53459116
commit
8b648f422e
4 changed files with 15 additions and 61 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
@ -0,0 +1 @@
|
|||
use flake
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
|||
/target
|
||||
|
||||
.direnv/
|
||||
|
|
36
flake.lock
36
flake.lock
|
@ -1,39 +1,6 @@
|
|||
{
|
||||
"nodes": {
|
||||
"naersk": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1659610603,
|
||||
"narHash": "sha256-LYgASYSPYo7O71WfeUOaEUzYfzuXm8c8eavJcel+pfI=",
|
||||
"owner": "nix-community",
|
||||
"repo": "naersk",
|
||||
"rev": "c6a45e4277fa58abd524681466d3450f896dc094",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "master",
|
||||
"repo": "naersk",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1661008273,
|
||||
"narHash": "sha256-UpDqsGzUswIHG7FwzeIewjWlElF17UVLNbI2pwlbcBY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0cc6444e74cd21e8da8d81ef4cd778492e10f843",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1661008273,
|
||||
"narHash": "sha256-UpDqsGzUswIHG7FwzeIewjWlElF17UVLNbI2pwlbcBY=",
|
||||
|
@ -51,8 +18,7 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"naersk": "naersk",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"utils": "utils"
|
||||
}
|
||||
},
|
||||
|
|
37
flake.nix
37
flake.nix
|
@ -1,45 +1,30 @@
|
|||
{
|
||||
inputs = {
|
||||
naersk.url = "github:nix-community/naersk/master";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, utils, naersk }:
|
||||
outputs = { self, nixpkgs, utils }:
|
||||
utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
name = "tas";
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
naersk-lib = pkgs.callPackage naersk { };
|
||||
cargoToml = with builtins; (fromTOML (readFile ./Cargo.toml));
|
||||
in
|
||||
rec {
|
||||
# Executes by `nix build .#<name>`
|
||||
packages = {
|
||||
${name} = naersk.lib.${system}.buildPackage {
|
||||
pname = name;
|
||||
root = ./.;
|
||||
};
|
||||
packages.default = pkgs.rustPlatform.buildRustPackage {
|
||||
inherit (cargoToml.package) name version;
|
||||
src = nixpkgs.lib.cleanSource ./.;
|
||||
doCheck = true;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
};
|
||||
# Executes by `nix build .`
|
||||
packages.default = packages.${name};
|
||||
# the same but deprecated in Nix 2.7
|
||||
defaultPackage = packages.default;
|
||||
|
||||
# Executes by `nix run .#<name> -- <args?>`
|
||||
apps = {
|
||||
${name} = utils.lib.mkApp {
|
||||
inherit name;
|
||||
drv = packages.${name};
|
||||
};
|
||||
apps.default = utils.lib.mkApp {
|
||||
inherit (cargoToml.package) name;
|
||||
drv = packages.default;
|
||||
};
|
||||
# Executes by `nix run . -- <args?>`
|
||||
apps.default = apps.${name};
|
||||
# the same but deprecated in Nix 2.7
|
||||
defaultApp = apps.default;
|
||||
|
||||
# Used by `nix develop`
|
||||
devShell = with pkgs; mkShell {
|
||||
buildInputs = [ cargo rustc rustfmt rustPackages.clippy ];
|
||||
packages = [ cargo rustc rustfmt clippy rust-analyzer ];
|
||||
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue