Skip to content

Commit c7b9211

Browse files
committed
first version
0 parents  commit c7b9211

File tree

16 files changed

+3268
-0
lines changed

16 files changed

+3268
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.envrc
2+
.idea
3+
target

.nixignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.envrc
2+
.idea
3+
target

COPYING

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Marco Köpcke
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
Nix Jetbrains Plugins
2+
=====================
3+
4+
This repository contains derivations for ALL plugins from the Jetbrains Marketplace.
5+
6+
It is regularly updated to include all current plugins in their latest compatible version.
7+
8+
If any derivations fail to build or plugins are missing, please open an issue.
9+
We asume that plugins are not re-released with the same version number, so if a plugin does this for any reason,
10+
they might break and need manual fixing in this repository.
11+
12+
The plugins exported by this Flake are indexed by their IDE, version and then plugin ID.
13+
You can find the plugin IDs at the bottom of Marketplace pages.
14+
15+
The plugin list is only updated for IDEs from the current and previous year, for other IDEs the list may be stale.
16+
17+
## How to setup
18+
19+
### With Flakes
20+
21+
#### Inputs:
22+
23+
```nix
24+
inputs.nix-jebrains-plugins.url = "github:theCapypara/nix-jebrains-plugins";
25+
```
26+
27+
#### Usage:
28+
```nix
29+
let
30+
pluginList = [
31+
nix-jebrains-plugins.plugins."${system}".idea-ultimate."2024.3"."com.intellij.plugins.watcher"
32+
];
33+
in {
34+
# ... see "How to use"
35+
}
36+
```
37+
38+
### Without flakes
39+
40+
```nix
41+
let
42+
system = builtins.currentSystem;
43+
plugins =
44+
(import (builtins.fetchGit {
45+
url = "https://github.com/theCapypara/nix-jebrains-plugins";
46+
ref = "refs/heads/main";
47+
rev = "<latest commit hash>";
48+
})).plugins."${system}";
49+
pluginList = [
50+
plugins.idea-ultimate."2024.3"."com.intellij.plugins.watcher"
51+
];
52+
in {
53+
# ... see "How to use"
54+
}
55+
```
56+
57+
## How to use
58+
59+
The plugins can be used with ``jetbrains.plugins.addPlugins``:
60+
61+
```nix
62+
{
63+
environment.systemPackages = [
64+
# See "How to setup" for definition of `pluginList`.
65+
pkgs.jetbrains.plugins.addPlugins pkgs.jetbrains.idea-ultimate pluginList
66+
];
67+
}
68+
```
69+
70+
## Convenience functions (`lib`)
71+
The flake exports some convenience functions that can be used to make adding plugins to your IDEs
72+
easier.
73+
74+
These functions are only compatible and tested with the latest stable nixpkgs version.
75+
76+
### `buildIdeWithPlugins`
77+
78+
Using this function you can build an IDE using a set of named plugins from this Flake. The function
79+
will automatically figure out what IDE and version the plugin needs to be for.
80+
81+
#### Arguments:
82+
83+
1. `pkgs.jetbrains` from nixpkgs.
84+
2. The `pkgs.jetbrains` key of the IDE to build or download.
85+
3. A list of plugin IDs to install.
86+
87+
#### Example:
88+
89+
```nix
90+
{
91+
environment.systemPackages = with nix-jebrains-plugins.lib."${system}"; [
92+
# Adds the latest IDEA Ultimate version with the latest compatible version of "com.intellij.plugins.watcher".
93+
buildIdeWithPlugins pkgs.jetbrains "idea-ultimate" ["com.intellij.plugins.watcher"]
94+
];
95+
}
96+
```

dev.nix

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
mkShell,
3+
lib,
4+
stdenv,
5+
6+
llvmPackages_latest,
7+
clang,
8+
rustup,
9+
pkg-config,
10+
11+
openssl,
12+
zlib,
13+
}:
14+
let
15+
overrides = (builtins.fromTOML (builtins.readFile ./generator/rust-toolchain.toml));
16+
extraLibs = [
17+
stdenv.cc.cc.lib
18+
zlib
19+
];
20+
libPath = lib.makeLibraryPath extraLibs;
21+
in
22+
mkShell {
23+
RUSTC_VERSION = overrides.toolchain.channel;
24+
# https://github.com/rust-lang/rust-bindgen#environment-variables
25+
LIBCLANG_PATH = lib.makeLibraryPath [ llvmPackages_latest.libclang.lib ];
26+
shellHook = ''
27+
export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin
28+
export PATH=$PATH:''${RUSTUP_HOME:-~/.rustup}/toolchains/$RUSTC_VERSION-x86_64-unknown-linux-gnu/bin/
29+
'';
30+
# Add precompiled library to rustc search path
31+
RUSTFLAGS = (
32+
builtins.map (a: ''-L ${a}/lib'') [
33+
# add libraries here (e.g. pkgs.libvmi)
34+
]
35+
);
36+
LD_LIBRARY_PATH = libPath;
37+
# Add glibc, clang, glib, and other headers to bindgen search path
38+
BINDGEN_EXTRA_CLANG_ARGS =
39+
# Includes normal include path
40+
(builtins.map (a: ''-I"${a}/include"'') [
41+
# add dev libraries here (e.g. pkgs.libvmi.dev)
42+
])
43+
# Includes with special directory paths
44+
++ [
45+
''-I"${llvmPackages_latest.libclang.lib}/lib/clang/${llvmPackages_latest.libclang.version}/include"''
46+
];
47+
48+
nativeBuildInputs = [ ];
49+
50+
buildInputs =
51+
[
52+
openssl
53+
zlib
54+
pkg-config
55+
]
56+
## RUST
57+
++ [
58+
clang
59+
llvmPackages_latest.bintools
60+
rustup
61+
];
62+
}

flake.lock

Lines changed: 77 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
4+
flake-utils.url = "github:numtide/flake-utils";
5+
systems.url = "github:nix-systems/default";
6+
};
7+
8+
outputs =
9+
{
10+
self,
11+
nixpkgs,
12+
systems,
13+
flake-utils,
14+
}:
15+
flake-utils.lib.eachSystem (import systems) (
16+
system:
17+
let
18+
pkgs = import nixpkgs {
19+
inherit system;
20+
};
21+
in
22+
rec {
23+
plugins = pkgs.callPackage ./plugins.nix { };
24+
25+
packages = {
26+
_nix-jebrains-plugins-generator = pkgs.callPackage ./generator/pkg.nix { };
27+
};
28+
29+
devShells = {
30+
default = pkgs.callPackage ./dev.nix { };
31+
};
32+
33+
lib = {
34+
# Using this function you can build an IDE using a set of named plugins from this Flake. The function
35+
# will automatically figure out what IDE and version the plugin needs to be for.
36+
# See README.
37+
buildIdeWithPlugins =
38+
jetbrains: ide-name: plugin-ids:
39+
let
40+
ide = jetbrains."${ide-name}";
41+
in
42+
jetbrains.plugins.addPlugins ide (
43+
builtins.map (p: plugins."${ide.pname}"."${ide.version}"."${p}") plugin-ids
44+
);
45+
};
46+
}
47+
);
48+
}

0 commit comments

Comments
 (0)