This repository has been archived by the owner on Dec 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathflake.nix
52 lines (43 loc) · 1.46 KB
/
flake.nix
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
48
49
50
51
52
rec {
description = "Mount Microsoft OneDrive storage as FUSE filesystem";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
inherit (nixpkgs) lib;
pkgs = nixpkgs.legacyPackages.${system};
manifest = lib.importTOML (self + "/Cargo.toml");
in {
packages = rec {
${default.name} = default;
default = pkgs.rustPlatform.buildRustPackage {
pname = manifest.package.name;
version = manifest.package.version;
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [ fuse3 openssl ];
src = self;
cargoLock.lockFile = self + "/Cargo.lock";
meta = {
inherit description;
homepage = manifest.package.repository;
license = lib.licenses.gpl3Only;
};
};
};
devShells = rec {
default = pkgs.mkShell {
inputsFrom = [ self.packages.${system}.default ];
RUST_BACKTRACE = 1;
};
without-rust = default.overrideAttrs (old: {
nativeBuildInputs =
lib.filter
(drv: builtins.match ".*(rustc|cargo).*" drv.name == null)
old.nativeBuildInputs;
});
};
});
}