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