19 Commits

Author SHA1 Message Date
0335b240b6 ytarchive: init at 0.2.2 2021-10-02 13:44:16 +10:00
7edffe7e56 ci: cachix/install-nix-action: 13 -> 14
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 13 to 14.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v13...v14)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-16 17:20:35 +10:00
f218f59184 alacritty-ligatures: mark as build locally
Sick of it producing issues that don't crop up building localling and
breaking CI.
2021-06-12 14:57:11 +10:00
1b190f8a81 cardboard: mark as broken 2021-06-12 14:36:39 +10:00
f7f4206afa alacritty-ligatures: refactor into standalone file 2021-06-12 14:36:39 +10:00
ca67f392b5 ci: cachix/cachix-action: v9 -> v10
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from v9 to v10.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v9...73e75d1a0cd4330597a571e8f9dedb41faa2fc4e)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-12 11:11:23 +10:00
3ce504e445 ci: bump cachix/cachix-action from v8 to v9 (#9)
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from v8 to v9.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v8...2689c27f57daedc905895d92ad18fe5ce470df9e)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-12 11:11:23 +10:00
58abb0d562 ci: bump cachix/install-nix-action from v12 to v13 (#10)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from v12 to v13.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v12...8d6d5e949675fbadb765c6b1a975047fa5f09b27)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-12 11:11:23 +10:00
2cf1b51843 flake: update inputs 2021-06-12 11:11:23 +10:00
d8ae11352e alacritty-ligatures: remove terminfo output 2021-06-12 11:11:23 +10:00
7078ef0677 ci: disable nixos-unstable channel in matrix 2021-06-12 11:11:23 +10:00
b2c0121005 alacritty-ligatures: 0.7.1.20210107.gada2680 -> 0.7.2.20210209.g3ed0430 2021-06-12 11:11:23 +10:00
cf95fb9600 radeon-profile-daemon: add wrapQtAppsHook
Required as part of the latest staging-next commit set to Nixpkgs [1].

Note that this breaks builds on all current non-unstable Nixpkgs
branches (but as the repository notes, they are not supported anyway).

[1]: 02924cf951/doc/languages-frameworks/qt.section.md
2021-06-12 11:11:23 +10:00
3c27e38073 flake: update inputs 2021-02-20 21:26:04 +11:00
86f1713639 alacritty-ligatures: fix rpath flag 2021-02-05 10:21:00 +11:00
3dbd760954 flake: update inputs 2021-02-01 08:50:19 +11:00
8b290acc50 protonmail-bridge: separate builder into new file 2021-02-01 08:50:19 +11:00
b960c361a9 treewide: stdenv.lib -> lib
https://github.com/NixOS/nixpkgs/issues/108938
2021-02-01 08:50:19 +11:00
0c87ddac9e alacritty-ligatures: fix commit hash 2021-01-31 18:12:20 +11:00
30 changed files with 340 additions and 95380 deletions

View File

@ -29,7 +29,7 @@ jobs:
cachixName: cachixName:
- xeals - xeals
nixPath: nixPath:
- nixpkgs=channel:nixos-unstable # - nixpkgs=channel:nixos-unstable
- nixpkgs=channel:nixpkgs-unstable - nixpkgs=channel:nixpkgs-unstable
# Disable due to buildGoModule and buildRustPackage # Disable due to buildGoModule and buildRustPackage
# - nixpkgs=channel:nixos-20.03 # - nixpkgs=channel:nixos-20.03
@ -38,13 +38,13 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.3.4
- name: Install nix - name: Install nix
uses: cachix/install-nix-action@v12 uses: cachix/install-nix-action@v14
with: with:
nix_path: "${{ matrix.nixPath }}" nix_path: "${{ matrix.nixPath }}"
- name: Show nixpkgs version - name: Show nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version' run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- name: Setup cachix - name: Setup cachix
uses: cachix/cachix-action@v8 uses: cachix/cachix-action@v10
if: ${{ matrix.cachixName != '<YOUR_CACHIX_NAME>' }} if: ${{ matrix.cachixName != '<YOUR_CACHIX_NAME>' }}
with: with:
name: ${{ matrix.cachixName }} name: ${{ matrix.cachixName }}

View File

@ -7,7 +7,6 @@ import re
import requests import requests
import subprocess as sp import subprocess as sp
import sys import sys
import unicodedata
import urllib import urllib
from lxml import etree from lxml import etree
@ -28,15 +27,10 @@ PRODUCT_CODE = {
} }
PACKAGE_RE = re.compile("[^0-9A-Za-z._-]")
HTML_RE = re.compile("<[^>]+/?>")
def to_slug(name): def to_slug(name):
slug = name.replace(" ", "-").lstrip(".") slug = name.replace(" ", "-").lstrip(".")
for char in ",/;'\\<>:\"|!@#$%^&*()": for char in ",/;'\\<>:\"|!@#$%^&*()":
slug = slug.replace(char, "") slug = slug.replace(char, "")
slug = unicodedata.normalize("NFD", slug).encode("ascii", "ignore").decode("utf-8")
return slug return slug
@ -65,15 +59,18 @@ class Build:
return self.code + "-" + self.version return self.code + "-" + self.version
PACKAGE_RE = re.compile("[^0-9A-Za-z._-]")
HTML_RE = re.compile("<[^>]+/?>")
class Plugin: class Plugin:
def __init__(self, data, build, category=None): def __init__(self, data, category=None):
self.build = build
self.category = category self.category = category
self.name = data.find("name").text self.name = data.find("name").text
self.xml_id = data.find("id").text self.id = data.find("id").text
self._description = data.find("description").text self._description = data.find("description").text
self.url = data.get("url") or data.find("vendor").get("url") self.url = data.get("url") or data.find("vendor").get("url")
self.version = data.find("version").text.replace(" ", "-") self.version = data.find("version").text
self.slug = to_slug(self.name) self.slug = to_slug(self.name)
self.orig_slug = self.slug self.orig_slug = self.slug
@ -87,7 +84,7 @@ class Plugin:
def description(self): def description(self):
return re.sub(HTML_RE, "", self._description or "").strip() return re.sub(HTML_RE, "", self._description or "").strip()
def get_download_url(self, deref=True): def download_url(self, build, deref=True):
""" """
Provides the ZIP download URL for this plugin. Provides the ZIP download URL for this plugin.
@ -97,52 +94,18 @@ class Plugin:
(which it is by default). However, this comes at the cost of requiring (which it is by default). However, this comes at the cost of requiring
an HTTP request. an HTTP request.
""" """
id = urllib.parse.quote(self.xml_id) id = urllib.parse.quote(self.id)
url = f"https://plugins.jetbrains.com/pluginManager?action=download&id={id}&build={self.build}" url = f"https://plugins.jetbrains.com/pluginManager?action=download&id={id}&build={build}"
if deref: if deref:
res = requests.get(url, allow_redirects=not deref) res = requests.get(url, allow_redirects=not deref)
url = "https://plugins.jetbrains.com" + re.sub( url = "https://plugins.jetbrains.com" + re.sub(
"\?.*$", "", res.headers["location"] "\?.*$", "", res.headers["location"]
) )
self.jetbrains_url = url
if url.endswith("external"): if url.endswith("external"):
res = requests.get(url, allow_redirects=not deref) res = requests.get(url, allow_redirects=not deref)
url = res.headers["location"] url = res.headers["location"]
return url 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): def packagename(self):
slug = re.sub(PACKAGE_RE, "", self.slug.lower()).replace(".", "-") slug = re.sub(PACKAGE_RE, "", self.slug.lower()).replace(".", "-")
if slug[0] in "1234567890": if slug[0] in "1234567890":
@ -165,16 +128,16 @@ def list_plugins(build):
https://plugins.jetbrains.com/docs/marketplace/plugins-list.html https://plugins.jetbrains.com/docs/marketplace/plugins-list.html
""" """
resp = requests.get(f"https://plugins.jetbrains.com/plugins/list/?build={build}") resp = requests.get(f"https://plugins.jetbrains.com/plugins/list/?build={build}")
return parse_repository(resp.content, build) return parse_repository(resp.content)
def parse_repository(content, build): def parse_repository(content):
tree = etree.XML(content) tree = etree.XML(content)
plugins = [] plugins = []
for cat in tree.findall("category"): for cat in tree.findall("category"):
cat_name = cat.get("name") cat_name = cat.get("name")
for plugin in cat.findall("idea-plugin"): for plugin in cat.findall("idea-plugin"):
plugins.append(Plugin(plugin, build, cat_name)) plugins.append(Plugin(plugin, cat_name))
return plugins return plugins
@ -192,101 +155,28 @@ def deduplicate(plugins):
def prefetch(plugin, build, url=None): def prefetch(plugin, build, url=None):
if not url: if not url:
url = plugin.download_url or plugin.get_download_url() url = plugin.download_url(build)
res = sp.run( res = sp.run(
["nix-prefetch-url", "--name", plugin.filename(), url], capture_output=True, ["nix-prefetch-url", "--name", plugin.filename(), url], capture_output=True,
) )
if not res.stdout: if not res.stdout:
raise IOError( raise IOError(f"nix-prefetch-url {plugin} failed: {res.stderr.decode('utf-8')}")
f"nix-prefetch-url {plugin} failed: {res.stderr.decode('unicode-escape')}" return res.stdout.decode("utf-8").strip()
)
return res.stdout.decode("unicode-escape").strip()
def custom_license(short, full, url, free=False): def write_packages(outfile, plugins, build):
return f"""{{ builder = build.builder()
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{") outfile.write("{callPackage}:\n{")
for i, plugin in enumerate(plugins): for plugin in plugins:
print(f"{i:04} {plugin.packagename()}") src_url = plugin.download_url(build, deref=True)
src_ext = os.path.splitext(src_url)[-1]
try: try:
plugin.fetch_external() sha = prefetch(plugin, build, src_url)
except IOError as e: except IOError as e:
print(e, file=sys.stderr) print(e, file=sys.stderr)
continue continue
src_url = plugin.download_url
src_ext = os.path.splitext(src_url)[-1]
sha = plugin.sha
build_inputs = [] build_inputs = []
if src_ext == ".zip": if src_ext == ".zip":
@ -296,7 +186,7 @@ def write_packages(outfile, plugins):
# internal and external plugins; need to find some way to resolve them # internal and external plugins; need to find some way to resolve them
requires = [] requires = []
# TODO: Licenses are actually on the website, but aren't provided in the API # TODO: Licenses are actually on the website, but aren't provided in the API
license = plugin.license license = "lib.licenses.free"
call_args = [str(builder), "fetchurl", "lib"] call_args = [str(builder), "fetchurl", "lib"]
for binput in build_inputs: for binput in build_inputs:
@ -307,7 +197,7 @@ def write_packages(outfile, plugins):
{plugin.packagename()} = callPackage ({{ {", ".join(sorted(call_args))} }}: {builder} {{ {plugin.packagename()} = callPackage ({{ {", ".join(sorted(call_args))} }}: {builder} {{
pname = "{plugin.slug}"; pname = "{plugin.slug}";
plugname = "{plugin.name}"; plugname = "{plugin.name}";
plugid = "{plugin.xml_id}"; plugid = "{plugin.id}";
version = "{plugin.version}"; version = "{plugin.version}";
src = fetchurl {{ src = fetchurl {{
url = "{src_url}"; url = "{src_url}";
@ -337,7 +227,6 @@ def main():
parser.add_argument( parser.add_argument(
"-o", "--out", type=str, help="File to write plugins to", "-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( parser.add_argument(
"package", "package",
metavar="PACKAGE", metavar="PACKAGE",
@ -352,17 +241,15 @@ def main():
plugins.sort(key=lambda p: p.slug) plugins.sort(key=lambda p: p.slug)
deduplicate(plugins) deduplicate(plugins)
if args.offset:
plugins = plugins[args.offset :]
if args.number: if args.number:
plugins = plugins[: args.number] plugins = plugins[: args.number]
print(f"Generating packages for {len(plugins)} plugins", file=sys.stderr) print(f"Generating packages for {len(plugins)} plugins", file=sys.stderr)
if not args.out: if not args.out:
write_packages(sys.stdout, plugins) write_packages(sys.stdout, plugins, build)
else: else:
with open(args.out, "w") as f: with open(args.out, "w") as f:
write_packages(f, plugins) write_packages(f, plugins, build)
main() main()

12
flake.lock generated
View File

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1605370193, "lastModified": 1614513358,
"narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=", "narHash": "sha256-LakhOx3S1dRjnh0b5Dg3mbZyH0ToC9I8Y2wKSkBaTzU=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "5021eac20303a61fafe17224c087f5519baed54d", "rev": "5466c5bbece17adaab2d82fae80b46e807611bf3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -17,11 +17,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1611414562, "lastModified": 1616259034,
"narHash": "sha256-u002KfYA7Uk3vffnnmLz88BmxOzixYFdh+8II6ZT+Kg=", "narHash": "sha256-WlMIiGIXJm7J+jemzd+ksoun6znWmabCZNz76szV158=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9d6fd2ba135c5b5c85c3332604d39b43e93b8298", "rev": "4e0d3868c679da20108db402785f924daa1a7fb5",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -1,4 +1,5 @@
{ stdenv { stdenv
, lib
, fetchFromGitHub , fetchFromGitHub
, python3Packages , python3Packages
@ -20,7 +21,7 @@ python3Packages.buildPythonApplication rec {
doCheck = false; doCheck = false;
meta = with stdenv.lib; { meta = with lib; {
homepage = "https://github.com/Prior99/mopidy-subidy"; homepage = "https://github.com/Prior99/mopidy-subidy";
description = "Mopidy extension for playing music from Subsonic servers"; description = "Mopidy extension for playing music from Subsonic servers";
license = licenses.bsd3; license = licenses.bsd3;

View File

@ -1,4 +1,5 @@
{ stdenv { stdenv
, lib
, fetchFromGitHub , fetchFromGitHub
, rustPlatform , rustPlatform
@ -14,7 +15,7 @@
}: }:
let let
inherit (stdenv.lib) optional optionals; inherit (lib) optional optionals;
in in
assert withGui -> gtk3.meta.available; assert withGui -> gtk3.meta.available;
@ -63,7 +64,7 @@ rustPlatform.buildRustPackage rec {
}) })
]; ];
meta = with stdenv.lib; { meta = with lib; {
description = "Fast and multi-platform Spotify client with native GUI "; description = "Fast and multi-platform Spotify client with native GUI ";
homepage = "https://github.com/jpochyla/psst"; homepage = "https://github.com/jpochyla/psst";
license = licenses.mit; license = licenses.mit;

View File

@ -0,0 +1,41 @@
{ 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 { }

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@ let
}; };
generateIdea = lib.makeOverridable ({ generateIdea = lib.makeOverridable ({
idea ? ./idea-generated.nix idea ? ./manual-idea-packages.nix
}: let }: let
imported = import idea { imported = import idea {

View File

@ -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";
})
{ };
}

View 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";
})
{ };
}

View File

@ -1,12 +0,0 @@
#!/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:

View File

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

View File

@ -1,4 +1,5 @@
{ lib, makeWrapper, runCommand }: self: { lib
}: self:
with lib; with lib;
@ -19,31 +20,12 @@ in
assert assertMsg (length badPlugins == 0) errorMsg; assert assertMsg (length badPlugins == 0) errorMsg;
runCommand appendToName "with-plugins" (package.overrideAttrs (oldAttrs: {
(appendToName "with-plugins" package).name passthru = { inherit plugins; };
{ # TODO: Purely aesthetics, but link the plugin to its name instead of hash-name-version
nativeBuildInputs = [ package makeWrapper ]; installPhase = oldAttrs.installPhase + ''
inherit package plugins; for plugin in $plugins; do
packageName = package.name; ln -s "$plugin" "$out/$name/plugins/$(basename $plugin)"
done
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"
''

View File

@ -0,0 +1,54 @@
{ lib
, fetchFromGitHub
, buildGoModule
, pkg-config
, libsecret
}:
{ pname
, tags
, ...
}@args:
buildGoModule (lib.recursiveUpdate args rec {
inherit pname;
version = "1.5.6";
src = fetchFromGitHub {
owner = "ProtonMail";
repo = "proton-bridge";
rev = "br-${version}";
sha256 = "1na8min9cmn82lpad58abw6837k303fr09l6cvzswaxs73f231ig";
};
vendorSha256 = "1219xa1347877bfhnid15y6w9s4hf1czbrmll2iha4gpsmg066bb";
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [
pkg-config
];
buildInputs = (args.buildInputs or [ ]) ++ [
libsecret
];
buildFlagsArray =
let
t = "github.com/ProtonMail/proton-bridge/pkg/constants";
in
[
"-tags=${tags}"
''
-ldflags=
-X ${t}.Version=${version}
-X ${t}.Revision=unknown
-X ${t}.BuildDate=unknown
''
];
meta = with lib; {
description = "Integrate ProtonMail paid account with any program that supports IMAP and SMTP";
homepage = "https://protonmail.com";
license = licenses.gpl3;
plaforms = platforms.x86_64;
};
})

View File

@ -1,4 +1,5 @@
{ stdenv { stdenv
, lib
, fetchFromGitHub , fetchFromGitHub
, buildGoModule , buildGoModule
@ -9,60 +10,11 @@
, qtbase , qtbase
, qtdoc , qtdoc
}: }:
let let
builder = import ./common.nix {
builder = inherit lib fetchFromGitHub buildGoModule libsecret pkg-config;
{ pname };
, tags
, ...
}@args:
buildGoModule (stdenv.lib.recursiveUpdate args rec {
inherit pname;
version = "1.5.6";
src = fetchFromGitHub {
owner = "ProtonMail";
repo = "proton-bridge";
rev = "br-${version}";
sha256 = "1na8min9cmn82lpad58abw6837k303fr09l6cvzswaxs73f231ig";
};
vendorSha256 = "1219xa1347877bfhnid15y6w9s4hf1czbrmll2iha4gpsmg066bb";
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [
pkg-config
];
buildInputs = (args.buildInputs or [ ]) ++ [
libsecret
];
buildFlagsArray =
let
t = "github.com/ProtonMail/proton-bridge/pkg/constants";
in
[
"-tags=${tags}"
''
-ldflags=
-X ${t}.Version=${version}
-X ${t}.Revision=unknown
-X ${t}.BuildDate=unknown
''
];
meta = with stdenv.lib; {
description = "Integrate ProtonMail paid account with any program that supports IMAP and SMTP";
homepage = "https://protonmail.com";
license = licenses.gpl3;
plaforms = platforms.x86_64;
};
});
in in
{ {
protonmail-bridge = builder (import ./app.nix { inherit qtbase go goModules; }); protonmail-bridge = builder (import ./app.nix { inherit qtbase go goModules; });
protonmail-bridge-headless = builder (import ./headless.nix { }); protonmail-bridge-headless = builder (import ./headless.nix { });

View File

@ -0,0 +1,55 @@
{ stdenv
, lib
, fetchFromGitHub
, alacritty
, fontconfig
, freetype
, libglvnd
, libxcb
}:
alacritty.overrideAttrs (oldAttrs: rec {
pname = "${oldAttrs.pname}-ligatures";
version = "0.7.2.20210209.g3ed0430";
src = fetchFromGitHub {
owner = "zenixls2";
repo = "alacritty";
fetchSubmodules = true;
rev = "3ed043046fc74f288d4c8fa7e4463dc201213500";
sha256 = "1dGk4ORzMSUQhuKSt5Yo7rOJCJ5/folwPX2tLiu0suA=";
};
cargoDeps = oldAttrs.cargoDeps.overrideAttrs (lib.const {
name = "${pname}-${version}-vendor.tar.gz";
inherit src;
outputHash = "pONu6caJmEKnbr7j+o9AyrYNpS4Q8OEjNZOhGTalncc=";
});
ligatureInputs = [
fontconfig
freetype
libglvnd
stdenv.cc.cc.lib
libxcb
];
preferLocalBuild = true;
buildInputs = (oldAttrs.buildInputs or [ ]) ++ ligatureInputs;
# HACK: One of the ligature libraries required the C++ stdlib at runtime,
# and I can't work out a better way to push it to the RPATH.
postInstall = lib.optional (!stdenv.isDarwin) ''
patchelf \
--set-rpath ${lib.makeLibraryPath ligatureInputs}:"$(patchelf --print-rpath $out/bin/alacritty)" \
$out/bin/alacritty
'';
meta = oldAttrs.meta // {
description = "Alacritty with ligature patch applied";
homepage = "https://github.com/zenixls2/alacritty/tree/ligature";
};
})

View File

@ -1,4 +1,5 @@
{ stdenv { stdenv
, lib
, fetchFromGitLab , fetchFromGitLab
, fetchzip , fetchzip
@ -62,10 +63,11 @@ stdenv.mkDerivation rec {
passthru.providedSessions = [ "cardboard" ]; passthru.providedSessions = [ "cardboard" ];
meta = { meta = with lib; {
description = "Scrollable tiling Wayland compositor designed with laptops in mind"; description = "Scrollable tiling Wayland compositor designed with laptops in mind";
homepage = "https://gitlab.com/cardboardwm/cardboard"; homepage = "https://gitlab.com/cardboardwm/cardboard";
license = stdenv.lib.licenses.gpl3; license = licenses.gpl3;
platforms = wlroots.meta.platforms; platforms = wlroots.meta.platforms;
broken = true;
}; };
} }

View File

@ -4,38 +4,30 @@
, jetbrainsPlatforms , jetbrainsPlatforms
}: }:
{ plugid { pluginId
, pname , pname
, version , version
, ... , versionId
}@args: , sha256
, filename ? "${pname}-${version}.zip"
}:
let stdenv.mkDerivation {
inherit pname version;
defaultMeta = { src = fetchzip {
broken = false; inherit sha256;
} // lib.optionalAttrs ((args.src.meta.homepage or "") != "") { url = "https://plugins.jetbrains.com/files/${toString pluginId}/${toString versionId}/${filename}";
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; }; passthru = { inherit jetbrainsPlatforms; };
dontUnpack = lib.any (lib.hasSuffix ".jar") args.src.urls;
installPhase = '' installPhase = ''
mkdir $out mkdir $out
cp -r * $out/ cp -r * $out/
''; '';
meta = { meta = {
inherit (args.meta) license description; homepage = "https://plugins.jetbrains.com/plugin/${pluginId}-${lib.toLower pname}";
homepage = if (args.meta.homepage == "") then null else args.meta.homepage;
}; };
}) }

View File

@ -1,4 +1,5 @@
{ stdenv { stdenv
, lib
, fetchFromGitHub , fetchFromGitHub
, buildGoModule , buildGoModule
, makeWrapper , makeWrapper
@ -59,7 +60,7 @@ buildGoModule rec {
done done
''; '';
meta = with stdenv.lib; { meta = with lib; {
homepage = "https://github.com/therecipe/qt"; homepage = "https://github.com/therecipe/qt";
description = "Qt bindings for Go"; description = "Qt bindings for Go";
license = licenses.lgpl3; license = licenses.lgpl3;

View File

@ -1,4 +1,5 @@
{ stdenv { stdenv
, lib
, fetchFromGitHub , fetchFromGitHub
, coreutils , coreutils
@ -26,7 +27,7 @@ stdenv.mkDerivation rec {
mkdir -p $out/include $out/lib mkdir -p $out/include $out/lib
''; '';
meta = with stdenv.lib; { meta = with lib; {
homepage = "https://github.com/xant/libhl"; 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 "; description = "Simple and fast C library implementing a thread-safe API to manage hash-tables, linked lists, lock-free ring buffers and queues ";
license = licenses.lgpl3; license = licenses.lgpl3;

View File

@ -1,4 +1,5 @@
{ stdenv { stdenv
, lib
, buildPythonPackage , buildPythonPackage
, fetchPypi , fetchPypi
}: }:
@ -14,9 +15,9 @@ buildPythonPackage rec {
doCheck = false; doCheck = false;
meta = { meta = with lib; {
homepage = "https://stuffivelearned.org/doku.php?id=programming:python:py-sonic"; homepage = "https://stuffivelearned.org/doku.php?id=programming:python:py-sonic";
license = stdenv.lib.licenses.gpl3; license = licenses.gpl3;
description = "A python wrapper library for the Subsonic REST API"; description = "A python wrapper library for the Subsonic REST API";
}; };
} }

View File

@ -1,4 +1,5 @@
{ stdenv { stdenv
, lib
, fetchFromGitHub , fetchFromGitHub
, autoreconfHook , autoreconfHook
@ -25,10 +26,10 @@ stdenv.mkDerivation rec {
configureFlags = [ "--with-moduledir=\${out}/lib/security" ]; configureFlags = [ "--with-moduledir=\${out}/lib/security" ];
meta = with stdenv.lib; { meta = with lib; {
homepage = "https://github.com/cruegge/pam-gnupg"; homepage = "https://github.com/cruegge/pam-gnupg";
description = "Unlock GnuPG keys on login"; description = "Unlock GnuPG keys on login";
license = licenses.gpl3; license = licenses.gpl3;
inherit (pam.meta) platforms; platforms = pam.meta.platforms;
}; };
} }

View File

@ -1,4 +1,5 @@
{ stdenv { stdenv
, lib
, fetchFromGitHub , fetchFromGitHub
, installShellFiles , installShellFiles
@ -25,10 +26,10 @@ stdenv.mkDerivation {
installShellCompletion --zsh _zshz installShellCompletion --zsh _zshz
''; '';
meta = { meta = with lib; {
description = ''Jump quickly to directories that you have visited "frecently." A native ZSH port of z.sh.''; description = ''Jump quickly to directories that you have visited "frecently." A native ZSH port of z.sh.'';
homepage = "https://github.com/agkozak/zsh-z"; homepage = "https://github.com/agkozak/zsh-z";
license = stdenv.lib.licenses.mit; license = licenses.mit;
platforms = zsh.meta.platforms; platforms = zsh.meta.platforms;
}; };
} }

View File

@ -1,4 +1,5 @@
{ stdenv { stdenv
, lib
, fetchFromGitHub , fetchFromGitHub
, python3Packages , python3Packages
@ -20,7 +21,7 @@ python3Packages.buildPythonApplication rec {
pyyaml pyyaml
]; ];
meta = with stdenv.lib; { meta = with lib; {
description = "Fan controller for AMD graphics cards running the amdgpu driver on Linux"; description = "Fan controller for AMD graphics cards running the amdgpu driver on Linux";
homepage = "https://github.com/chestm007/amdgpu-fan"; homepage = "https://github.com/chestm007/amdgpu-fan";
license = licenses.gpl2; license = licenses.gpl2;

View File

@ -1,16 +1,18 @@
{ stdenv { stdenv
, lib
, fetchFromGitHub , fetchFromGitHub
, qtbase , qtbase
, qmake , qmake
, wrapQtAppsHook ? null # Temporary backwards compatibility
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "radeon-profile-daemon"; pname = "radeon-profile-daemon";
version = "20190603.g06qxq2h"; version = "20190603.g06qxq2h";
nativeBuildInputs = [ qmake ];
buildInputs = [ qtbase ]; buildInputs = [ qtbase ];
nativeBuildInputs = [ qmake wrapQtAppsHook ];
src = ( src = (
fetchFromGitHub { fetchFromGitHub {
@ -26,7 +28,7 @@ stdenv.mkDerivation rec {
--replace "/usr/" "$out/" --replace "/usr/" "$out/"
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "System daemon for reading current clocks of AMD Radeon cards"; description = "System daemon for reading current clocks of AMD Radeon cards";
homepage = "https://github.com/marazmista/radeon-profile-daemon"; homepage = "https://github.com/marazmista/radeon-profile-daemon";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;

View File

@ -1,4 +1,5 @@
{ stdenv { stdenv
, lib
, fetchFromGitHub , fetchFromGitHub
, makeWrapper , makeWrapper
@ -40,7 +41,7 @@ stdenv.mkDerivation rec {
--replace /usr/bin/samrewritten $out/bin/samrewritten --replace /usr/bin/samrewritten $out/bin/samrewritten
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "Steam Achievement Manager For Linux"; description = "Steam Achievement Manager For Linux";
homepage = "https://github.com/PaulCombal/SamRewritten"; homepage = "https://github.com/PaulCombal/SamRewritten";
license = licenses.gpl3; license = licenses.gpl3;

View File

@ -1,4 +1,5 @@
{ stdenv { stdenv
, lib
, fetchFromGitHub , fetchFromGitHub
, python2Packages , python2Packages
@ -48,7 +49,7 @@ python2Packages.buildPythonApplication rec {
# Remove impure executables. # Remove impure executables.
patches = [ ./fix-setup.patch ]; patches = [ ./fix-setup.patch ];
meta = { meta = with lib; {
description = "Rip Spotify URIs to audio files, including ID3 tags and cover art"; description = "Rip Spotify URIs to audio files, including ID3 tags and cover art";
longDescription = '' longDescription = ''
Spotify-ripper is a small ripper script for Spotify that rips Spotify URIs Spotify-ripper is a small ripper script for Spotify that rips Spotify URIs
@ -58,6 +59,6 @@ python2Packages.buildPythonApplication rec {
''; '';
homepage = "https://github.com/hbashton/spotify-ripper"; homepage = "https://github.com/hbashton/spotify-ripper";
# spotify-ripper itself is MIT, but the upstream libspotify is unfree. # spotify-ripper itself is MIT, but the upstream libspotify is unfree.
license = stdenv.lib.licenses.unfree; license = licenses.unfree;
}; };
} }

View File

@ -0,0 +1,36 @@
{ stdenv
, lib
, fetchFromGitHub
, python3
, ffmpeg }:
stdenv.mkDerivation rec {
pname = "ytarchive";
version = "0.2.2";
src = fetchFromGitHub {
owner = "Kethsar";
repo = "ytarchive";
rev = "v${version}";
sha256 = "xT45FF0ztWQXzQgYztl2YKiI2iGJfnCXgCMw8gOmxzM=";
};
propagatedBuildInputs = [
python3
ffmpeg
];
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
installPhase = ''
install -Dm00755 ytarchive.py $out/bin/ytarchive
'';
meta = with lib; {
description = "Garbage Youtube livestream downloader";
homepage = "https://github.com/Kethsar/ytarchive";
license = licenses.mit;
platforms = python3.meta.platforms;
};
}

View File

@ -2,47 +2,7 @@
rec { rec {
# Alacritty with the unmerged ligature patches applied. # Alacritty with the unmerged ligature patches applied.
alacritty-ligatures = pkgs.alacritty.overrideAttrs (oldAttrs: rec { alacritty-ligatures = pkgs.callPackage ../applications/terminal-emulators/alacritty-ligatures { };
pname = "${oldAttrs.pname}-ligatures";
version = "0.7.1.20210107.gada2680";
src = pkgs.fetchFromGitHub {
owner = "zenixls2";
repo = "alacritty";
fetchSubmodules = true;
rev = "ada2680e79a8f53cd350263c8cc91d2e2a264d81";
sha256 = "0c0k1ib1dl35731zyjb32apyn28xc63mhbwsig5mz3hnkyk5nisr";
};
cargoDeps = oldAttrs.cargoDeps.overrideAttrs (pkgs.lib.const {
name = "${pname}-${version}-vendor.tar.gz";
inherit src;
outputHash = "1d1yz4xmal0f3c0pcn59lxfh5a3532nv7dv7s95svvi8qsvnk9gv";
});
ligatureInputs = [
pkgs.fontconfig
pkgs.freetype
pkgs.libglvnd
pkgs.stdenv.cc.cc.lib
pkgs.xlibs.libxcb
];
buildInputs = (oldAttrs.buildInputs or []) ++ ligatureInputs;
# HACK: One of the ligature libraries required the C++ stdlib at runtime,
# and I can't work out a better way to push it to the RPATH.
postInstall = pkgs.lib.optional (!pkgs.stdenv.isDarwin) ''
patchelf \
--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 { }; amdgpu-fan = pkgs.callPackage ../tools/misc/amdgpu-fan { };
@ -55,7 +15,7 @@ rec {
# A functional Jetbrains IDE-with-plugins package set. # A functional Jetbrains IDE-with-plugins package set.
jetbrains = pkgs.dontRecurseIntoAttrs rec { jetbrains = pkgs.dontRecurseIntoAttrs rec {
jetbrainsPluginsFor = variant: import ../top-level/jetbrains-plugins.nix { jetbrainsPluginsFor = variant: import ../top-level/jetbrains-plugins.nix {
inherit (pkgs) lib newScope stdenv fetchzip makeWrapper runCommand; inherit (pkgs) lib newScope stdenv fetchzip;
inherit variant; inherit variant;
}; };
@ -165,5 +125,7 @@ rec {
python2Packages = pkgs.python2Packages // python2Packages.overlay; python2Packages = pkgs.python2Packages // python2Packages.overlay;
}; };
ytarchive = pkgs.callPackage ../tools/misc/ytarchive { };
zsh-z = pkgs.callPackage ../shells/zsh/zsh-z { }; zsh-z = pkgs.callPackage ../shells/zsh/zsh-z { };
} }

View File

@ -2,25 +2,29 @@
, newScope , newScope
, stdenv , stdenv
, fetchzip , fetchzip
, makeWrapper
, runCommand
, variant , variant
}: }:
let let
mkJetbrainsPlugins = import ../applications/editors/jetbrains/common-plugins.nix {
inherit lib stdenv fetchzip;
};
mkIdeaPlugins = import ../applications/editors/jetbrains/idea-plugins.nix { mkIdeaPlugins = import ../applications/editors/jetbrains/idea-plugins.nix {
inherit lib stdenv fetchzip; inherit lib stdenv fetchzip;
}; };
jetbrainsWithPlugins = import ../applications/editors/jetbrains/wrapper.nix { jetbrainsWithPlugins = import ../applications/editors/jetbrains/wrapper.nix {
inherit lib makeWrapper runCommand; inherit lib;
}; };
in lib.makeScope newScope (self: lib.makeOverridable ({ in lib.makeScope newScope (self: lib.makeOverridable ({
ideaPlugins ? mkIdeaPlugins self jetbrainsPlugins ? mkJetbrainsPlugins self
, ideaPlugins ? mkIdeaPlugins self
}: ({ } }: ({ }
// jetbrainsPlugins // { inherit jetbrainsPlugins; }
// ideaPlugins // { inherit ideaPlugins; } // ideaPlugins // { inherit ideaPlugins; }
// { // {
inherit variant; inherit variant;