Commit graph

54 commits

Author SHA1 Message Date
Charles Hall
40da74f28c Revert "do default-feature unification in nix"
This reverts commit 8f24ac1f27.

This is no longer necessary since the set of all features is equal to
the set of default features.
2025-07-24 15:09:12 -07:00
Charles Hall
e6dbc293f1 remove jemalloc support
It's no longer being developed and it is very very annoying to maintain
support for.
2025-07-21 21:48:57 -07:00
Lambda
d425ba72f8
Update ruma to 0.12.2 2025-05-04 14:03:46 -07:00
Olivia Lee
1529d60a6a
set default database backend in nixos module to rocksdb
The media backend already has a default value.
2025-04-06 20:06:40 -07:00
Charles Hall
1cd12460d7
make systemd patient for startup
RocksDB compaction can take quite a while if it doesn't happen
regularly, which it doesn't, currently.
2025-04-06 15:46:27 -07:00
Charles Hall
a901d62575
skip checks for deps-only derivation
This is probably a crane bug that it's doing this in the first place.
2025-03-27 16:31:41 -07:00
K900
7ee117d36a fix: update nix inputs, fix build with latest crane
Fixes references to rustc leaking into the binary.

Flake lock file updates:

• Updated input 'attic':
    'github:zhaofengli/attic/47752427561f1c34debb16728a210d378f0ece36' (2024-11-10)
  → 'github:zhaofengli/attic/ff8a897d1f4408ebbf4d45fa9049c06b3e1e3f4e' (2025-02-02)
• Updated input 'crane':
    'github:ipetkov/crane/ef80ead953c1b28316cc3f8613904edc2eb90c28' (2024-11-08)
  → 'github:ipetkov/crane/70947c1908108c0c551ddfd73d4f750ff2ea67cd' (2025-03-19)
• Updated input 'fenix':
    'github:nix-community/fenix/e10ba121773f754a30d31b6163919a3e404a434f' (2024-11-16)
  → 'github:nix-community/fenix/7d9ba794daf5e8cc7ee728859bc688d8e26d5f06' (2025-03-20)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/1b90e979aeee8d1db7fe14603a00834052505497' (2024-11-15)
  → 'github:rust-lang/rust-analyzer/15d87419f1a123d8f888d608129c3ce3ff8f13d4' (2025-03-18)
• Updated input 'flake-compat':
    'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33' (2023-10-04)
  → 'github:edolstra/flake-compat/ff81ac966bb2cae68946d5ed5fc4994f96d0ffec' (2024-12-04)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/5e4fbfb6b3de1aa2872b76d49fafc942626e2add' (2024-11-15)
  → 'github:NixOS/nixpkgs/698214a32beb4f4c8e3942372c694f40848b360d' (2025-03-25)
2025-03-27 22:37:39 +03:00
Charles Hall
218d75d573
update nixos module
Can't believe I forgot to do this...
2025-03-21 16:25:42 -07:00
Charles Hall
a04951541a
don't check canonicalized paths while sandboxed
Because the configured paths won't exist in the sandbox, so
canonicalization would fail.
2025-03-21 16:25:42 -07:00
K900
fd2a0ac2ab nixos: allow Unix sockets
Because OF COURSE.
2025-03-18 18:18:09 +03:00
K900
ed67ae6418 nixos: fix systemd service type 2025-03-18 13:13:59 +00:00
Charles Hall
114e7ba577
allow supplying custom version extra info in nix 2025-03-02 10:57:13 -08:00
Charles Hall
e11e27bc0c
don't try to set version extra outside flakes
The two attributes being accessed here don't exist when calling though
flake-compat, so we need to handle that case by making the environment
variable unset if neither attribute exists.
2025-03-02 10:54:56 -08:00
Olivia Lee
4cc390345a
don't markdownlint ignored files
I like to put a bunch of untracked stuff in a /scratch directory for
each project, and then puth /scratch in my global gitignore. There are
usually some markdown notes files in here that I don't care about style
for. The previous markdownlint invokation didn't respect the global
gitignore, making local 'engage' runs kinda useless due to false
positives from the scratch dir.
2025-01-23 13:04:59 -08:00
Charles Hall
540cc89c83
move ci job scipts into an actual script
This will make it possible/easier to:

