Compare commits

..

No commits in common. "9c4a68e3aa5dc9ab9dbcf63b6fe8e721ed793b3c" and "202ea9929b3296ed462e77d6172231df3963a0c6" have entirely different histories.

10 changed files with 84 additions and 173 deletions

View File

@ -63,23 +63,36 @@ rec {
};
# A functional Jetbrains IDE-with-plugins package set.
jetbrains = pkgs.dontRecurseIntoAttrs rec {
jetbrainsPluginsFor = variant: import ./pkgs/top-level/jetbrains-plugins.nix {
inherit (pkgs) lib newScope stdenv fetchzip;
inherit variant;
jetbrains =
let
mkJetbrainsPlugins = import ./pkgs/applications/editors/jetbrains/common-plugins.nix {
inherit (pkgs) callPackage;
};
mkIdeaPlugins = import ./pkgs/applications/editors/jetbrains/idea-plugins.nix {
inherit (pkgs) callPackage;
};
pluginBuild = jetbrainsPlatforms: pkgs.callPackage ./pkgs/build-support/jetbrains/plugin.nix {
inherit jetbrains jetbrainsPlatforms;
builder = import ./pkgs/applications/editors/jetbrains/builder.nix {
inherit (pkgs) lib;
};
clionPlugins = pkgs.dontRecurseIntoAttrs (jetbrainsPluginsFor pkgs.jetbrains.clion);
ideaCommunityPlugins = pkgs.dontRecurseIntoAttrs (jetbrainsPluginsFor pkgs.jetbrains.idea-community);
ideaUltimatePlugins = pkgs.dontRecurseIntoAttrs (jetbrainsPluginsFor pkgs.jetbrains.idea-ultimate);
clionWithPlugins = clionPlugins.jetbrainsWithPlugins;
ideaCommunityWithPlugins = ideaCommunityPlugins.jetbrainsWithPlugins;
ideaUltimateWithPlugins = ideaUltimatePlugins.jetbrainsWithPlugins;
jbScope = pkgs.lib.makeScope pkgs.newScope (self: pkgs.lib.makeOverridable
({ jetbrainsPlugins ? mkJetbrainsPlugins
, ideaPlugins ? mkIdeaPlugins
}: ({ }
// jetbrainsPlugins // { inherit jetbrainsPlugins; }
// ideaPlugins // { inherit ideaPlugins; }
// {
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 { };

View File

@ -13,12 +13,6 @@ in
options.services.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 {
type = with types; listOf (listOf int);
# Translated from upstream default config. Since it tries to write the
@ -51,7 +45,7 @@ in
config = mkIf cfg.enable {
assertions = singleton {
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 {
@ -66,9 +60,9 @@ in
amdgpu-fan = {
description = "amdgpu fan controller";
wantedBy = [ "default.target" ];
after = [ "amdgpu-pwm.service" ];
after = [ "enable-manual-amdgpu-fan.service" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/amdgpu-fan";
ExecStart = "${pkgs.amdgpu-fan}/bin/amdgpu-fan";
Restart = "always";
};
};

View File

@ -11,12 +11,6 @@ in
{
options.services.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 {
@ -24,10 +18,10 @@ in
radeon-profile-daemon = {
description = "radeon-profile daemon";
wantedBy = [ "multi-user.target" ];
after = [ "amdgpu-pwm.service" ];
after = [ "enable-manual-amdgpu-fan.service" ];
serviceConfig = {
Type = "simple";
ExecStart = "${package}/bin/radeon-profile-daemon";
ExecStart = "${pkgs.radeon-profile-daemon}/bin/radeon-profile-daemon";
};
};
};

View File

@ -1,5 +1,4 @@
{ lib
, stdenv
{ stdenv
, fetchzip
, jetbrainsPlatforms
}:
@ -13,21 +12,19 @@
}:
stdenv.mkDerivation {
inherit pname version;
inherit pname version jetbrainsPlatforms;
src = fetchzip {
inherit sha256;
url = "https://plugins.jetbrains.com/files/${toString pluginId}/${toString versionId}/${filename}";
};
passthru = { inherit jetbrainsPlatforms; };
installPhase = ''
mkdir $out
cp -r * $out/
'';
meta = {
homepage = "https://plugins.jetbrains.com/plugin/${pluginId}-${lib.toLower pname}";
homepage = "https://plugins.jetbrains.com/plugin/${pluginId}-${stdenv.lib.toLower pname}";
};
}

View File

@ -12,20 +12,22 @@ let
then pluginsFun self
else pluginsFun;
# FIXME: Is this still needed?
info = builtins.parseDrvName package.name;
badPlugins = filter (p: ! elem info.name p.jetbrainsPlatforms) plugins;
errorMsg = "plugins [ ${toString (map (p: p.name) badPlugins)} ] are not available for platform ${info.name}";
in
assert assertMsg (length badPlugins == 0) errorMsg;
appendToName "with-plugins" (package.overrideAttrs (oldAttrs: {
passthru = { inherit plugins; };
# TODO: Purely aesthetics, but link the plugin to its name instead of hash-name-version
package.overrideAttrs (oldAttrs: {
# FIXME: versioning: could just expose upstream
name = "${info.name}-with-plugins-${info.version}";
inherit plugins;
installPhase = oldAttrs.installPhase + ''
for plugin in $plugins; do
ln -s "$plugin" "$out/$name/plugins/$(basename $plugin)"
done
'';
}))
})

View File

@ -1,11 +1,6 @@
{ lib, stdenv, fetchzip }:
self:
{ callPackage }:
let
commonBuild = import ../../../build-support/jetbrains/plugin.nix {
inherit lib stdenv fetchzip;
mkPlugin = callPackage ./build-plugin.nix {
jetbrainsPlatforms = [
"clion"
"datagrip"
@ -20,22 +15,30 @@ let
"webstorm"
];
};
generateCommon = lib.makeOverridable ({
common ? ./manual-common-packages.nix
}: let
imported = import common {
inherit (self) callPackage;
in
{
ideavim = mkPlugin {
pname = "IdeaVim";
version = "0.57";
pluginId = 164;
versionId = 85009;
sha256 = "1rwfwj0b0nwi7jxhzxk1r0xc190nf4i3b59i0zknpmgb4yc5clzw";
};
super = imported;
overrides = { };
jetbrainsPlugins = super // overrides;
in jetbrainsPlugins // { inherit commonBuild; });
in generateCommon { }
checkstyle-idea = mkPlugin {
pname = "CheckStyle-IDEA";
version = "5.42.0";
pluginId = 1065;
versionId = 95757;
sha256 = "0sji3649n5zz84dlidqaklipq6vaiafxsvg0gzy3j59mvkz6dk14";
};
google-java-format = mkPlugin rec {
pname = "google-java-format";
version = "1.7.0.4";
pluginId = 8527;
versionId = 83164;
sha256 = "1pmnn1ksiv44kdga53gi3psrm2sva4bqrxizagbr0if2n0rrvgii";
filename = "${pname}.zip";
};
}

View File

@ -1,29 +1,15 @@
{ lib, stdenv, fetchzip }:
self:
{ callPackage }:
let
ideaBuild = import ../../../build-support/jetbrains/plugin.nix {
inherit lib stdenv fetchzip;
mkPlugin = callPackage ./build-plugin.nix {
jetbrainsPlatforms = [ "idea-community" "idea-ultimate" ];
};
generateIdea = lib.makeOverridable ({
idea ? ./manual-idea-packages.nix
}: let
imported = import idea {
inherit (self) callPackage;
in
{
spring-assistant = mkPlugin {
pname = "intellij-spring-assistant";
version = "0.12.0";
pluginId = 10229;
versionId = 44968;
sha256 = "13cglywzhb4j0qj0bs2jwaz2k8pxrxalv35wgkmgkxr635bxmwsj";
};
super = imported;
overrides = { };
ideaPlugins = super // overrides;
in ideaPlugins // { inherit ideaBuild; });
in generateIdea { }
}

View File

@ -1,33 +0,0 @@
{ 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";
})
{ };
}

View File

@ -1,12 +0,0 @@
{ callPackage }:
{
spring-assistant = callPackage
({ ideaBuild }: ideaBuild {
pname = "intellij-spring-assistant";
version = "0.12.0";
pluginId = 10229;
versionId = 44968;
sha256 = "13cglywzhb4j0qj0bs2jwaz2k8pxrxalv35wgkmgkxr635bxmwsj";
})
{ };
}

View File

@ -1,33 +0,0 @@
{ 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;
})
) { })