This commit is contained in:
Oystein Kristoffer Tveit 2024-08-16 12:37:58 +02:00
parent 0dc4fa7860
commit 7388e3635f
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
4 changed files with 50 additions and 0 deletions

View File

@ -50,6 +50,11 @@
inputs.nixpkgs.follows = "nixpkgs";
};
ra-multiplex = {
url = "github:pr2502/ra-multiplex";
inputs.nixpkgs.follows = "nixpkgs";
};
# Nix expressions and keys (TODO: move keys to another solution like agenix)
# which should be kept from the main repo for privacy reasons.
#
@ -75,6 +80,7 @@
secrets,
sops-nix,
vscode-server,
ra-multiplex
# website
}: let
system = "x86_64-linux";
@ -101,6 +107,10 @@
inherit (nonrecursive-unstable-pkgs) atuin wstunnel;
})
(self: super: {
ra-multiplex = ra-multiplex.packages.${system}.default;
})
# https://github.com/NixOS/nixpkgs/pull/251706
(self: super: {
mozc = self.qt6Packages.callPackage ./package-overrides/mozc.nix { };

View File

@ -51,6 +51,7 @@ in {
./services/mpd.nix
./services/picom.nix
./services/polybar.nix
./services/ra-multiplex.nix
./services/screen-locker.nix
# ./services/stalonetray.nix
./services/sxhkd.nix

View File

@ -161,6 +161,9 @@ in
"vsintellicode.modify.editor.suggestSelection" = "automaticallyOverrodeDefaultValue";
"window.zoomLevel" = 1;
"rust-analyzer.server.path" =
toString (pkgs.writeShellScript "ra-multiplex-client" "${lib.getExe pkgs.ra-multiplex} client");
"search.exclude" = {
"**/node_modules" = true;
"**/bower_components" = true;

View File

@ -0,0 +1,36 @@
{ pkgs, lib, ... }:
let
format = pkgs.formats.toml { };
package = pkgs.ra-multiplex;
in
{
xdg.configFile."ra-multiplex/config.toml".source = format.generate "ra-multiplex-config.toml" {
# listen = "/var/run/user/1001/ra-mux/ra-multiplex.sock";
# connect = "/var/run/user/1001/ra-mux/ra-multiplex.sock";
listen = [ "127.0.0.1" 27631 ];
connect = [ "127.0.0.1" 27631 ];
pass_environment = [
"RUST_SRC_PATH"
"RUSTC_WRAPPER"
"SCCACHE_DIR"
];
};
systemd.user.services.ra-multiplex = {
Unit = {
Description = "Rust analyzer multiplex server";
};
Service = {
Type = "simple";
ExecStart = "${lib.getExe package} server";
Environment = [
"PATH=${lib.makeBinPath [ pkgs.rust-analyzer ]}"
];
};
Install = {
WantedBy = [ "default.target" ];
};
};
}