Commit Graph

34 Commits (bf48c10d28d16df6e33027150a24d4b4a32ebeac)

Author SHA1 Message Date
Charles Hall 7c1a3e41d9
add package to build an aarch64 oci image
And build it as an artifact in CI.
5 months ago
Charles Hall 2a04a361e0
break oci image builder into a function
Now it can be reused for different `pkgs` and `package`s.
5 months ago
Charles Hall 0e8e4f1083
add static cross to aarch64-unknown-linux-musl 5 months ago
Charles Hall 81ae579b25
add static cross to x86_64-unknown-linux-musl 5 months ago
Charles Hall 3a3cafe912
preempt cross problems by using my crane fork
I imagine this will get fixed/merged upstream in the near future.
5 months ago
Charles Hall d29591d47d
group packages in attrset literal
This will make generating packages for cross possible.
5 months ago
Charles Hall 67d280dd2e
factor package expression into a function
We'll need to call it repeatedly to make packages for cross.
5 months ago
Charles Hall 52954f7a11
use fromToolchainFile
I *think* this will make it easier to pull in extra rustc targets.
5 months ago
Charles Hall 692a31620d
make let bindings take pkgs as an argument
Again, will make cross compilation easier to set up.
5 months ago
Charles Hall cf4015b830
rename pkgs to pkgsHost
This will make organizing cross compilation easier.
5 months ago
Charles Hall 9cef03127b
remove `with` for `nativeBuildInputs`
It's going to get more involved and that `with` was too specific.
5 months ago
Charles Hall 249fc7769d
don't bother with mold
For now, at least. I suspect it will make cross compilation more
difficult.
5 months ago
Charles Hall bdc46f6392
add script to build and push to binary cache
This is even useful for local development, as you can pre-populate the
binary cache before running CI (assuming you have the token). Also, it
being in a script makes it easier to test.

We've added attic as a flake input even though the flake itself doesn't
use it so that we can use `--inputs-from .` in Nix commands to reference
a locked version of attic. This helps with reproducibility and caching,
and to makes it easy to update attic because it's part of the normal
flake lifecycle.
5 months ago
Charles Hall 4de54db305
redo docker image and build it in ci 5 months ago
Charles Hall 02781e4f9b
use nix-filter to filter sources
This prevents nix from rebuilding conduit when files that don't actually
effect the build are changed.
5 months ago
Charles Hall f8bdfd82b0
update flake.lock
Flake lock file updates:

• Updated input 'crane':
    'github:ipetkov/crane/8b08e96c9af8c6e3a2b69af5a7fa168750fcf88e' (2023-07-07)
  → 'github:ipetkov/crane/742170d82cd65c925dcddc5c3d6185699fbbad08' (2024-01-18)
• Removed input 'crane/flake-compat'
• Removed input 'crane/flake-utils'
• Removed input 'crane/rust-overlay'
• Removed input 'crane/rust-overlay/flake-utils'
• Removed input 'crane/rust-overlay/nixpkgs'
• Updated input 'fenix':
    'github:nix-community/fenix/39096fe3f379036ff4a5fa198950b8e79defe939' (2023-07-16)
  → 'github:nix-community/fenix/e132ea0eb0c799a2109a91688e499d7bf4962801' (2024-01-18)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/996e054f1eb1dbfc8455ecabff0f6ff22ba7f7c8' (2023-07-15)
  → 'github:rust-lang/rust-analyzer/9d9b34354d2f13e33568c9c55b226dd014a146a0' (2024-01-17)
• Updated input 'flake-utils':
    'github:numtide/flake-utils/919d646de7be200f3bf08cb76ae1f09402b6f9b4' (2023-07-11)
  → 'github:numtide/flake-utils/1ef2e671c3b0c19053962c07dbda38332dcebf26' (2024-01-15)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/8acef304efe70152463a6399f73e636bcc363813' (2023-07-15)
  → 'github:NixOS/nixpkgs/842d9d80cfd4560648c785f8a4e6f3b096790e19' (2024-01-17)
