summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.lock30
-rw-r--r--flake.nix8
-rw-r--r--src/bcachefs.rs8
3 files changed, 29 insertions, 17 deletions
diff --git a/flake.lock b/flake.lock
index 9bf04d38..ba4887e2 100644
--- a/flake.lock
+++ b/flake.lock
@@ -7,11 +7,11 @@
]
},
"locked": {
- "lastModified": 1721322122,
- "narHash": "sha256-a0G1NvyXGzdwgu6e1HQpmK5R5yLsfxeBe07nNDyYd+g=",
+ "lastModified": 1721842668,
+ "narHash": "sha256-k3oiD2z2AAwBFLa4+xfU+7G5fisRXfkvrMTCJrjZzXo=",
"owner": "ipetkov",
"repo": "crane",
- "rev": "8a68b987c476a33e90f203f0927614a75c3f47ea",
+ "rev": "529c1a0b1f29f0d78fa3086b8f6a134c71ef3aaf",
"type": "github"
},
"original": {
@@ -28,11 +28,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
- "lastModified": 1721456965,
- "narHash": "sha256-AJjRiL2diAitpARbE9bUTlgtqHC8QS1ImXNaXMRhKoU=",
+ "lastModified": 1722320953,
+ "narHash": "sha256-DfGaJtgrzcwPQYLTvjL1KaVIjpvi85b2MpM6yEGvJzM=",
"owner": "nix-community",
"repo": "fenix",
- "rev": "d3121c162a1fa4fabcb9af9642d50e8b05ddfe83",
+ "rev": "483df76def3e5010d709aa3a0418ba2088503994",
"type": "github"
},
"original": {
@@ -77,11 +77,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1721379653,
- "narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=",
+ "lastModified": 1722185531,
+ "narHash": "sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k=",
"owner": "nixos",
"repo": "nixpkgs",
- "rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374",
+ "rev": "52ec9ac3b12395ad677e8b62106f0b98c1f8569d",
"type": "github"
},
"original": {
@@ -116,11 +116,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
- "lastModified": 1721414716,
- "narHash": "sha256-23zmEelXzAvnfMlLsJ6a6P7yNiI9WOUrS9xh9dXVc/U=",
+ "lastModified": 1722262053,
+ "narHash": "sha256-KxjkPVn9rQqYam6DhiN/V2NcMXtYW25maxkJoiVMpmE=",
"owner": "rust-lang",
"repo": "rust-analyzer",
- "rev": "b333f85a9dc06a45d9eb126c6371414c49b46784",
+ "rev": "a021b85be57d34b1eed687fcafd5d5ec64b2d853",
"type": "github"
},
"original": {
@@ -137,11 +137,11 @@
]
},
"locked": {
- "lastModified": 1721458737,
- "narHash": "sha256-wNXLQ/ATs1S4Opg1PmuNoJ+Wamqj93rgZYV3Di7kxkg=",
+ "lastModified": 1722330636,
+ "narHash": "sha256-uru7JzOa33YlSRwf9sfXpJG+UAV+bnBEYMjrzKrQZFw=",
"owner": "numtide",
"repo": "treefmt-nix",
- "rev": "888bfb10a9b091d9ed2f5f8064de8d488f7b7c97",
+ "rev": "768acdb06968e53aa1ee8de207fd955335c754b7",
"type": "github"
},
"original": {
diff --git a/flake.nix b/flake.nix
index c670e51f..4aa66a86 100644
--- a/flake.nix
+++ b/flake.nix
@@ -107,6 +107,12 @@
zlib
zstd
];
+
+ meta = {
+ description = "Userspace tools for bcachefs";
+ license = lib.licenses.gpl2Only;
+ mainProgram = "bcachefs";
+ };
};
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // { pname = cargoToml.package.name; });
@@ -195,7 +201,7 @@
flakeCheck = false;
programs = {
- nixfmt-rfc-style.enable = true;
+ nixfmt.enable = true;
rustfmt.edition = rustfmtToml.edition;
rustfmt.enable = true;
rustfmt.package = fenix.packages.${system}.default.rustfmt;
diff --git a/src/bcachefs.rs b/src/bcachefs.rs
index 0e70d135..0072ca44 100644
--- a/src/bcachefs.rs
+++ b/src/bcachefs.rs
@@ -9,6 +9,7 @@ use std::{
};
use bch_bindgen::c;
+use log::debug;
#[derive(Debug)]
pub struct ErrnoError(pub errno::Errno);
@@ -110,6 +111,11 @@ fn main() -> ExitCode {
"list" => commands::list(args[1..].to_vec()).report(),
"mount" => commands::mount(args, symlink_cmd).report(),
"subvolume" => commands::subvolume(args[1..].to_vec()).report(),
- _ => ExitCode::from(u8::try_from(handle_c_command(args, symlink_cmd)).unwrap()),
+ _ => {
+ let r = handle_c_command(args, symlink_cmd);
+
+ debug!("return code from C command: {r}");
+ ExitCode::from(r as u8)
+ }
}
}