-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
47 lines (45 loc) · 1.3 KB
/
Copy pathflake.nix
File metadata and controls
47 lines (45 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
notecli = pkgs.rustPlatform.buildRustPackage {
pname = "notecli";
version = (pkgs.lib.importTOML ./Cargo.toml).package.version;
src = ./.;
# Cargo.lock から依存を決定的に解決する。
# 依存を追加してもハッシュ手動更新は不要 (cargoHash 方式の破綻を回避)。
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs =
with pkgs;
[ openssl ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.SystemConfiguration
];
buildNoDefaultFeatures = true;
};
in
{
packages.default = notecli;
devShells.default = pkgs.mkShell {
inputsFrom = [ notecli ];
packages = with pkgs; [
rust-analyzer
clippy
];
};
}
);
}