5 months ago
Charles Hall 6f052fff98
improve nix flake
Also fix the comment in `Cargo.toml` about the rust-version stuff.
5 months ago
Charles Hall e8ac881b2f
add an engage file
See <https://charles.page.computer.surgery/engage/> for info.
5 months ago
Charles Hall 742331e054
Revert "only use musl on x86_64"
This reverts commit 56f0f3dfa4.

This shouldn't be needed anymore since [this][0] reached nixos-unstable.

[0]: https://github.com/NixOS/nixpkgs/pull/242889
12 months ago
Charles Hall abd8e1bf54
nixpkgs' rocksdb is now new enough :)
This reverts commit abd0a014e8.
12 months ago
Charles Hall 56f0f3dfa4
only use musl on x86_64
Since that's all I've tested it on. Apparently this caused issues on
aarch64 even though it allegedly shouldn't.
12 months ago
Charles Hall abd0a014e8
nixpkgs' rocksdb is too old :( 1 year ago
Charles Hall 4a7d3c7301
upgrade rust in Cargo.toml/flake.nix
Looks like this should've happened as part of !479.
1 year ago
Charles Hall 15e60818c9
pin nixos-unstable, update flake.lock
`nixos-unstable` is the rolling release channel of NixOS. The default is
the master branch, which doesn't always have a populated binary cache
and so may result in compiling a bunch of stuff unnecessarily.
1 year ago
Charles Hall eb4323cc0f
use mold on linux 1 year ago
Charles Hall a6712627e4
tiny refactor 1 year ago
Charles Hall 3be32c4dac
factor out shared things 1 year ago
Charles Hall 55149e3336
use crane instead of naersk
I guess naersk still doesn't support git dependencies using workspace
inheritance, but crane does.
1 year ago
Charles Hall 2b63e46fc5
use system rocksdb
This mostly just improves build times.
1 year ago
Charles Hall c997311bea
Revert "build(nix): fix flake builds"
This reverts commit 5d913f7010.

Sorry, I don't understand how any of this works, and it seems pretty
opaque/difficult to fine-tune.
1 year ago
Yusuf Bera Ertan 5d913f7010
build(nix): fix flake builds 1 year ago
Charles Hall 315944968b
remind people to update the hash
And offer help since it's pretty easy but impossible if you don't have
Nix installed.
2 years ago
Charles Hall 0a4e8e5909
update rust toolchain hash 2 years ago
Charles Hall fe7d8c4f12
add nix flake
Also add `.envrc` for direnv + Nix users. This makes developing locally
easier for us NixOS folks.

The flake itself will allow NixOS users to pull code directly from
Conduit's repository, making it completely trivial to stay up-to-date
with every commit.

I'd also like to add a NixOS module directly to this repository at some
point so that new configuration options will be available in the NixOS
module faster. But for now, NixOS users can simply override
`serivces.matrix-conduit.package` and get pretty much all the
functionality.

I've added myself to the `CODEOWNERS` file for the Nix files, since I am
willing to maintain this stuff. I use Conduit on NixOS so I'm personally
invested in having this work.

Lastly, `.gitignore` was updated to exclude symlinks created by `direnv`
and `nix build` and other such Nix commands.

This doesn't come without maintenance burden, however:

* The `sha256` in `flake.nix` will need to be updated whenever Conduit's
  MSRV is updated, but that should be pretty infrequent.

* `nix flake update` should be run every so often to pull in updates to
  `nixpkgs` and other flake inputs. I think downstream users can also
  override this themselves with `inputs.<name>.inputs.<name>.follows`.

* `nix flake check` should be run in CI to ensure Nix builds keep
  working.

* `nixpkgs-fmt --check $(fd '\.nix')` (or similar) should be run in CI
  to ensure style uniformity.
2 years ago