Compare commits
21 Commits
2ffc8b3fcd
...
jetbrains
Author | SHA1 | Date | |
---|---|---|---|
8090f42cc2
|
|||
c67b2c2b0e
|
|||
af57ecdd22
|
|||
fb2bbf59d0
|
|||
3c8d8f0347
|
|||
28235c3b29
|
|||
7f2b435225
|
|||
a85fe66919
|
|||
129b9305be
|
|||
836cce5196
|
|||
d77a67563a
|
|||
a298d95bd6
|
|||
aceffb4e50
|
|||
906c5ee15c
|
|||
c0fb93b48b
|
|||
b46e60ddec
|
|||
738de5e474
|
|||
5008a658a7
|
|||
0a29cfdf1e
|
|||
95e5685f53
|
|||
a15ba6ca0a
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,6 @@
|
||||
result
|
||||
result-*
|
||||
|
||||
.direnv
|
||||
.envrc
|
||||
|
||||
|
6
flake.lock
generated
6
flake.lock
generated
@ -17,11 +17,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1607525610,
|
||||
"narHash": "sha256-u+5o+8ucEGgm8IdC0t/kRm5BA2YEnUCW4PAQzwF1R30=",
|
||||
"lastModified": 1611414562,
|
||||
"narHash": "sha256-u002KfYA7Uk3vffnnmLz88BmxOzixYFdh+8II6ZT+Kg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "253de1fcdb3b82a74a0bf128a7ae2a7b2fed0932",
|
||||
"rev": "9d6fd2ba135c5b5c85c3332604d39b43e93b8298",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
47
flake.nix
47
flake.nix
@ -8,27 +8,40 @@
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
let
|
||||
inherit (flake-utils.lib) defaultSystems flattenTree;
|
||||
inherit (nixpkgs.lib.attrsets) filterAttrs genAttrs mapAttrs;
|
||||
inherit (flake-utils.lib) eachDefaultSystem flattenTree;
|
||||
inherit (nixpkgs.lib.attrsets) filterAttrs mapAttrs;
|
||||
in
|
||||
{
|
||||
nixosModules = mapAttrs (_: path: import path) (import ./modules);
|
||||
overlay = final: prev: {
|
||||
xeals = nixpkgs.lib.composeExtensions self.overlays.pkgs;
|
||||
};
|
||||
|
||||
overlays = import ./overlays // {
|
||||
pkgs = final: prev: import ./pkgs/top-level/all-packages.nix { pkgs = prev; };
|
||||
};
|
||||
packages = genAttrs defaultSystems
|
||||
(system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
xPkgs = import ./pkgs/top-level/all-packages.nix { inherit pkgs; };
|
||||
in
|
||||
filterAttrs
|
||||
(attr: drv:
|
||||
builtins.elem system drv.meta.platforms or [ ])
|
||||
xPkgs
|
||||
);
|
||||
};
|
||||
|
||||
overlay = final: prev: {
|
||||
xeals = nixpkgs.lib.composeExtensions self.overlays.pkgs;
|
||||
};
|
||||
} // eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
xPkgs = import ./pkgs/top-level/all-packages.nix { inherit pkgs; };
|
||||
mkApp = opts: { type = "app"; } // opts;
|
||||
in
|
||||
rec {
|
||||
packages = filterAttrs
|
||||
(attr: drv: builtins.elem system (drv.meta.platforms or [ ]))
|
||||
(flattenTree xPkgs);
|
||||
|
||||
apps = flattenTree {
|
||||
alacritty = mkApp { program = "${packages.alacritty-ligatures}/bin/alacritty"; };
|
||||
protonmail-bridge = mkApp { program = "${packages.protonmail-bridge}/bin/protonmail-bridge"; };
|
||||
protonmail-bridge-headless = mkApp { program = "${packages.protonmail-bridge}/bin/protonmail-bridge"; };
|
||||
psst = {
|
||||
cli = mkApp { program = "${packages.psst}/bin/psst-cli"; };
|
||||
gui = mkApp { program = "${packages.psst}/bin/psst-gui"; };
|
||||
};
|
||||
samrewritten = mkApp { program = "${packages.samrewritten}/bin/samrewritten"; };
|
||||
spotify-ripper = mkApp { program = "${packages.spotify-ripper}/bin/spotify-ripper"; };
|
||||
};
|
||||
});
|
||||
}
|
||||
|
71
pkgs/applications/audio/psst/default.nix
Normal file
71
pkgs/applications/audio/psst/default.nix
Normal file
@ -0,0 +1,71 @@
|
||||
{ stdenv
|
||||
, fetchFromGitHub
|
||||
, rustPlatform
|
||||
|
||||
, cmake
|
||||
, pkg-config
|
||||
, openssl
|
||||
|
||||
# GUI
|
||||
, withGui ? true
|
||||
, copyDesktopItems
|
||||
, makeDesktopItem
|
||||
, gtk3
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (stdenv.lib) optional optionals;
|
||||
in
|
||||
|
||||
assert withGui -> gtk3.meta.available;
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "psst";
|
||||
version = "20210122.gec114ac";
|
||||
src = fetchFromGitHub {
|
||||
owner = "jpochyla";
|
||||
repo = "psst";
|
||||
rev = "ec114ac8299179c8dd51bc026d6060dc75658b83";
|
||||
sha256 = "02mh6hjnlimadc3w899hccss31p1r4sxgb5880zwn7yiycbq3yyj";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
cargoSha256 = "1m01rycnpy9asspih1x9l5ppfbjnqcfdycmzgkrmdwzah3x8s8xc";
|
||||
|
||||
nativeBuildInputs = [ pkg-config ]
|
||||
++ optional withGui copyDesktopItems;
|
||||
|
||||
buildInputs = [ openssl ]
|
||||
++ optional withGui gtk3;
|
||||
|
||||
cargoBuildFlags = optionals (!withGui) [
|
||||
"--workspace"
|
||||
"--exclude"
|
||||
"psst-gui"
|
||||
];
|
||||
|
||||
# Unable to exclude targets from the check phase as it doesn't respect
|
||||
# `cargoBuildFlags`; to save from attempting to build the GUI without meaning
|
||||
# to, don't bother checking for CLI-only builds.
|
||||
# https://github.com/NixOS/nixpkgs/blob/77d190f10931c1d06d87bf6d772bf65346c71777/pkgs/build-support/rust/default.nix#L241
|
||||
doCheck = withGui;
|
||||
|
||||
desktopItems = optionals withGui [
|
||||
(makeDesktopItem {
|
||||
name = pname;
|
||||
desktopName = "psst";
|
||||
genericName = "Spotify Player";
|
||||
categories = "AudioVideo;Audio;Network;Player;";
|
||||
comment = "Spotify client with native GUI";
|
||||
exec = "psst-gui";
|
||||
extraEntries = "Keywords=spotify;music;";
|
||||
icon = "spotify";
|
||||
type = "Application";
|
||||
})
|
||||
];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Fast and multi-platform Spotify client with native GUI ";
|
||||
homepage = "https://github.com/jpochyla/psst";
|
||||
license = licenses.mit;
|
||||
};
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
{ lib, stdenv, fetchzip }:
|
||||
|
||||
self:
|
||||
|
||||
let
|
||||
|
||||
commonBuild = import ../../../build-support/jetbrains/plugin.nix {
|
||||
inherit lib stdenv fetchzip;
|
||||
jetbrainsPlatforms = [
|
||||
"clion"
|
||||
"datagrip"
|
||||
"goland"
|
||||
"idea-community"
|
||||
"idea-ultimate"
|
||||
"phpstorm"
|
||||
"pycharm-community"
|
||||
"pycharm-professional"
|
||||
"rider"
|
||||
"ruby-mine"
|
||||
"webstorm"
|
||||
];
|
||||
};
|
||||
|
||||
generateCommon = lib.makeOverridable ({
|
||||
common ? ./manual-common-packages.nix
|
||||
}: let
|
||||
|
||||
imported = import common {
|
||||
inherit (self) callPackage;
|
||||
};
|
||||
|
||||
super = imported;
|
||||
|
||||
overrides = { };
|
||||
|
||||
jetbrainsPlugins = super // overrides;
|
||||
|
||||
in jetbrainsPlugins // { inherit commonBuild; });
|
||||
|
||||
in generateCommon { }
|
||||
|
95026
pkgs/applications/editors/jetbrains/idea-generated.nix
Normal file
95026
pkgs/applications/editors/jetbrains/idea-generated.nix
Normal file
File diff suppressed because it is too large
Load Diff
@ -10,7 +10,7 @@ let
|
||||
};
|
||||
|
||||
generateIdea = lib.makeOverridable ({
|
||||
idea ? ./manual-idea-packages.nix
|
||||
idea ? ./idea-generated.nix
|
||||
}: let
|
||||
|
||||
imported = import idea {
|
||||
|
@ -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";
|
||||
})
|
||||
{ };
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{ callPackage }:
|
||||
{
|
||||
spring-assistant = callPackage
|
||||
({ ideaBuild }: ideaBuild {
|
||||
pname = "intellij-spring-assistant";
|
||||
version = "0.12.0";
|
||||
pluginId = 10229;
|
||||
versionId = 44968;
|
||||
sha256 = "13cglywzhb4j0qj0bs2jwaz2k8pxrxalv35wgkmgkxr635bxmwsj";
|
||||
})
|
||||
{ };
|
||||
}
|
12
pkgs/applications/editors/jetbrains/update-jetbrains
Executable file
12
pkgs/applications/editors/jetbrains/update-jetbrains
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell --show-trace ./updater.nix -i bash
|
||||
|
||||
set -e
|
||||
|
||||
for app in $APPS; do
|
||||
./updater-jetbrains $app -o ${app%-[0-9.]*}-generated.nix
|
||||
done
|
||||
|
||||
# Local Variables:
|
||||
# mode: sh
|
||||
# End:
|
@ -7,6 +7,7 @@ import re
|
||||
import requests
|
||||
import subprocess as sp
|
||||
import sys
|
||||
import unicodedata
|
||||
import urllib
|
||||
|
||||
from lxml import etree
|
||||
@ -27,10 +28,15 @@ PRODUCT_CODE = {
|
||||
}
|
||||
|
||||
|
||||
PACKAGE_RE = re.compile("[^0-9A-Za-z._-]")
|
||||
HTML_RE = re.compile("<[^>]+/?>")
|
||||
|
||||
|
||||
def to_slug(name):
|
||||
slug = name.replace(" ", "-").lstrip(".")
|
||||
for char in ",/;'\\<>:\"|!@#$%^&*()":
|
||||
slug = slug.replace(char, "")
|
||||
slug = unicodedata.normalize("NFD", slug).encode("ascii", "ignore").decode("utf-8")
|
||||
return slug
|
||||
|
||||
|
||||
@ -59,18 +65,15 @@ class Build:
|
||||
return self.code + "-" + self.version
|
||||
|
||||
|
||||
PACKAGE_RE = re.compile("[^0-9A-Za-z._-]")
|
||||
HTML_RE = re.compile("<[^>]+/?>")
|
||||
|
||||
|
||||
class Plugin:
|
||||
def __init__(self, data, category=None):
|
||||
def __init__(self, data, build, category=None):
|
||||
self.build = build
|
||||
self.category = category
|
||||
self.name = data.find("name").text
|
||||
self.id = data.find("id").text
|
||||
self.xml_id = data.find("id").text
|
||||
self._description = data.find("description").text
|
||||
self.url = data.get("url") or data.find("vendor").get("url")
|
||||
self.version = data.find("version").text
|
||||
self.version = data.find("version").text.replace(" ", "-")
|
||||
self.slug = to_slug(self.name)
|
||||
self.orig_slug = self.slug
|
||||
|
||||
@ -84,7 +87,7 @@ class Plugin:
|
||||
def description(self):
|
||||
return re.sub(HTML_RE, "", self._description or "").strip()
|
||||
|
||||
def download_url(self, build, deref=True):
|
||||
def get_download_url(self, deref=True):
|
||||
"""
|
||||
Provides the ZIP download URL for this plugin.
|
||||
|
||||
@ -94,18 +97,52 @@ class Plugin:
|
||||
(which it is by default). However, this comes at the cost of requiring
|
||||
an HTTP request.
|
||||
"""
|
||||
id = urllib.parse.quote(self.id)
|
||||
url = f"https://plugins.jetbrains.com/pluginManager?action=download&id={id}&build={build}"
|
||||
id = urllib.parse.quote(self.xml_id)
|
||||
url = f"https://plugins.jetbrains.com/pluginManager?action=download&id={id}&build={self.build}"
|
||||
if deref:
|
||||
res = requests.get(url, allow_redirects=not deref)
|
||||
url = "https://plugins.jetbrains.com" + re.sub(
|
||||
"\?.*$", "", res.headers["location"]
|
||||
)
|
||||
self.jetbrains_url = url
|
||||
if url.endswith("external"):
|
||||
res = requests.get(url, allow_redirects=not deref)
|
||||
url = res.headers["location"]
|
||||
return url
|
||||
|
||||
def fetch_external(self, update_only=False):
|
||||
"""
|
||||
Performs network calls to update this plugin with information that
|
||||
cannot be performed from the public XML API.
|
||||
|
||||
Additional attributes provided after this method:
|
||||
|
||||
download_url : the plugin download location
|
||||
sha : the SHA256 of the download source
|
||||
|
||||
If update_only is true, a full update is performed, also providing:
|
||||
|
||||
id : the plugin integer ID
|
||||
license_url : the plugin license URL
|
||||
license : the Nixpkgs license attribute
|
||||
"""
|
||||
self.download_url = self.get_download_url(deref=True)
|
||||
self.sha = prefetch(self, self.build, self.download_url)
|
||||
|
||||
if update_only:
|
||||
return
|
||||
|
||||
self.id = self.jetbrains_url.split("/")[4]
|
||||
res = requests.get(
|
||||
f"https://plugins.jetbrains.com/api/plugins/{self.id}"
|
||||
).json()
|
||||
try:
|
||||
self.url = self.url or res["urls"]["sourceCodeUrl"]
|
||||
except KeyError:
|
||||
pass
|
||||
self.license_url = res["urls"]["licenseUrl"]
|
||||
self.license = translate_license(self.license_url, fallback=self.url)
|
||||
|
||||
def packagename(self):
|
||||
slug = re.sub(PACKAGE_RE, "", self.slug.lower()).replace(".", "-")
|
||||
if slug[0] in "1234567890":
|
||||
@ -128,16 +165,16 @@ def list_plugins(build):
|
||||
https://plugins.jetbrains.com/docs/marketplace/plugins-list.html
|
||||
"""
|
||||
resp = requests.get(f"https://plugins.jetbrains.com/plugins/list/?build={build}")
|
||||
return parse_repository(resp.content)
|
||||
return parse_repository(resp.content, build)
|
||||
|
||||
|
||||
def parse_repository(content):
|
||||
def parse_repository(content, build):
|
||||
tree = etree.XML(content)
|
||||
plugins = []
|
||||
for cat in tree.findall("category"):
|
||||
cat_name = cat.get("name")
|
||||
for plugin in cat.findall("idea-plugin"):
|
||||
plugins.append(Plugin(plugin, cat_name))
|
||||
plugins.append(Plugin(plugin, build, cat_name))
|
||||
return plugins
|
||||
|
||||
|
||||
@ -155,28 +192,101 @@ def deduplicate(plugins):
|
||||
|
||||
def prefetch(plugin, build, url=None):
|
||||
if not url:
|
||||
url = plugin.download_url(build)
|
||||
url = plugin.download_url or plugin.get_download_url()
|
||||
res = sp.run(
|
||||
["nix-prefetch-url", "--name", plugin.filename(), url], capture_output=True,
|
||||
)
|
||||
if not res.stdout:
|
||||
raise IOError(f"nix-prefetch-url {plugin} failed: {res.stderr.decode('utf-8')}")
|
||||
return res.stdout.decode("utf-8").strip()
|
||||
raise IOError(
|
||||
f"nix-prefetch-url {plugin} failed: {res.stderr.decode('unicode-escape')}"
|
||||
)
|
||||
return res.stdout.decode("unicode-escape").strip()
|
||||
|
||||
|
||||
def write_packages(outfile, plugins, build):
|
||||
builder = build.builder()
|
||||
def custom_license(short, full, url, free=False):
|
||||
return f"""{{
|
||||
shortName = "{short}";
|
||||
fullName = "{full}";
|
||||
url = "{url}";
|
||||
free = {"true" if free else "false"};
|
||||
}}"""
|
||||
|
||||
|
||||
def arr(url):
|
||||
return custom_license("allrightsreserved", "All Rights Reserved", url)
|
||||
|
||||
|
||||
def translate_license(url, fallback=""):
|
||||
license = url.lower()
|
||||
if license == "":
|
||||
print(f"no license for {fallback}", file=sys.stderr)
|
||||
return arr(fallback)
|
||||
# Common (license) hosts
|
||||
elif "github.com" in license or "raw.githubusercontent.com" in license:
|
||||
try:
|
||||
owner, repo = url.split("/")[3:5]
|
||||
except ValueError:
|
||||
print(f"no license metadata for {url}", file=sys.stderr)
|
||||
return arr(url)
|
||||
res = requests.get(
|
||||
f"https://api.github.com/repos/{owner}/{repo}",
|
||||
headers={"Accept": "application/vnd.github.v3+json"},
|
||||
).json()
|
||||
try:
|
||||
return translate_license(res["license"]["key"])
|
||||
except (KeyError, TypeError):
|
||||
print(f"no license metadata for {url}", file=sys.stderr)
|
||||
return arr(url)
|
||||
elif "opensource.org" in license:
|
||||
os_license = license.rstrip("/").split("/")[-1]
|
||||
if os_license == "alphabetical":
|
||||
# Doesn't actually have a license, it's the listing page
|
||||
return arr(fallback)
|
||||
return translate_license(os_license)
|
||||
# Actual translations now
|
||||
elif "apache.org/licenses/license-2.0" in license or "apache-2.0" in license:
|
||||
return "lib.licenses.asl20"
|
||||
elif "artistic-2" in license:
|
||||
return "lib.licenses.artistic2"
|
||||
elif "bsd-2-clause" in license:
|
||||
return "lib.licenses.bsd2"
|
||||
elif "bsd-3-clause" in license:
|
||||
return "lib.licenses.bsd3"
|
||||
elif "eclipse.org/legal/epl-2.0" in license:
|
||||
return "lib.licenses.epl20"
|
||||
elif "gpl-3.0" in license:
|
||||
return "lib.licenses.gpl3Only"
|
||||
elif "mit" in license:
|
||||
return "lib.licenses.mit"
|
||||
elif "osd" in license:
|
||||
return "lib.licenses.free"
|
||||
elif "other" == license:
|
||||
return arr(fallback)
|
||||
# Custom known licenses
|
||||
elif "plugins.jetbrains.com/legal/terms-of-use" in license:
|
||||
return custom_license(
|
||||
"jetbrains", "Jetbrains Plugin Marketplace Agreement", license
|
||||
)
|
||||
# Fallback
|
||||
else:
|
||||
print(f"unrecognised license {license}", file=sys.stderr)
|
||||
return arr(license)
|
||||
|
||||
|
||||
def write_packages(outfile, plugins):
|
||||
builder = plugins[0].build.builder() or ""
|
||||
outfile.write("{callPackage}:\n{")
|
||||
|
||||
for plugin in plugins:
|
||||
src_url = plugin.download_url(build, deref=True)
|
||||
src_ext = os.path.splitext(src_url)[-1]
|
||||
|
||||
for i, plugin in enumerate(plugins):
|
||||
print(f"{i:04} {plugin.packagename()}")
|
||||
try:
|
||||
sha = prefetch(plugin, build, src_url)
|
||||
plugin.fetch_external()
|
||||
except IOError as e:
|
||||
print(e, file=sys.stderr)
|
||||
continue
|
||||
src_url = plugin.download_url
|
||||
src_ext = os.path.splitext(src_url)[-1]
|
||||
sha = plugin.sha
|
||||
|
||||
build_inputs = []
|
||||
if src_ext == ".zip":
|
||||
@ -186,7 +296,7 @@ def write_packages(outfile, plugins, build):
|
||||
# internal and external plugins; need to find some way to resolve them
|
||||
requires = []
|
||||
# TODO: Licenses are actually on the website, but aren't provided in the API
|
||||
license = "lib.licenses.free"
|
||||
license = plugin.license
|
||||
|
||||
call_args = [str(builder), "fetchurl", "lib"]
|
||||
for binput in build_inputs:
|
||||
@ -197,7 +307,7 @@ def write_packages(outfile, plugins, build):
|
||||
{plugin.packagename()} = callPackage ({{ {", ".join(sorted(call_args))} }}: {builder} {{
|
||||
pname = "{plugin.slug}";
|
||||
plugname = "{plugin.name}";
|
||||
plugid = "{plugin.id}";
|
||||
plugid = "{plugin.xml_id}";
|
||||
version = "{plugin.version}";
|
||||
src = fetchurl {{
|
||||
url = "{src_url}";
|
||||
@ -227,6 +337,7 @@ def main():
|
||||
parser.add_argument(
|
||||
"-o", "--out", type=str, help="File to write plugins to",
|
||||
)
|
||||
parser.add_argument("-O", "--offset", type=int, help="Offset number of packages")
|
||||
parser.add_argument(
|
||||
"package",
|
||||
metavar="PACKAGE",
|
||||
@ -241,15 +352,17 @@ def main():
|
||||
plugins.sort(key=lambda p: p.slug)
|
||||
deduplicate(plugins)
|
||||
|
||||
if args.offset:
|
||||
plugins = plugins[args.offset :]
|
||||
if args.number:
|
||||
plugins = plugins[: args.number]
|
||||
|
||||
print(f"Generating packages for {len(plugins)} plugins", file=sys.stderr)
|
||||
if not args.out:
|
||||
write_packages(sys.stdout, plugins, build)
|
||||
write_packages(sys.stdout, plugins)
|
||||
else:
|
||||
with open(args.out, "w") as f:
|
||||
write_packages(f, plugins, build)
|
||||
write_packages(f, plugins)
|
||||
|
||||
|
||||
main()
|
26
pkgs/applications/editors/jetbrains/updater.nix
Normal file
26
pkgs/applications/editors/jetbrains/updater.nix
Normal file
@ -0,0 +1,26 @@
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
let
|
||||
inherit (pkgs.stdenv) lib;
|
||||
in
|
||||
pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.bash
|
||||
];
|
||||
|
||||
APPS = lib.mapAttrsToList
|
||||
(k: v: v.name)
|
||||
{
|
||||
inherit (pkgs.jetbrains)
|
||||
clion
|
||||
datagrip
|
||||
goland
|
||||
idea-community
|
||||
idea-ultimate
|
||||
phpstorm
|
||||
pycharm-community
|
||||
pycharm-professional
|
||||
rider
|
||||
ruby-mine
|
||||
webstorm;
|
||||
};
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
{ lib
|
||||
}: self:
|
||||
{ lib, makeWrapper, runCommand }: self:
|
||||
|
||||
with lib;
|
||||
|
||||
@ -20,12 +19,31 @@ 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
|
||||
installPhase = oldAttrs.installPhase + ''
|
||||
for plugin in $plugins; do
|
||||
ln -s "$plugin" "$out/$name/plugins/$(basename $plugin)"
|
||||
done
|
||||
'';
|
||||
}))
|
||||
runCommand
|
||||
(appendToName "with-plugins" package).name
|
||||
{
|
||||
nativeBuildInputs = [ package makeWrapper ];
|
||||
inherit package plugins;
|
||||
packageName = package.name;
|
||||
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
|
||||
} ''
|
||||
mkdir -p $out/$packageName/plugins
|
||||
for dir in $package/*; do
|
||||
cp -r $dir $out/
|
||||
done
|
||||
|
||||
# Install plugins
|
||||
for plugin in $plugins; do
|
||||
local pluginName=$(basename $plugin)
|
||||
pluginName=''${pluginName#*-}
|
||||
pluginName=''${pluginName%-[0-9.]*}
|
||||
ln -s $plugin $out/$packageName/plugins/$pluginName
|
||||
done
|
||||
|
||||
# Fix up wrapper
|
||||
substituteInPlace $out/bin/* \
|
||||
--replace "$package" "$out"
|
||||
''
|
||||
|
@ -20,16 +20,16 @@ let
|
||||
|
||||
buildGoModule (stdenv.lib.recursiveUpdate args rec {
|
||||
inherit pname;
|
||||
version = "1.5.2";
|
||||
version = "1.5.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ProtonMail";
|
||||
repo = "proton-bridge";
|
||||
rev = "br-${version}";
|
||||
sha256 = "1mv7fwapcarii43nnsgk7ifqlah07k54zk6vxxxmrp04gy0mzki6";
|
||||
sha256 = "1na8min9cmn82lpad58abw6837k303fr09l6cvzswaxs73f231ig";
|
||||
};
|
||||
|
||||
vendorSha256 = "01d6by8xj9py72lpfns08zqnsym98v8imb7d6hgmnzp4hfqzbz3c";
|
||||
vendorSha256 = "1219xa1347877bfhnid15y6w9s4hf1czbrmll2iha4gpsmg066bb";
|
||||
|
||||
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [
|
||||
pkg-config
|
||||
|
@ -0,0 +1,62 @@
|
||||
diff --git a/cardboard/meson.build b/cardboard/meson.build
|
||||
index b236f71..a90f230 100644
|
||||
--- a/cardboard/meson.build
|
||||
+++ b/cardboard/meson.build
|
||||
@@ -4,24 +4,15 @@ xkbcommon = dependency('xkbcommon')
|
||||
xcb = dependency('xcb', required: get_option('xwayland'))
|
||||
|
||||
wlroots_version = '>=0.10.0'
|
||||
-wlroots_proj = subproject(
|
||||
+wlroots = dependency(
|
||||
'wlroots',
|
||||
- default_options: ['examples=false'],
|
||||
required: true,
|
||||
version: wlroots_version,
|
||||
)
|
||||
|
||||
-wlroots = wlroots_proj.get_variable('wlroots')
|
||||
-wlroots_conf = wlroots_proj.get_variable('conf_data')
|
||||
-wlroots_has_xwayland = wlroots_conf.get('WLR_HAS_XWAYLAND') == 1
|
||||
+have_xwayland = xcb.found()
|
||||
|
||||
-if get_option('xwayland').enabled() and not wlroots_has_xwayland
|
||||
- error('Cannot enable Xwayland support in cardboard: wlroots has been built without Xwayland support')
|
||||
-endif
|
||||
-have_xwayland = xcb.found() and wlroots_has_xwayland
|
||||
-
|
||||
-expected_proj = subproject('expected', required: true)
|
||||
-expected = expected_proj.get_variable('expected_dep')
|
||||
+expected = dependency('tl-expected', required: true, method: 'cmake', modules: ['tl::expected'])
|
||||
|
||||
conf_data = configuration_data()
|
||||
conf_data.set10('HAVE_XWAYLAND', have_xwayland)
|
||||
diff --git a/cutter/meson.build b/cutter/meson.build
|
||||
index f1260a4..1485f37 100644
|
||||
--- a/cutter/meson.build
|
||||
+++ b/cutter/meson.build
|
||||
@@ -1,6 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
-expected_proj = subproject('expected', required: true)
|
||||
-expected = expected_proj.get_variable('expected_dep')
|
||||
+expected = dependency('tl-expected', required: true, method: 'cmake', modules: ['tl::expected'])
|
||||
|
||||
executable(
|
||||
'cutter',
|
||||
diff --git a/libcardboard/meson.build b/libcardboard/meson.build
|
||||
index 89698fe..3ac8115 100644
|
||||
--- a/libcardboard/meson.build
|
||||
+++ b/libcardboard/meson.build
|
||||
@@ -1,11 +1,9 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
libcardboard_inc = include_directories('include')
|
||||
|
||||
-expected_proj = subproject('expected', required: true)
|
||||
-expected = expected_proj.get_variable('expected_dep')
|
||||
+expected = dependency('tl-expected', required: true, method: 'cmake', modules: ['tl::expected'])
|
||||
|
||||
-cereal_proj = subproject('cereal', required: true)
|
||||
-cereal = cereal_proj.get_variable('cereal_dep')
|
||||
+cereal = dependency('cereal', required: true, method: 'cmake')
|
||||
|
||||
sources = files(
|
||||
'src/command_protocol.cpp',
|
71
pkgs/applications/window-managers/cardboard/default.nix
Normal file
71
pkgs/applications/window-managers/cardboard/default.nix
Normal file
@ -0,0 +1,71 @@
|
||||
{ stdenv
|
||||
, fetchFromGitLab
|
||||
, fetchzip
|
||||
|
||||
, cereal
|
||||
, cmake
|
||||
, git
|
||||
, libGL
|
||||
, libX11
|
||||
, libinput
|
||||
, libxkbcommon
|
||||
, mesa
|
||||
, meson
|
||||
, ninja
|
||||
, pixman
|
||||
, pkg-config
|
||||
, tl-expected
|
||||
, wayland
|
||||
, wayland-protocols
|
||||
, wlroots
|
||||
, xwayland
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "cardboard";
|
||||
version = "20210120.g7b15613";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
owner = "cardboardwm";
|
||||
repo = "cardboard";
|
||||
rev = "7b15613e6e1222a6a83d69a2e5da2810dfb45522";
|
||||
sha256 = "044sb0lv1gcywpdncvlv7npxvbsqcc1mwpk0f6i73dinchdz7gmq";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./0001-use-system-dependencies.patch
|
||||
];
|
||||
|
||||
# CMake likes to own the configurePhase, but we only need it for dependency
|
||||
# discovery. Remove it.
|
||||
configurePhase = "mesonConfigurePhase";
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
cereal
|
||||
libGL
|
||||
libX11
|
||||
libinput
|
||||
libxkbcommon
|
||||
pixman
|
||||
tl-expected
|
||||
wayland
|
||||
wayland-protocols
|
||||
wlroots
|
||||
];
|
||||
|
||||
passthru.providedSessions = [ "cardboard" ];
|
||||
|
||||
meta = {
|
||||
description = "Scrollable tiling Wayland compositor designed with laptops in mind";
|
||||
homepage = "https://gitlab.com/cardboardwm/cardboard";
|
||||
license = stdenv.lib.licenses.gpl3;
|
||||
platforms = wlroots.meta.platforms;
|
||||
};
|
||||
}
|
@ -4,30 +4,38 @@
|
||||
, jetbrainsPlatforms
|
||||
}:
|
||||
|
||||
{ pluginId
|
||||
{ plugid
|
||||
, pname
|
||||
, version
|
||||
, versionId
|
||||
, sha256
|
||||
, filename ? "${pname}-${version}.zip"
|
||||
}:
|
||||
, ...
|
||||
}@args:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
inherit pname version;
|
||||
let
|
||||
|
||||
src = fetchzip {
|
||||
inherit sha256;
|
||||
url = "https://plugins.jetbrains.com/files/${toString pluginId}/${toString versionId}/${filename}";
|
||||
defaultMeta = {
|
||||
broken = false;
|
||||
} // lib.optionalAttrs ((args.src.meta.homepage or "") != "") {
|
||||
homepage = args.src.meta.homepage;
|
||||
} // lib.optionalAttrs ((args.src.meta.description or "") != "") {
|
||||
description = args.src.meta.description;
|
||||
} // lib.optionalAttrs ((args.src.meta.license or {}) != {}) {
|
||||
license = args.src.meta.license;
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation (args // {
|
||||
passthru = { inherit jetbrainsPlatforms; };
|
||||
|
||||
dontUnpack = lib.any (lib.hasSuffix ".jar") args.src.urls;
|
||||
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
cp -r * $out/
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "https://plugins.jetbrains.com/plugin/${pluginId}-${lib.toLower pname}";
|
||||
inherit (args.meta) license description;
|
||||
homepage = if (args.meta.homepage == "") then null else args.meta.homepage;
|
||||
};
|
||||
}
|
||||
})
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "go-qt";
|
||||
version = "20200904";
|
||||
version = "20200904.gc0c124a";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "therecipe";
|
||||
|
@ -26,9 +26,10 @@ stdenv.mkDerivation rec {
|
||||
mkdir -p $out/include $out/lib
|
||||
'';
|
||||
|
||||
meta = {
|
||||
meta = with stdenv.lib; {
|
||||
homepage = "https://github.com/xant/libhl";
|
||||
description = "Simple and fast C library implementing a thread-safe API to manage hash-tables, linked lists, lock-free ring buffers and queues ";
|
||||
license = stdenv.lib.licenses.lgpl3;
|
||||
license = licenses.lgpl3;
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
|
@ -7,13 +7,13 @@
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "zsh-z";
|
||||
version = "2020.09.19.09209db";
|
||||
version = "20210117.g289a4a7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "agkozak";
|
||||
repo = "zsh-z";
|
||||
rev = "09209db2daf4b0e7f180cea04d1344fcc06a9410";
|
||||
sha256 = "06z96v3w998hcws13lj6332154aqg1qg3ignv2x835frq677yfzm";
|
||||
rev = "289a4a7208db9b1778cba71c58fed46dbcea3bc7";
|
||||
sha256 = "016prpavxdzjg372y2700rczdgzjb53bqz5mxjgmvrvjxwj69cf0";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
@ -21,8 +21,7 @@ stdenv.mkDerivation {
|
||||
propogatedBuildInputs = [ zsh ];
|
||||
|
||||
installPhase = ''
|
||||
install -D zsh-z.plugin.zsh \
|
||||
$out/share/zsh-z/zsh-z.zsh
|
||||
install -D zsh-z.plugin.zsh $out/share/zsh-z/zsh-z.zsh
|
||||
installShellCompletion --zsh _zshz
|
||||
'';
|
||||
|
||||
@ -30,5 +29,6 @@ stdenv.mkDerivation {
|
||||
description = ''Jump quickly to directories that you have visited "frecently." A native ZSH port of z.sh.'';
|
||||
homepage = "https://github.com/agkozak/zsh-z";
|
||||
license = stdenv.lib.licenses.mit;
|
||||
platforms = zsh.meta.platforms;
|
||||
};
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "radeon-profile-daemon";
|
||||
version = "20190603";
|
||||
version = "20190603.g06qxq2h";
|
||||
|
||||
nativeBuildInputs = [ qmake ];
|
||||
buildInputs = [ qtbase ];
|
||||
|
@ -13,13 +13,13 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "SamRewritten";
|
||||
version = "2.0";
|
||||
version = "2.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "PaulCombal";
|
||||
repo = pname;
|
||||
rev = "202005";
|
||||
sha256 = "0zcb6cmzk4fvbf0rkyyfvlnh9mhi0wz89parprkz6vxrj65ph1f6";
|
||||
rev = "202008";
|
||||
sha256 = "ab7903b997675b0d4d7eede15430fc5ca2736e6c25c7f95a7c97e1ce25582a1c";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ gnumake pkg-config ];
|
||||
@ -33,21 +33,10 @@ stdenv.mkDerivation rec {
|
||||
|
||||
NIX_CFLAGS_LINK = "-pthread";
|
||||
|
||||
# FIXME: Use `make install` after the next release
|
||||
# FIXME: Get `substituteInPlace` working
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib/SamRewritten/{bin,glade,assets}
|
||||
mkdir -p $out/share/icons/hicolor/{64x64,256x256}/apps
|
||||
mkdir -p $out/share/applications
|
||||
mkdir -p $out/bin
|
||||
cp bin/launch.sh bin/samrewritten bin/libsteam_api.so $out/lib/SamRewritten/bin/
|
||||
ln -s $out/lib/SamRewritten/bin/launch.sh $out/bin/samrewritten
|
||||
cp glade/main_window.glade $out/lib/SamRewritten/glade/main_window.glade
|
||||
cp assets/icon_64.png $out/share/icons/hicolor/64x64/apps/samrewritten.png
|
||||
cp assets/icon_256.png $out/share/icons/hicolor/256x256/apps/samrewritten.png
|
||||
cp assets/icon_256.png $out/lib/SamRewritten/assets/
|
||||
makeFlags = [ "PREFIX=$(out)" ];
|
||||
|
||||
substitute package/samrewritten.desktop $out/share/applications/samrewritten.desktop \
|
||||
postFixup = ''
|
||||
substituteInPlace $out/share/applications/samrewritten.desktop \
|
||||
--replace /usr/bin/samrewritten $out/bin/samrewritten
|
||||
'';
|
||||
|
||||
@ -55,5 +44,6 @@ stdenv.mkDerivation rec {
|
||||
description = "Steam Achievement Manager For Linux";
|
||||
homepage = "https://github.com/PaulCombal/SamRewritten";
|
||||
license = licenses.gpl3;
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ assert opusSupport -> opusTools.meta.available;
|
||||
|
||||
python2Packages.buildPythonApplication rec {
|
||||
pname = "spotify-ripper";
|
||||
version = "2016.12.31";
|
||||
version = "20161231.gd046419";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "hbashton";
|
||||
|
@ -2,24 +2,22 @@
|
||||
|
||||
rec {
|
||||
# Alacritty with the unmerged ligature patches applied.
|
||||
alacritty-ligatures = (pkgs.alacritty.override {
|
||||
inherit (pkgs.rustPackages_1_45) rustPlatform;
|
||||
}).overrideAttrs (oldAttrs: rec {
|
||||
alacritty-ligatures = pkgs.alacritty.overrideAttrs (oldAttrs: rec {
|
||||
pname = "${oldAttrs.pname}-ligatures";
|
||||
version = "0.7.0.20201204";
|
||||
version = "0.7.1.20210107.gada2680";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "zenixls2";
|
||||
repo = "alacritty";
|
||||
fetchSubmodules = true;
|
||||
rev = "9adfaeb01bffb902eb305ed9de376d2032ba994e";
|
||||
sha256 = "0lvynwgjrcrpvywpmqniw27268m0m9lw0lpwnfrbhipyp24c7pnx";
|
||||
rev = "ada2680e79a8f53cd350263c8cc91d2e2a264d81";
|
||||
sha256 = "0c0k1ib1dl35731zyjb32apyn28xc63mhbwsig5mz3hnkyk5nisr";
|
||||
};
|
||||
|
||||
cargoDeps = oldAttrs.cargoDeps.overrideAttrs (pkgs.lib.const {
|
||||
name = "${pname}-${version}-vendor.tar.gz";
|
||||
inherit src;
|
||||
outputHash = "1jjyqxpqk5k3kdjb4hmff562j2jncjmpq6wyyi7i3f3v1qc3xsb9";
|
||||
outputHash = "1d1yz4xmal0f3c0pcn59lxfh5a3532nv7dv7s95svvi8qsvnk9gv";
|
||||
});
|
||||
|
||||
ligatureInputs = [
|
||||
@ -39,10 +37,17 @@ rec {
|
||||
--set-rpath ${pkgs.lib.makeLibraryPath ligatureInputs}:"$(patchelf --show-rpath $out/bin/alacritty)" \
|
||||
$out/bin/alacritty
|
||||
'';
|
||||
|
||||
meta = oldAttrs.meta // {
|
||||
description = "Alacritty with ligature patch applied";
|
||||
homepage = "https://github.com/zenixls2/alacritty/tree/ligature";
|
||||
};
|
||||
});
|
||||
|
||||
amdgpu-fan = pkgs.callPackage ../tools/misc/amdgpu-fan { };
|
||||
|
||||
cardboard = pkgs.callPackage ../applications/window-managers/cardboard { };
|
||||
|
||||
goModules = pkgs.recurseIntoAttrs rec {
|
||||
qt = pkgs.libsForQt512.callPackage ../development/go-modules/qt { };
|
||||
};
|
||||
@ -50,7 +55,7 @@ rec {
|
||||
# A functional Jetbrains IDE-with-plugins package set.
|
||||
jetbrains = pkgs.dontRecurseIntoAttrs rec {
|
||||
jetbrainsPluginsFor = variant: import ../top-level/jetbrains-plugins.nix {
|
||||
inherit (pkgs) lib newScope stdenv fetchzip;
|
||||
inherit (pkgs) lib newScope stdenv fetchzip makeWrapper runCommand;
|
||||
inherit variant;
|
||||
};
|
||||
|
||||
@ -91,6 +96,8 @@ rec {
|
||||
patches = (oldAttrs.patches or [ ]) ++ [ ../applications/misc/polybar/9button.patch ];
|
||||
});
|
||||
|
||||
psst = pkgs.callPackage ../applications/audio/psst { };
|
||||
|
||||
python2Packages =
|
||||
let
|
||||
fixVersion =
|
||||
|
@ -2,29 +2,25 @@
|
||||
, newScope
|
||||
, stdenv
|
||||
, fetchzip
|
||||
, makeWrapper
|
||||
, runCommand
|
||||
|
||||
, 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;
|
||||
inherit lib makeWrapper runCommand;
|
||||
};
|
||||
|
||||
in lib.makeScope newScope (self: lib.makeOverridable ({
|
||||
jetbrainsPlugins ? mkJetbrainsPlugins self
|
||||
, ideaPlugins ? mkIdeaPlugins self
|
||||
ideaPlugins ? mkIdeaPlugins self
|
||||
}: ({ }
|
||||
// jetbrainsPlugins // { inherit jetbrainsPlugins; }
|
||||
// ideaPlugins // { inherit ideaPlugins; }
|
||||
// {
|
||||
inherit variant;
|
||||
|
Reference in New Issue
Block a user