jetbrains-remote: add module

This commit is contained in:
GenericNerdyUsername 2024-02-05 23:29:23 +00:00 committed by GitHub
parent f65dcd6c15
commit f99eace7c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 51 additions and 0 deletions

View file

@ -223,6 +223,11 @@
githubId = 33058747; githubId = 33058747;
name = "Gaetan Lepage"; name = "Gaetan Lepage";
}; };
genericnerdyusername = {
email = "genericnerdyusername@proton.me";
github = "genericnerdyusername";
githubId = 111183546;
};
maximsmol = { maximsmol = {
email = "maximsmol@gmail.com"; email = "maximsmol@gmail.com";
github = "maximsmol"; github = "maximsmol";

View file

@ -1407,6 +1407,13 @@ in {
A new module is available: 'services.arrpc' A new module is available: 'services.arrpc'
''; '';
} }
{
time = "2024-02-05T22:45:37+00:00";
message = ''
A new module is available: 'programs.jetbrains-remote'
'';
}
]; ];
}; };
} }

View file

@ -120,6 +120,7 @@ let
./programs/ion.nix ./programs/ion.nix
./programs/irssi.nix ./programs/irssi.nix
./programs/java.nix ./programs/java.nix
./programs/jetbrains-remote.nix
./programs/jq.nix ./programs/jq.nix
./programs/jujutsu.nix ./programs/jujutsu.nix
./programs/joshuto.nix ./programs/joshuto.nix

View file

@ -0,0 +1,38 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.jetbrains-remote;
in {
meta.maintainers = with lib.maintainers; [ genericnerdyusername ];
options.programs.jetbrains-remote = {
enable = mkEnableOption "JetBrains remote development system";
ides = mkOption {
type = types.listOf types.package;
default = [ ];
example = literalExpression ''
with pkgs.jetbrains; [ clion pycharm-professional ];
'';
description = ''
IDEs accessible to the JetBrains remote development system.
'';
};
};
config = mkIf (cfg.enable && cfg.ides != [ ]) {
home.activation.jetBrainsRemote = let
mkLine = ide:
# Errors out if the symlink already exists
"${ide}/bin/${ide.meta.mainProgram}-remote-dev-server registerBackendLocationForGateway || true";
lines = map mkLine cfg.ides;
linesStr = ''
rm $HOME/.cache/JetBrains/RemoteDev/userProvidedDist/_nix_store*
'' + concatStringsSep "\n" lines;
in hm.dag.entryAfter [ "writeBoundary" ] linesStr;
};
}