mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-22 00:00:03 +03:00
Simplify Nix(OS) development
Signed-off-by: Daniel B. Hill <daniel@gluo.nz>
This commit is contained in:
parent
03ed64edc8
commit
962390c0b2
26
default.nix
26
default.nix
@ -1,6 +1,5 @@
|
|||||||
{ lib
|
{ lib
|
||||||
, filter
|
, doCheck ? true
|
||||||
|
|
||||||
, stdenv
|
, stdenv
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, attr
|
, attr
|
||||||
@ -20,8 +19,7 @@
|
|||||||
, docutils
|
, docutils
|
||||||
, nixosTests
|
, nixosTests
|
||||||
|
|
||||||
, lastModified
|
, versionString ? "0.1"
|
||||||
, versionString ? lastModified
|
|
||||||
|
|
||||||
, inShell ? false
|
, inShell ? false
|
||||||
, debugMode ? inShell
|
, debugMode ? inShell
|
||||||
@ -39,20 +37,8 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
version = "v0.1-flake-${versionString}";
|
version = "v0.1-flake-${versionString}";
|
||||||
VERSION = "v0.1-flake-${versionString}";
|
VERSION = "v0.1-flake-${versionString}";
|
||||||
|
|
||||||
src = filter.filter {
|
src = (lib.cleanSource (builtins.path { name = "bcachefs-tools-src"; path = ./. ;} ));
|
||||||
name = "bcachefs-tools";
|
|
||||||
root = ./.;
|
|
||||||
exclude = [
|
|
||||||
./rust-src
|
|
||||||
|
|
||||||
./.git
|
|
||||||
./nix
|
|
||||||
|
|
||||||
./flake.nix
|
|
||||||
./flake.lock
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
postPatch = "patchShebangs --build doc/macro2rst.py";
|
postPatch = "patchShebangs --build doc/macro2rst.py";
|
||||||
|
|
||||||
@ -95,7 +81,7 @@ stdenv.mkDerivation {
|
|||||||
"INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools"
|
"INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools"
|
||||||
];
|
];
|
||||||
|
|
||||||
doCheck = true; # needs bcachefs module loaded on builder
|
doCheck = doCheck; # needs bcachefs module loaded on builder
|
||||||
|
|
||||||
checkInputs = [
|
checkInputs = [
|
||||||
python39Packages.pytest
|
python39Packages.pytest
|
||||||
@ -116,7 +102,7 @@ stdenv.mkDerivation {
|
|||||||
rm tests/test_fuse.py
|
rm tests/test_fuse.py
|
||||||
'';
|
'';
|
||||||
|
|
||||||
dontStrip = debugMode == true;
|
dontStrip = debugMode;
|
||||||
passthru = {
|
passthru = {
|
||||||
bcachefs_revision = let
|
bcachefs_revision = let
|
||||||
file = builtins.readFile ./.bcachefs_revision;
|
file = builtins.readFile ./.bcachefs_revision;
|
||||||
|
@ -4,7 +4,6 @@ final: prev: {
|
|||||||
tools = final.callPackage ../default.nix {
|
tools = final.callPackage ../default.nix {
|
||||||
testWithValgrind = false;
|
testWithValgrind = false;
|
||||||
filter = filter.lib;
|
filter = filter.lib;
|
||||||
lastModified = builtins.substring 0 8 self.lastModifiedDate;
|
|
||||||
versionString = self.version;
|
versionString = self.version;
|
||||||
};
|
};
|
||||||
toolsValgrind = final.bcachefs.tools.override {
|
toolsValgrind = final.bcachefs.tools.override {
|
||||||
|
18
shell.nix
Normal file
18
shell.nix
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{ kversion ? "linux_5_15"
|
||||||
|
, pkgs ? import <nixpkgs> {} }:
|
||||||
|
|
||||||
|
with pkgs;
|
||||||
|
|
||||||
|
let
|
||||||
|
tools = pkgs.callPackage ./default.nix { doCheck = false ;} ;
|
||||||
|
in
|
||||||
|
mkShell {
|
||||||
|
buildInputs = [
|
||||||
|
linuxKernel.packages.${kversion}.perf
|
||||||
|
gdb
|
||||||
|
ccls # code completion in neovim/emacs
|
||||||
|
];
|
||||||
|
inputsFrom = [
|
||||||
|
tools
|
||||||
|
];
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user