Compare commits

..

No commits in common. "82378445b0230abed9d9364d1cfcc3793caef738" and "37e945a5520344d51d132c664177d76a9a52a45d" have entirely different histories.

2 changed files with 1 additions and 32 deletions

View File

@ -1,7 +0,0 @@
{ ... }:
{
services.memcached = {
enable = true;
maxMemory = 512;
};
}

View File

@ -1,31 +1,8 @@
{
config,
pkgs,
osConfig,
...
}:
let
sccacheWrapped =
if osConfig.services.memcached.enable then
pkgs.symlinkJoin {
name = "sccache";
paths = [ pkgs.sccache ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/sccache \
--set SCCACHE_MEMCACHED_KEY_PREFIX "SCCACHE" \
--set SCCACHE_MEMCACHED_ENDPOINT "tcp://${builtins.toString osConfig.services.memcached.listen}:${builtins.toString osConfig.services.memcached.port}"
'';
}
else
# Symlinking this ensures that sccache can properly create temporary directories.
# This is because Nix wants to cause every sccache invocation to sandbox the build, by
# symlinking sccache instead, we can avoid the sandbox to some degree.
pkgs.symlinkJoin {
name = "sccache";
paths = [ pkgs.sccache ];
};
in
{
home = {
sessionVariables = {
@ -49,13 +26,12 @@ in
rust-analyzer-nightly
cargo-watch
cargo-nextest
sccacheWrapped
sccache
];
file = {
# NOTE: This improves the rust edit-build-run cycle. See https://davidlattimore.github.io/posts/2024/02/04/speeding-up-the-rust-edit-build-run-cycle.html
"${config.home.sessionVariables.CARGO_HOME}/config.toml".text = ''
[build]
rustc-wrapper = "${sccacheWrapped}/bin/sccache"
rustflags = [ "-C", "linker=${pkgs.clang}/bin/clang", "-C", "link-arg=--ld-path=${pkgs.mold-wrapped}/bin/mold" ]
[profile.dev]