Compare commits
4 Commits
202ea9929b
...
9c4a68e3aa
Author | SHA1 | Date | |
---|---|---|---|
9c4a68e3aa | |||
7959b877d9 | |||
1a129ac179 | |||
32e8d6c12d |
39
default.nix
39
default.nix
@ -63,36 +63,23 @@ rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
# A functional Jetbrains IDE-with-plugins package set.
|
# A functional Jetbrains IDE-with-plugins package set.
|
||||||
jetbrains =
|
jetbrains = pkgs.dontRecurseIntoAttrs rec {
|
||||||
let
|
jetbrainsPluginsFor = variant: import ./pkgs/top-level/jetbrains-plugins.nix {
|
||||||
mkJetbrainsPlugins = import ./pkgs/applications/editors/jetbrains/common-plugins.nix {
|
inherit (pkgs) lib newScope stdenv fetchzip;
|
||||||
inherit (pkgs) callPackage;
|
inherit variant;
|
||||||
};
|
|
||||||
mkIdeaPlugins = import ./pkgs/applications/editors/jetbrains/idea-plugins.nix {
|
|
||||||
inherit (pkgs) callPackage;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
builder = import ./pkgs/applications/editors/jetbrains/builder.nix {
|
pluginBuild = jetbrainsPlatforms: pkgs.callPackage ./pkgs/build-support/jetbrains/plugin.nix {
|
||||||
inherit (pkgs) lib;
|
inherit jetbrains jetbrainsPlatforms;
|
||||||
};
|
};
|
||||||
|
|
||||||
jbScope = pkgs.lib.makeScope pkgs.newScope (self: pkgs.lib.makeOverridable
|
clionPlugins = pkgs.dontRecurseIntoAttrs (jetbrainsPluginsFor pkgs.jetbrains.clion);
|
||||||
({ jetbrainsPlugins ? mkJetbrainsPlugins
|
ideaCommunityPlugins = pkgs.dontRecurseIntoAttrs (jetbrainsPluginsFor pkgs.jetbrains.idea-community);
|
||||||
, ideaPlugins ? mkIdeaPlugins
|
ideaUltimatePlugins = pkgs.dontRecurseIntoAttrs (jetbrainsPluginsFor pkgs.jetbrains.idea-ultimate);
|
||||||
}: ({ }
|
|
||||||
// jetbrainsPlugins // { inherit jetbrainsPlugins; }
|
clionWithPlugins = clionPlugins.jetbrainsWithPlugins;
|
||||||
// ideaPlugins // { inherit ideaPlugins; }
|
ideaCommunityWithPlugins = ideaCommunityPlugins.jetbrainsWithPlugins;
|
||||||
// {
|
ideaUltimateWithPlugins = ideaUltimatePlugins.jetbrainsWithPlugins;
|
||||||
jetbrainsWithPlugins = builder self;
|
|
||||||
}))
|
|
||||||
{ });
|
|
||||||
in
|
|
||||||
rec {
|
|
||||||
inherit (jbScope) jetbrainsWithPlugins;
|
|
||||||
clionWithPlugins = jetbrainsWithPlugins pkgs.jetbrains.clion;
|
|
||||||
ideaCommunityWithPlugins = jetbrainsWithPlugins pkgs.jetbrains.idea-community;
|
|
||||||
ideaUltimateWithPlugins = jetbrainsWithPlugins pkgs.jetbrains.idea-ultimate;
|
|
||||||
plugins = jbScope;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
libhl = pkgs.callPackage ./pkgs/development/libraries/libhl { };
|
libhl = pkgs.callPackage ./pkgs/development/libraries/libhl { };
|
||||||
|
@ -13,6 +13,12 @@ in
|
|||||||
options.services.amdgpu.fan = {
|
options.services.amdgpu.fan = {
|
||||||
enable = mkEnableOption "amdgpu-fan";
|
enable = mkEnableOption "amdgpu-fan";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.amdgpu-fan or (import ../../.. { inherit pkgs; }).amdgpu-fan;
|
||||||
|
defaultText = "pkgs.amdgpu-fan";
|
||||||
|
};
|
||||||
|
|
||||||
speedMatrix = mkOption {
|
speedMatrix = mkOption {
|
||||||
type = with types; listOf (listOf int);
|
type = with types; listOf (listOf int);
|
||||||
# Translated from upstream default config. Since it tries to write the
|
# Translated from upstream default config. Since it tries to write the
|
||||||
@ -45,7 +51,7 @@ in
|
|||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
assertions = singleton {
|
assertions = singleton {
|
||||||
assertion = all (speeds: length speeds == 2) cfg.speedMatrix;
|
assertion = all (speeds: length speeds == 2) cfg.speedMatrix;
|
||||||
message = "services.amdgpu-fan.speedMatrix must be a list of paired lists";
|
message = "services.amdgpu.fan.speedMatrix must be a list of paired lists";
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.etc."amdgpu-fan.yml".text = builtins.toJSON {
|
environment.etc."amdgpu-fan.yml".text = builtins.toJSON {
|
||||||
@ -60,9 +66,9 @@ in
|
|||||||
amdgpu-fan = {
|
amdgpu-fan = {
|
||||||
description = "amdgpu fan controller";
|
description = "amdgpu fan controller";
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
after = [ "enable-manual-amdgpu-fan.service" ];
|
after = [ "amdgpu-pwm.service" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.amdgpu-fan}/bin/amdgpu-fan";
|
ExecStart = "${cfg.package}/bin/amdgpu-fan";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -11,6 +11,12 @@ in
|
|||||||
{
|
{
|
||||||
options.services.radeon-profile-daemon = {
|
options.services.radeon-profile-daemon = {
|
||||||
enable = mkEnableOption "radeon-profile-daemon";
|
enable = mkEnableOption "radeon-profile-daemon";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.radeon-profile-daemon or (import ../../.. { inherit pkgs; }).radeon-profile-daemon;
|
||||||
|
defaultText = "pkgs.radeon-profile-daemon";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
@ -18,10 +24,10 @@ in
|
|||||||
radeon-profile-daemon = {
|
radeon-profile-daemon = {
|
||||||
description = "radeon-profile daemon";
|
description = "radeon-profile daemon";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
after = [ "enable-manual-amdgpu-fan.service" ];
|
after = [ "amdgpu-pwm.service" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
ExecStart = "${pkgs.radeon-profile-daemon}/bin/radeon-profile-daemon";
|
ExecStart = "${package}/bin/radeon-profile-daemon";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
{ callPackage }:
|
{ lib, stdenv, fetchzip }:
|
||||||
|
|
||||||
|
self:
|
||||||
|
|
||||||
let
|
let
|
||||||
mkPlugin = callPackage ./build-plugin.nix {
|
|
||||||
|
commonBuild = import ../../../build-support/jetbrains/plugin.nix {
|
||||||
|
inherit lib stdenv fetchzip;
|
||||||
jetbrainsPlatforms = [
|
jetbrainsPlatforms = [
|
||||||
"clion"
|
"clion"
|
||||||
"datagrip"
|
"datagrip"
|
||||||
@ -15,30 +20,22 @@ let
|
|||||||
"webstorm"
|
"webstorm"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
|
||||||
{
|
generateCommon = lib.makeOverridable ({
|
||||||
ideavim = mkPlugin {
|
common ? ./manual-common-packages.nix
|
||||||
pname = "IdeaVim";
|
}: let
|
||||||
version = "0.57";
|
|
||||||
pluginId = 164;
|
imported = import common {
|
||||||
versionId = 85009;
|
inherit (self) callPackage;
|
||||||
sha256 = "1rwfwj0b0nwi7jxhzxk1r0xc190nf4i3b59i0zknpmgb4yc5clzw";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
checkstyle-idea = mkPlugin {
|
super = imported;
|
||||||
pname = "CheckStyle-IDEA";
|
|
||||||
version = "5.42.0";
|
overrides = { };
|
||||||
pluginId = 1065;
|
|
||||||
versionId = 95757;
|
jetbrainsPlugins = super // overrides;
|
||||||
sha256 = "0sji3649n5zz84dlidqaklipq6vaiafxsvg0gzy3j59mvkz6dk14";
|
|
||||||
};
|
in jetbrainsPlugins // { inherit commonBuild; });
|
||||||
|
|
||||||
|
in generateCommon { }
|
||||||
|
|
||||||
google-java-format = mkPlugin rec {
|
|
||||||
pname = "google-java-format";
|
|
||||||
version = "1.7.0.4";
|
|
||||||
pluginId = 8527;
|
|
||||||
versionId = 83164;
|
|
||||||
sha256 = "1pmnn1ksiv44kdga53gi3psrm2sva4bqrxizagbr0if2n0rrvgii";
|
|
||||||
filename = "${pname}.zip";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
@ -1,15 +1,29 @@
|
|||||||
{ callPackage }:
|
{ lib, stdenv, fetchzip }:
|
||||||
|
|
||||||
|
self:
|
||||||
|
|
||||||
let
|
let
|
||||||
mkPlugin = callPackage ./build-plugin.nix {
|
|
||||||
|
ideaBuild = import ../../../build-support/jetbrains/plugin.nix {
|
||||||
|
inherit lib stdenv fetchzip;
|
||||||
jetbrainsPlatforms = [ "idea-community" "idea-ultimate" ];
|
jetbrainsPlatforms = [ "idea-community" "idea-ultimate" ];
|
||||||
};
|
};
|
||||||
in
|
|
||||||
{
|
generateIdea = lib.makeOverridable ({
|
||||||
spring-assistant = mkPlugin {
|
idea ? ./manual-idea-packages.nix
|
||||||
pname = "intellij-spring-assistant";
|
}: let
|
||||||
version = "0.12.0";
|
|
||||||
pluginId = 10229;
|
imported = import idea {
|
||||||
versionId = 44968;
|
inherit (self) callPackage;
|
||||||
sha256 = "13cglywzhb4j0qj0bs2jwaz2k8pxrxalv35wgkmgkxr635bxmwsj";
|
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
super = imported;
|
||||||
|
|
||||||
|
overrides = { };
|
||||||
|
|
||||||
|
ideaPlugins = super // overrides;
|
||||||
|
|
||||||
|
in ideaPlugins // { inherit ideaBuild; });
|
||||||
|
|
||||||
|
in generateIdea { }
|
||||||
|
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
{ callPackage }:
|
||||||
|
{
|
||||||
|
ideavim = callPackage
|
||||||
|
({ commonBuild }: commonBuild {
|
||||||
|
pname = "IdeaVim";
|
||||||
|
version = "0.57";
|
||||||
|
pluginId = 164;
|
||||||
|
versionId = 85009;
|
||||||
|
sha256 = "1rwfwj0b0nwi7jxhzxk1r0xc190nf4i3b59i0zknpmgb4yc5clzw";
|
||||||
|
})
|
||||||
|
{ };
|
||||||
|
|
||||||
|
checkstyle-idea = callPackage
|
||||||
|
({ commonBuild }: commonBuild {
|
||||||
|
pname = "CheckStyle-IDEA";
|
||||||
|
version = "5.42.0";
|
||||||
|
pluginId = 1065;
|
||||||
|
versionId = 95757;
|
||||||
|
sha256 = "0sji3649n5zz84dlidqaklipq6vaiafxsvg0gzy3j59mvkz6dk14";
|
||||||
|
})
|
||||||
|
{ };
|
||||||
|
|
||||||
|
google-java-format = callPackage
|
||||||
|
({ commonBuild }: commonBuild rec {
|
||||||
|
pname = "google-java-format";
|
||||||
|
version = "1.7.0.4";
|
||||||
|
pluginId = 8527;
|
||||||
|
versionId = 83164;
|
||||||
|
sha256 = "1pmnn1ksiv44kdga53gi3psrm2sva4bqrxizagbr0if2n0rrvgii";
|
||||||
|
filename = "${pname}.zip";
|
||||||
|
})
|
||||||
|
{ };
|
||||||
|
}
|
12
pkgs/applications/editors/jetbrains/manual-idea-packages.nix
Normal file
12
pkgs/applications/editors/jetbrains/manual-idea-packages.nix
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{ callPackage }:
|
||||||
|
{
|
||||||
|
spring-assistant = callPackage
|
||||||
|
({ ideaBuild }: ideaBuild {
|
||||||
|
pname = "intellij-spring-assistant";
|
||||||
|
version = "0.12.0";
|
||||||
|
pluginId = 10229;
|
||||||
|
versionId = 44968;
|
||||||
|
sha256 = "13cglywzhb4j0qj0bs2jwaz2k8pxrxalv35wgkmgkxr635bxmwsj";
|
||||||
|
})
|
||||||
|
{ };
|
||||||
|
}
|
@ -12,22 +12,20 @@ let
|
|||||||
then pluginsFun self
|
then pluginsFun self
|
||||||
else pluginsFun;
|
else pluginsFun;
|
||||||
|
|
||||||
|
# FIXME: Is this still needed?
|
||||||
info = builtins.parseDrvName package.name;
|
info = builtins.parseDrvName package.name;
|
||||||
|
|
||||||
badPlugins = filter (p: ! elem info.name p.jetbrainsPlatforms) plugins;
|
badPlugins = filter (p: ! elem info.name p.jetbrainsPlatforms) plugins;
|
||||||
errorMsg = "plugins [ ${toString (map (p: p.name) badPlugins)} ] are not available for platform ${info.name}";
|
errorMsg = "plugins [ ${toString (map (p: p.name) badPlugins)} ] are not available for platform ${info.name}";
|
||||||
in
|
in
|
||||||
|
|
||||||
assert assertMsg (length badPlugins == 0) errorMsg;
|
assert assertMsg (length badPlugins == 0) errorMsg;
|
||||||
|
|
||||||
package.overrideAttrs (oldAttrs: {
|
appendToName "with-plugins" (package.overrideAttrs (oldAttrs: {
|
||||||
# FIXME: versioning: could just expose upstream
|
passthru = { inherit plugins; };
|
||||||
name = "${info.name}-with-plugins-${info.version}";
|
# TODO: Purely aesthetics, but link the plugin to its name instead of hash-name-version
|
||||||
|
|
||||||
inherit plugins;
|
|
||||||
installPhase = oldAttrs.installPhase + ''
|
installPhase = oldAttrs.installPhase + ''
|
||||||
for plugin in $plugins; do
|
for plugin in $plugins; do
|
||||||
ln -s "$plugin" "$out/$name/plugins/$(basename $plugin)"
|
ln -s "$plugin" "$out/$name/plugins/$(basename $plugin)"
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
})
|
}))
|
@ -1,4 +1,5 @@
|
|||||||
{ stdenv
|
{ lib
|
||||||
|
, stdenv
|
||||||
, fetchzip
|
, fetchzip
|
||||||
, jetbrainsPlatforms
|
, jetbrainsPlatforms
|
||||||
}:
|
}:
|
||||||
@ -12,19 +13,21 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
inherit pname version jetbrainsPlatforms;
|
inherit pname version;
|
||||||
|
|
||||||
src = fetchzip {
|
src = fetchzip {
|
||||||
inherit sha256;
|
inherit sha256;
|
||||||
url = "https://plugins.jetbrains.com/files/${toString pluginId}/${toString versionId}/${filename}";
|
url = "https://plugins.jetbrains.com/files/${toString pluginId}/${toString versionId}/${filename}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
passthru = { inherit jetbrainsPlatforms; };
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir $out
|
mkdir $out
|
||||||
cp -r * $out/
|
cp -r * $out/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "https://plugins.jetbrains.com/plugin/${pluginId}-${stdenv.lib.toLower pname}";
|
homepage = "https://plugins.jetbrains.com/plugin/${pluginId}-${lib.toLower pname}";
|
||||||
};
|
};
|
||||||
}
|
}
|
33
pkgs/top-level/jetbrains-plugins.nix
Normal file
33
pkgs/top-level/jetbrains-plugins.nix
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{ lib
|
||||||
|
, newScope
|
||||||
|
, stdenv
|
||||||
|
, fetchzip
|
||||||
|
|
||||||
|
, variant
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
mkJetbrainsPlugins = import ../applications/editors/jetbrains/common-plugins.nix {
|
||||||
|
inherit lib stdenv fetchzip;
|
||||||
|
};
|
||||||
|
|
||||||
|
mkIdeaPlugins = import ../applications/editors/jetbrains/idea-plugins.nix {
|
||||||
|
inherit lib stdenv fetchzip;
|
||||||
|
};
|
||||||
|
|
||||||
|
jetbrainsWithPlugins = import ../applications/editors/jetbrains/wrapper.nix {
|
||||||
|
inherit lib;
|
||||||
|
};
|
||||||
|
|
||||||
|
in lib.makeScope newScope (self: lib.makeOverridable ({
|
||||||
|
jetbrainsPlugins ? mkJetbrainsPlugins self
|
||||||
|
, ideaPlugins ? mkIdeaPlugins self
|
||||||
|
}: ({ }
|
||||||
|
// jetbrainsPlugins // { inherit jetbrainsPlugins; }
|
||||||
|
// ideaPlugins // { inherit ideaPlugins; }
|
||||||
|
// {
|
||||||
|
inherit variant;
|
||||||
|
jetbrainsWithPlugins = jetbrainsWithPlugins self variant;
|
||||||
|
})
|
||||||
|
) { })
|
Loading…
Reference in New Issue
Block a user