Commit Graph

34 Commits

Author SHA1 Message Date
John Titor
73a271e130
nix: add meta.mainProgram to allow directly running from this repo 2024-07-31 22:37:13 +05:30
Thomas Mühlbacher
fb6a56bb81 fix(nix): silence trace from treefmt-nix
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-07-30 23:35:39 +02:00
Thomas Mühlbacher
b105a566ec ci: disable treefmt-check
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-07-21 01:54:10 +02:00
Kent Overstreet
0f9b409aee add i686-linux to nix flake
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-12 14:14:55 -04:00
Thomas Mühlbacher
b46d3a2710 fix(nix): install paths from pkg-config properly
Because we were using `DESTDIR` instead of `PREFIX` for some reason, no
one noticed that this didn't work.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-17 18:31:40 +02:00
Thomas Mühlbacher
2a15fc0445 build(nix): use actual commit rev in version
This way we get an actually unique version for every version that can be
traced back to the source.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-10 00:04:13 +02:00
Thomas Mühlbacher
990437ad13 build(nix): add bear to dev shell
A useful addition to make sure is available, since we also make clangd
available through clang-tools. bear can generate the
`compile_commands.json` for clangd. For example with `make clean && bear
-- make -j$(nproc)`.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-10 00:04:13 +02:00
Thomas Mühlbacher
8cd17b40df build(nix): make package version more accurate
Would still be better to have commit rev included if
applicable/available but still better than before.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-31 14:49:39 +02:00
Thomas Mühlbacher
7f15685517 build(nix): minor tweaks
- rm unused function argument

- `LIBCLANG_PATH` is superfluous here, this is already handled by
  `rustPlatform.bindgenHook` for us.

- rustc is not directly needed in the `$PATH` for the build but it's
  good to have in the dev shell.
2024-05-28 19:32:53 +02:00
Thomas Mühlbacher
b362f12add build(nix): add cargo test check
this is pretty much a no-op currently, but hopefully we can make some
use of it in the future.
2024-05-28 19:32:53 +02:00
Thomas Mühlbacher
422ae1f1a7 build(nix): add cargo clippy check
note that this only checks the top-level package, `bch_bindgen` is
excluded because it has too many clippy lints.
2024-05-28 19:32:53 +02:00
Thomas Mühlbacher
bf2c0c8852 build(nix): use crane to build packages
this enables faster incremental rebuilds in nix. it also allows us to
add clippy and cargo test checks more easily. aside from that, i have
tried to carry over things that i think are sensible from the previous
`mkDerivation` call.

the `checkPhase` may as well rather be done in a `installCheckPhase` and
we can set `enableParallelBuilding` to speed up the compilation of
`libbcachefs.a`.
2024-05-28 19:32:15 +02:00
Thomas Mühlbacher
ce01c61ba5 build(nix): enable rustfmt check+formatter
with this, the gh actions ci will fail if submitted code does not adhere
to rustfmt rules.

additionally, running `nix fmt` will also format rust code.

because we want rules only supported by nightly rustfmt, and nixpkgs
doesn't have a nightly toolchain, we need to pull in another flake
input: fenix.
2024-05-27 19:30:26 -04:00
Thomas Mühlbacher
56a9580aeb build(nix): add some packages to the dev shell
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
2e316499df build(nix): add treefmt-nix
currently still bare but can be extended with a number of different
formatters (rustfmt, clang-format, ...). For full list see
https://flake.parts/options/treefmt-nix

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
cc16402e4f build(nix): replace flake-utils with flake-parts
it also provides a way for abstracting `system` and provides optional
modules, like treefmt-nix.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
0fcdd67bf0 build(nix): rm nixpkgs overlay
it shouldn't really be our job to define an overlay. it doesn't do
anything for us, afaict, and is trivial to implement for downstream
users of the flake if they so desire.

also the overlay doesn't even overlay anything, there is no package
called `bcachefs` in nixpkgs.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
5e9d1953a2 build(nix): simplify devShell
much more DRY.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
eccefb381d style(nix): group together inputs attr
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
b91647aab8 style(nix): run nix fmt
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Thomas Mühlbacher
e94c985640 build(nix): switch to new RFC style nixfmt
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-22 22:35:05 +02:00
Finn Behrens
e6b578917f nix: add bcachefs-fuse package
Add a fuseSupport argument and bcachefs-fuse as flake output with fuse enabled.

Signed-off-by: Finn Behrens <me@kloenk.de>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-20 15:13:17 -05:00
Finn Behrens
61134a06fa nix: add devShell
Add a nix devShell output to provide a development environment for nix users.

Signed-off-by: Finn Behrens <me@kloenk.de>
2023-11-09 23:13:43 +01:00
Finn Behrens
813310c343 nix: fix build add overlay and formatter to flake
Adds overlay flake output to expose the bcachefs package
and add and run a nix formatter.

Co-authored-by: Leona Maroni <dev@leona.is>
Signed-off-by: Leona Maroni <dev@leona.is>
Signed-off-by: Finn Behrens <me@kloenk.de>
2023-11-09 22:09:33 +01:00
Daniel Hill
bf359ac1ad nix fix up! Rust now integrated into bcachefs binary
Heavily simplified to just call make with the required rust dependencies.

Signed-off-by: Daniel Hill <daniel@gluo.nz>
2023-02-27 16:39:46 +13:00
Kent Overstreet
10c609ac94 fixup! Rust now integrated into bcachefs binary 2023-02-21 03:02:06 -05:00
Daniel Hill
3c39b422ac fixup! nix: overhaul build system.
Signed-off-by: Daniel Hill <daniel@gluo.nz>
2023-01-31 12:10:36 +13:00
Daniel Hill
9a44c6d4d0 nix: overhaul build system.
Removed outdated overlay.
Simply build tooling using bingenHook and propagated*Inputs

Signed-off-by: Daniel Hill <daniel@gluo.nz>
2023-01-03 16:58:55 +13:00
Kayla Firestack
ca3a42a70c flake.nix: add boot stage1 module test, which takes a long time to build
Signed-off-by: Kayla Firestack <dev@kaylafire.me>
2021-10-20 14:47:28 -04:00
Kayla Firestack
c229fa7075 flake.nix: add netboot-bcachefs nixosSystem definition
define example bcachefs enabled nixos installer
allows netboot to nixos installer with bcachefs kernel and -tools installed

Signed-off-by: Kayla Firestack <dev@kaylafire.me>
2021-10-20 14:47:28 -04:00
Kayla Firestack
fa27037e70 flake.nix: add nixosModules
Signed-off-by: Kayla Firestack <dev@kaylafire.me>
2021-10-20 14:47:28 -04:00
Kayla Firestack
96f55bdb32 flake.nix: add mount developer environment
Signed-off-by: Kayla Firestack <dev@kaylafire.me>
2021-10-20 14:47:28 -04:00
Kayla Firestack
1f8fc31ddc split mount into a library crate for rust reuse
update makefile to output shared library and rust build
fix default.nix to properly get the binary name for `ln`ing - move binary to main.rs
add rustfmt and gitignore files
move build.rs file into bch_bindgen for reuse between projects
add outputs to nix flake and checks
add mount.toml to makefile
2021-10-18 16:30:52 -04:00
Kayla Firestack
5625937162 add nix flake with checks, overlay, and default package 2021-10-18 11:30:30 -04:00