2023-09-21 12:17:01 +01:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
|
|
cargo2nix.url = "github:cargo2nix/cargo2nix";
|
|
|
|
devshell.url = "github:numtide/devshell";
|
|
|
|
devshell.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = inputs@{ nixpkgs, flake-parts, rust-overlay, cargo2nix, devshell, ... }:
|
|
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
|
|
imports = [
|
|
|
|
inputs.flake-parts.flakeModules.easyOverlay
|
|
|
|
devshell.flakeModule
|
|
|
|
];
|
|
|
|
systems = [ "x86_64-linux" ];
|
|
|
|
perSystem = { inputs', system, pkgs, config, ... }:
|
|
|
|
let
|
2023-09-29 14:22:13 +01:00
|
|
|
binlessFuse = pkgs.fuse3.overrideAttrs (old: {
|
|
|
|
postFixup = old.postFixup + ''
|
|
|
|
rm -r "$out"/{,s}bin
|
|
|
|
'';
|
|
|
|
});
|
2023-09-21 12:17:01 +01:00
|
|
|
rustPkgs = pkgs.rustBuilder.makePackageSet {
|
|
|
|
rustToolchain = pkgs.rust-bin.stable."1.72.1".default;
|
|
|
|
packageFun = import ./Cargo.nix;
|
2023-09-24 10:41:54 +01:00
|
|
|
packageOverrides = pkgs: pkgs.rustBuilder.overrides.all ++ [
|
|
|
|
(pkgs.rustBuilder.rustLib.makeOverride {
|
|
|
|
name = "fuser";
|
|
|
|
overrideAttrs = drv: {
|
|
|
|
propagatedBuildInputs = drv.propagatedBuildInputs ++ [
|
2023-09-29 14:22:13 +01:00
|
|
|
binlessFuse
|
2023-09-24 10:41:54 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
})
|
|
|
|
];
|
2023-09-21 12:17:01 +01:00
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
_module.args.pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [
|
2023-09-24 10:41:54 +01:00
|
|
|
devshell.overlays.default
|
2023-09-21 12:17:01 +01:00
|
|
|
cargo2nix.overlays.default
|
|
|
|
rust-overlay.overlays.default
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
overlayAttrs = {
|
|
|
|
inherit (config.packages) quicfs;
|
|
|
|
};
|
|
|
|
packages = rec {
|
|
|
|
quicfs = (rustPkgs.workspace.quicfs { }).bin;
|
|
|
|
default = quicfs;
|
|
|
|
};
|
|
|
|
devshells.default = {
|
2023-09-24 10:41:54 +01:00
|
|
|
imports = [ "${pkgs.devshell.extraModulesDir}/language/c.nix" ];
|
|
|
|
language.c = with pkgs; rec {
|
|
|
|
compiler = gcc;
|
|
|
|
libraries = [
|
2023-09-29 14:22:13 +01:00
|
|
|
binlessFuse
|
2023-09-24 10:41:54 +01:00
|
|
|
];
|
|
|
|
includes = libraries;
|
|
|
|
};
|
2023-09-21 12:17:01 +01:00
|
|
|
packagesFrom = [
|
|
|
|
(rustPkgs.workspaceShell { })
|
|
|
|
];
|
|
|
|
packages = [
|
|
|
|
inputs'.cargo2nix.packages.default
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|