mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-01-22 00:04:31 +03:00
style(nix): run nix fmt
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
This commit is contained in:
parent
e94c985640
commit
b91647aab8
37
build.nix
37
build.nix
@ -1,12 +1,31 @@
|
||||
{ lib, stdenv, pkg-config, attr, libuuid, libsodium, keyutils, liburcu, zlib
|
||||
, libaio, udev, zstd, lz4, nix-gitignore, rustPlatform, rustc, cargo, fuse3
|
||||
, fuseSupport ? false, }:
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
pkg-config,
|
||||
attr,
|
||||
libuuid,
|
||||
libsodium,
|
||||
keyutils,
|
||||
liburcu,
|
||||
zlib,
|
||||
libaio,
|
||||
udev,
|
||||
zstd,
|
||||
lz4,
|
||||
nix-gitignore,
|
||||
rustPlatform,
|
||||
rustc,
|
||||
cargo,
|
||||
fuse3,
|
||||
fuseSupport ? false,
|
||||
}:
|
||||
let
|
||||
src = nix-gitignore.gitignoreSource [ ] ./.;
|
||||
|
||||
commit = lib.strings.substring 0 7 (builtins.readFile ./.bcachefs_revision);
|
||||
version = "git-${commit}";
|
||||
in stdenv.mkDerivation {
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
inherit src version;
|
||||
|
||||
pname = "bcachefs-tools";
|
||||
@ -39,11 +58,13 @@ in stdenv.mkDerivation {
|
||||
# when git-based crates are updated, run:
|
||||
# nix run github:Mic92/nix-update -- --version=skip --flake default
|
||||
# to update the hashes
|
||||
cargoDeps = rustPlatform.importCargoLock {
|
||||
lockFile = "${src}/Cargo.lock";
|
||||
};
|
||||
cargoDeps = rustPlatform.importCargoLock { lockFile = "${src}/Cargo.lock"; };
|
||||
|
||||
makeFlags = [ "DESTDIR=${placeholder "out"}" "PREFIX=" "VERSION=${commit}" ];
|
||||
makeFlags = [
|
||||
"DESTDIR=${placeholder "out"}"
|
||||
"PREFIX="
|
||||
"VERSION=${commit}"
|
||||
];
|
||||
|
||||
dontStrip = true;
|
||||
checkPhase = "./target/release/bcachefs version";
|
||||
|
15
default.nix
15
default.nix
@ -1,6 +1,9 @@
|
||||
(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 = ./.; }).defaultNix
|
||||
(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 = ./.; }).defaultNix
|
||||
|
48
flake.nix
48
flake.nix
@ -9,18 +9,25 @@
|
||||
flake = false;
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, utils, ... }:
|
||||
outputs =
|
||||
{
|
||||
overlays.default = final: prev: {
|
||||
bcachefs = final.callPackage ./build.nix { };
|
||||
};
|
||||
} // utils.lib.eachDefaultSystem (system:
|
||||
self,
|
||||
nixpkgs,
|
||||
utils,
|
||||
...
|
||||
}:
|
||||
{
|
||||
overlays.default = final: prev: { bcachefs = final.callPackage ./build.nix { }; };
|
||||
}
|
||||
// utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlays.default ];
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
inherit (pkgs) bcachefs;
|
||||
bcachefs-fuse = pkgs.bcachefs.override { fuseSupport = true; };
|
||||
@ -29,12 +36,31 @@
|
||||
|
||||
formatter = pkgs.nixfmt-rfc-style;
|
||||
|
||||
devShells.default = pkgs.callPackage ({ mkShell, rustc, cargo, gnumake
|
||||
, gcc, clang, pkg-config, libuuid, libsodium, keyutils, liburcu, zlib
|
||||
, libaio, zstd, lz4, udev, bcachefs }:
|
||||
devShells.default = pkgs.callPackage (
|
||||
{
|
||||
mkShell,
|
||||
rustc,
|
||||
cargo,
|
||||
gnumake,
|
||||
gcc,
|
||||
clang,
|
||||
pkg-config,
|
||||
libuuid,
|
||||
libsodium,
|
||||
keyutils,
|
||||
liburcu,
|
||||
zlib,
|
||||
libaio,
|
||||
zstd,
|
||||
lz4,
|
||||
udev,
|
||||
bcachefs,
|
||||
}:
|
||||
mkShell {
|
||||
LIBCLANG_PATH = "${clang.cc.lib}/lib";
|
||||
inherit (bcachefs) nativeBuildInputs buildInputs;
|
||||
}) { };
|
||||
});
|
||||
}
|
||||
) { };
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user