* share code between jobs
* run jobs locally
2024-12-11 11:39:20 -08:00
Charles Hall
d4ffa78979
make it possible to direnv exec . at top level
This way we don't have to be so careful about where we call `direnv
exec .` and can safely assume e.g. in scripts that we're always in the
direnv environment.
2024-12-11 11:39:20 -08:00
Charles Hall
a520c4e032
fix sorting in shell.nix 2024-12-11 11:39:20 -08:00
Charles Hall
ec01a84efb
add custom release profile with debuginfo enabled
This is primarily useful for profiling. Also change the nix package to
decide whether to strip based on whether the "release" profile is used.
2024-12-01 08:47:09 -08:00
Charles Hall
2bf1975e75
add flake output for the website root 2024-11-22 11:21:39 -08:00
Charles Hall
2dbb101140
upgrade to latest rust-rocksdb
We gotta overrideAttrs to set the src and version to a newer version
than nixpkgs has now.
2024-11-08 17:26:38 -08:00
Charles Hall
a550d8db1f
assert that rocksdb versions match during eval 2024-11-07 11:36:13 -08:00
Charles Hall
9f4a1578aa
move rocksdb to its own file 2024-11-07 11:36:13 -08:00
Charles Hall
2e6bf86a42
move rust-jemalloc-sys to its own file 2024-11-07 11:36:13 -08:00
Charles Hall
f07c8c2b6f
update flake.lock
And some supporting changes:

* crane: It removed its dependency on nixpkgs and made overrideToolchain
  take a function for splicing reasons, but we're doing splicing
  ourselves so we can just ignore the function argument. These changes
  are in `flake.nix`.
* [NixOS/nixpkgs#347228][0]: linkerFor* were removed because the linker
  no longer needs to be different in some edge cases. Based on the
  diff of the PR that introduced this change, ccFor* are the proper
  replacements. These changes are in `cross-compilation-env.nix` in the
  compiler-and-linker-choosing section.
* [NixOS/nixpkgs#350299][1]: buildPlatform isn't at the top level
  anymore, we have to go through stdenv now. These changes are in
  `nix/shell.nix`.
* rocksdb: nixpkgs has 9.6.1 now so we need to upgrade our rust
  library to use the matching version. These changes are in
  `Cargo.toml`, `Cargo.lock`, `nix/pkgs/default/default.nix`, and
  `cross-compilation-env.nix` in the linker flags section.

[0]: https://github.com/NixOS/nixpkgs/pull/347228
[1]: https://github.com/NixOS/nixpkgs/pull/350299

Flake lock file updates:

• Updated input 'attic':
    'github:zhaofengli/attic/4dbdbee45728d8ce5788db6461aaaa89d98081f0' (2024-03-29)
  → 'github:zhaofengli/attic/48c8b395bfbc6b76c7eae74df6c74351255a095c' (2024-10-30)
• Updated input 'attic/crane':
    'github:ipetkov/crane/7195c00c272fdd92fc74e7d5a0a2844b9fadb2fb' (2023-12-18)
  → 'github:ipetkov/crane/4c6c77920b8d44cd6660c1621dea6b3fc4b4c4f4' (2024-08-06)
• Updated input 'attic/flake-compat':
    'github:edolstra/flake-compat/35bb57c0c8d8b62bbfd284272c928ceb64ddbde9' (2023-01-17)
  → 'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33' (2023-10-04)
• Added input 'attic/flake-parts':
    'github:hercules-ci/flake-parts/8471fe90ad337a8074e957b69ca4d0089218391d' (2024-08-01)
• Added input 'attic/flake-parts/nixpkgs-lib':
    follows 'attic/nixpkgs'
• Removed input 'attic/flake-utils'
• Updated input 'attic/nixpkgs':
    'github:NixOS/nixpkgs/07262b18b97000d16a4bdb003418bd2fb067a932' (2024-03-25)
  → 'github:NixOS/nixpkgs/159be5db480d1df880a0135ca0bfed84c2f88353' (2024-09-11)
• Updated input 'attic/nixpkgs-stable':
    'github:NixOS/nixpkgs/44733514b72e732bd49f5511bd0203dea9b9a434' (2024-03-26)
  → 'github:NixOS/nixpkgs/797f7dc49e0bc7fab4b57c021cdf68f595e47841' (2024-08-22)
• Added input 'attic/nix-github-actions':
    'github:nix-community/nix-github-actions/e04df33f62cdcf93d73e9a04142464753a16db67' (2024-10-24)
• Added input 'attic/nix-github-actions/nixpkgs':
    follows 'attic/nixpkgs'
• Updated input 'crane':
    'github:ipetkov/crane/109987da061a1bf452f435f1653c47511587d919' (2024-05-24)
  → 'github:ipetkov/crane/498d9f122c413ee1154e8131ace5a35a80d8fa76' (2024-10-27)
• Removed input 'crane/nixpkgs'
• Updated input 'fenix':
    'github:nix-community/fenix/b6fc5035b28e36a98370d0eac44f4ef3fd323df6' (2024-05-22)
  → 'github:nix-community/fenix/87b4d20f896c99018dde4702a9c6157b516f2a76' (2024-11-01)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/21ec8f523812b88418b2bfc64240c62b3dd967bd' (2024-05-19)
  → 'github:rust-lang/rust-analyzer/0ba893e1a00d92557ac91efb771d72eee36ca687' (2024-10-31)
• Updated input 'flake-utils':
    'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a' (2024-03-11)
  → 'github:numtide/flake-utils/c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a' (2024-09-17)
• Updated input 'nix-filter':
    'github:numtide/nix-filter/3342559a24e85fc164b295c3444e8a139924675b' (2024-03-11)
  → 'github:numtide/nix-filter/776e68c1d014c3adde193a18db9d738458cd2ba4' (2024-10-29)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/5710852ba686cc1fd0d3b8e22b3117d43ba374c2' (2024-05-21)
  → 'github:NixOS/nixpkgs/807e9154dcb16384b1b765ebe9cd2bba2ac287fd' (2024-10-29)
2024-11-07 11:35:48 -08:00
Andreas Fuchs
dcf64f03fb Validate generated config file in the nixos module
This uses the usual pkgs.runCommand pattern to ensure that no
non-parseable config files can make it to the command line.
2024-11-01 12:10:01 -04:00
Andreas Fuchs
26ba489aa3 Add a "check-config" command to validate config files & tests for it 2024-11-01 12:08:17 -04:00
K900
b93c39ee93 fix: use non-alias name in nixos module 2024-10-24 14:46:44 +00:00
Benjamin Lee
be87774a3b
set up structure for multiple cli commands
The previous cli is now behind the 'serve' subcommand.
2024-09-21 14:11:26 -07:00
K900
6685f8cd14
remove uses of aliases 2024-08-17 12:31:48 -07:00
Benjamin Lee
992e6b945a
remove usage of IFD in nix packages
Lix builders have IFD disabled, and the changes needed to support this
are minimal.

We do need to do slightly more manual work to keep rust-toolchain.toml
in sync with flake.nix, but it's not significant.
2024-08-13 12:12:57 -07:00
Lambda
d26b87a2f2
Move database config to separate section
This renames:

database_backend -> database.backend
database_path -> database.path
db_cache_capacity_mb -> database.cache_capacity_mb
rocksdb_max_open_files -> database.rocksdb_max_open_files

Charles updated the NixOS module.

Co-authored-by: Charles Hall <charles@computer.surgery>
2024-06-27 16:03:43 -07:00
Charles Hall
9a5e552ca0
set up mdbook
This adds some new tools in CI for lint the book and also sets up
automated deployment to GitLab Pages. Also adds a readme that suggests
reading the book, since that's where all the information will be.
2024-06-16 20:23:18 -07:00
Charles Hall
e318dfcb3d
drop oci image outputs
We don't support this anyway. OCI images will be needed for testing with
Complement, but there are a bunch of other special requirements that has
so these oci image outputs won't be very useful for that anyway.
2024-06-14 14:04:46 -07:00
Benjamin Lee
f7d7952f9b
allow listening on multiple ports in config
This is a config compatibility break.

The ability to listen on multiple ports, including both TLS and non-TLS,
is necessary for running complement against grapevine.
2024-06-13 13:33:50 -07:00
Charles Hall
003c0a4928
drop nested config
This functionality was never actually used AFAICT, as no way to provide
alternate profiles was ever provided.

This changes the configuration format to remove the `[global]` section,
everything that was previously under that namespace is now at the top
level.
2024-06-12 19:56:59 -07:00
Charles Hall
9a92a8047e
drop support for environment variables
The configuration file is now the canonical way to, well, configure.
This change is desirable because it gives us much more flexibility with
how configuration is structured. Environment variables are insufficient
because, for example, they're a flat namespace and have no built-in way
to represent lists.
2024-06-12 19:56:59 -07:00
Charles Hall
9b115b4110
require config path via cli, remove env var 2024-06-12 19:56:59 -07:00
Charles Hall
0bd2c43dab
don't strip binary for dev builds 2024-06-05 16:42:40 -07:00
Charles Hall
972c25beca
remove unnecessary whitespace 2024-06-05 16:42:16 -07:00
Benjamin Lee
fa48c48d52
add all-features devshell
Because the nix rocksdb build depends on the jemalloc feature, you need
to use a different devshell when passing --all-features to cargo than
the default.
2024-05-30 21:19:08 -07:00
Benjamin Lee
8f24ac1f27
do default-feature unification in nix
Some of the features affect nix dependencies, so we need to have a
full feature list available when constructing the nix derivation. This
incidentally fixes the bug where we weren't enabling jemalloc on rocksdb
in CI/devshells, because jemalloc is now a default feature. It does not
fix the more general class of that issue, where CI is performing an
`--all-features` build in a nix devshell built for default-features.

I am now passing `--no-default-features` to cargo, and having it use our
unified feature list rather than duplicating the unification inside cargo.
2024-05-30 21:19:08 -07:00
Benjamin Lee
ee43c2ff4c
only link to one jemalloc build
Without setting JEMALLOC_OVERRIDE, we end up linking to two different
jemalloc builds. Once dynamically, as a transitive dependency through
rocksdb, and a second time to the static jemalloc that tikv-jemalloc-sys
builds.

This fixes dynamically-linked jemalloc builds, for the reasons described
in <https://github.com/girlbossceo/conduwuit/pull/400#issue-2316700200>.
2024-05-30 21:19:08 -07:00
Charles Hall
a25f2ec950
add conduit compat mode
This makes it possible to deploy Grapevine while using a database
originally created by Conduit, including leaving the admin bot user's
localpart the same as before.
2024-05-14 20:21:51 -07:00
Charles Hall
33e7a46b53
add a nixos module 2024-05-14 20:21:51 -07:00
Charles Hall
17eb354590
prevent bindgen and dependents from building twice
See also <https://crane.dev/faq/rebuilds-bindgen.html>.
2024-05-14 20:21:51 -07:00
Charles Hall
21a4b9e5a1
only set GRAPEVINE_VERSION_EXTRA for final build
This prevents us from needing to recompile the dependencies when that
environment variable changes, which generally changes on every commit,
which is far more frequently than the dependencies are actually changed.
2024-05-14 20:21:51 -07:00
Charles Hall
bbb1a6fea4
make it easy to configure cargo profiles from nix
This way you can easily build in debug mode with Nix.
2024-05-14 20:21:51 -07:00
Charles Hall
51f9650ca7
make it easy to configure cargo features from nix
Users of the nix package can now just use `.override` to choose what
features they want.

This also makes RocksDB automatically use jemalloc when Grapevine is
configured to use jemalloc.
2024-05-14 20:21:51 -07:00
Charles Hall
0f8d1a5ed7
factor out nix code into new files via makeScope
This makes the Nix code a lot easier to reason about.
2024-05-14 20:21:51 -07:00
Samuel Meenzen
425660472c
docs: build docs using mdBook 2024-03-16 20:01:15 -07:00