···11 sha256 = "sha256-xZFQQDK+yGAv4IbuNe2dvNa3GDASeJY2mOYw94goAIM=";
12 };
1314- # Set vendorSha256 to null because dstask vendors its dependencies (meaning
15 # that third party dependencies are stored in the repository).
16 #
17 # Ref <https://github.com/NixOS/nixpkgs/pull/87383#issuecomment-633204382>
···11 sha256 = "sha256-xZFQQDK+yGAv4IbuNe2dvNa3GDASeJY2mOYw94goAIM=";
12 };
1314+ # Set vendorHash to null because dstask vendors its dependencies (meaning
15 # that third party dependencies are stored in the repository).
16 #
17 # Ref <https://github.com/NixOS/nixpkgs/pull/87383#issuecomment-633204382>
···1+{ lib, fetchFromGitHub, buildGoModule, installShellFiles }:
2+3+buildGoModule rec {
4+ pname = "orchard";
5+ version = "0.12.0";
6+7+ src = fetchFromGitHub {
8+ owner = "cirruslabs";
9+ repo = pname;
10+ rev = version;
11+ hash = "sha256-+QNYlZ3/GiDtCySZPOlrDy03lkdGGvbFCWidQhbZJYQ=";
12+ # populate values that require us to use git. By doing this in postFetch we
13+ # can delete .git afterwards and maintain better reproducibility of the src.
14+ leaveDotGit = true;
15+ postFetch = ''
16+ cd "$out"
17+ git rev-parse HEAD > $out/COMMIT
18+ find "$out" -name .git -print0 | xargs -0 rm -rf
19+ '';
20+ };
21+22+ vendorHash = "sha256-BrzS+QtpGUHcYNNmSI6FlBtcYwNFri7R6nlVvFihdb4=";
23+24+ nativeBuildInputs = [ installShellFiles ];
25+26+ ldflags = [
27+ "-w"
28+ "-s"
29+ "-X github.com/cirruslabs/orchard/internal/version.Version=${version}"
30+ ];
31+32+ # ldflags based on metadata from git and source
33+ preBuild = ''
34+ ldflags+=" -X github.com/cirruslabs/orchard/internal/version.Commit=$(cat COMMIT)"
35+ '';
36+37+ subPackages = [ "cmd/orchard" ];
38+39+ postInstall = ''
40+ export HOME="$(mktemp -d)"
41+ installShellCompletion --cmd orchard \
42+ --bash <($out/bin/orchard completion bash) \
43+ --zsh <($out/bin/orchard completion zsh) \
44+ --fish <($out/bin/orchard completion fish)
45+ '';
46+47+ meta = with lib; {
48+ mainProgram = "orchard";
49+ description =
50+ "Orchestrator for running Tart Virtual Machines on a cluster of Apple Silicon devices";
51+ homepage = "https://github.com/cirruslabs/orchard";
52+ license = licenses.fairsource09;
53+ maintainers = with maintainers; [ techknowlogick ];
54+ };
55+}
+6-12
pkgs/data/documentation/zeal/default.nix
···1718let
19 isQt5 = lib.versions.major qtbase.version == "5";
020in
21stdenv.mkDerivation (finalAttrs: {
22 pname = "zeal";
23- version = "0.6.1.20230907"; # unstable-date format not suitable for cmake
2425 src = fetchFromGitHub {
26 owner = "zealdocs";
27 repo = "zeal";
28- rev = "20249153077964d01c7c36b9f4042a40e8c8fbf1";
29- hash = "sha256-AyfpMq0R0ummTGvyUHOh/XBUeVfkFwo1VyyLSGoTN8w=";
30 };
3132- # we only need this if we are using a version that hasn't been released. We
33- # could also match on the "VERSION x.y.z" bit but then it would have to be
34- # updated based on whatever is the latest release, so instead just rewrite the
35- # line.
36 postPatch = ''
37- sed -i CMakeLists.txt \
38- -e 's@^project.*@project(Zeal VERSION ${finalAttrs.version})@'
39- '' + lib.optionalString (!isQt5) ''
40- substituteInPlace src/app/CMakeLists.txt \
41- --replace "COMPONENTS Widgets" "COMPONENTS Widgets QmlIntegration"
42 '';
4344 nativeBuildInputs = [
···1+#!/usr/bin/env nix-shell
2+#!nix-shell -i python3 -p "python3.withPackages (ps: [ ps.beautifulsoup4 ps.lxml ])"
3+from enum import Enum
4+from bs4 import BeautifulSoup, NavigableString, Tag
5+from dataclasses import dataclass
6+import json
7+import pathlib
8+import re
9+import subprocess
10+import urllib.request
11+import sys
12+13+14+HERE = pathlib.Path(__file__).parent
15+ROOT = HERE.parent.parent.parent.parent
16+VERSIONS_FILE = HERE / "kernels-org.json"
17+18+class KernelNature(Enum):
19+ MAINLINE = 1
20+ STABLE = 2
21+ LONGTERM = 3
22+23+@dataclass
24+class KernelRelease:
25+ nature: KernelNature
26+ version: str
27+ date: str
28+ link: str
29+ eol: bool = False
30+31+def parse_release(release: Tag) -> KernelRelease | None:
32+ columns: list[Tag] = list(release.find_all('td'))
33+ try:
34+ nature = KernelNature[columns[0].get_text().rstrip(':').upper()]
35+ except KeyError:
36+ return None
37+38+ version = columns[1].get_text().rstrip(' [EOL]')
39+ date = columns[2].get_text()
40+ link = columns[3].find('a')
41+ if link is not None and isinstance(link, Tag):
42+ link = link.attrs.get('href')
43+ assert link is not None, f'link for kernel {version} is non-existent'
44+ eol = bool(release.find(class_='eolkernel'))
45+46+ return KernelRelease(nature=nature, version=version, date=date, link=link, eol=eol)
47+48+def get_branch(version: str):
49+ # This is a testing kernel.
50+ if 'rc' in version:
51+ return 'testing'
52+ else:
53+ major, minor, *_ = version.split(".")
54+ return f"{major}.{minor}"
55+56+57+def get_hash(url: str):
58+ return subprocess.check_output(["nix-prefetch-url", url]).decode().strip()
59+60+61+def commit(message):
62+ return subprocess.check_call(["git", "commit", "-m", message, VERSIONS_FILE])
63+64+65+def main():
66+ kernel_org = urllib.request.urlopen("https://kernel.org/")
67+ soup = BeautifulSoup(kernel_org.read().decode(), "lxml")
68+ release_table = soup.find(id='releases')
69+ if not release_table or isinstance(release_table, NavigableString):
70+ print(release_table)
71+ print('Failed to find the release table on https://kernel.org')
72+ sys.exit(1)
73+74+ releases = release_table.find_all('tr')
75+ parsed_releases = filter(None, [parse_release(release) for release in releases])
76+ all_kernels = json.load(VERSIONS_FILE.open())
77+78+ for kernel in parsed_releases:
79+ branch = get_branch(kernel.version)
80+ nixpkgs_branch = branch.replace('.', '_')
81+82+ old_version = all_kernels.get(branch, {}).get("version")
83+ if old_version == kernel.version:
84+ print(f"linux_{nixpkgs_branch}: {kernel.version} is latest, skipping...")
85+ continue
86+87+ if old_version is None:
88+ message = f"linux_{nixpkgs_branch}: init at {kernel.version}"
89+ else:
90+ message = f"linux_{nixpkgs_branch}: {old_version} -> {kernel.version}"
91+92+ print(message)
93+94+ all_kernels[branch] = {"version": kernel.version, "hash": get_hash(kernel.link)}
95+96+ with VERSIONS_FILE.open("w") as fd:
97+ json.dump(all_kernels, fd, indent=4)
98+ fd.write("\n") # makes editorconfig happy
99+100+ commit(message)
101+102+103+if __name__ == "__main__":
104+ main()
+9-67
pkgs/os-specific/linux/kernel/update.sh
···1#!/usr/bin/env bash
2-set -e
3-4-# Get the latest versions from kernel.org
5-LINUXSED='s/.*linux-\([0-9]\+\(.[0-9]\+\)*\).*/\1/p'
6-KDATA="$(curl -s https://www.kernel.org | sed -n -e '/Download complete/p')"
7-VERSIONS=($(sed -n -e $LINUXSED <<< "$KDATA" | sort -Vr))
8-9-# Remove mainline version if there is a stable update
10-# Note due to sorting these two will always exist at the bottom
11-if grep -q "^${VERSIONS[1]}" <<< "${VERSIONS[0]}"; then
12- VERSIONS=(${VERSIONS[@]:0:1} ${VERSIONS[@]:2})
13-fi
14-15-# Inspect each file and see if it has the latest version
16-NIXPKGS="$(git rev-parse --show-toplevel)"
17-ls $NIXPKGS/pkgs/os-specific/linux/kernel | while read FILE; do
18- KERNEL="$(sed -n -e $LINUXSED <<< "$FILE")"
19- [ -z "$KERNEL" ] && continue
20-21- # Find the matching new kernel version
22- MATCHING=""
23- for V in "${VERSIONS[@]}"; do
24- if grep -q "^$KERNEL" <<< "$V"; then
25- MATCHING="$V"
26- break
27- fi
28- done
29- if [ -z "$MATCHING" ]; then
30- echo "Out-of-support $KERNEL"
31- continue
32- fi
33-34- # Inspect the nix expression to check for changes
35- DATA="$(<$NIXPKGS/pkgs/os-specific/linux/kernel/$FILE)"
36- URL="$(sed -n -e 's/.*url = "\(.*\)";.*/\1/p' <<< "$DATA" | sed -e "s/\${version}/$MATCHING/g")"
37- OLDVER=$(sed -n -e 's/.*version = "\(.*\)".*/\1/p' <<< "$DATA")
38- if [ "$OLDVER" = "$V" ]; then
39- echo "No updates for $KERNEL"
40- continue
41- fi
42-43- # Download the new file for the hash
44- if ! HASH="$(nix-prefetch-url $URL 2>/dev/null)"; then
45- echo "Failed to get hash of $URL"
46- continue
47- fi
48- sed -i -e "s/sha256 = \".*\"/sha256 = \"$HASH\"/g" $NIXPKGS/pkgs/os-specific/linux/kernel/$FILE
49-50- # Rewrite the expression
51- sed -i -e '/version = /d' $NIXPKGS/pkgs/os-specific/linux/kernel/$FILE
52- sed -i -e "\#buildLinux (args // rec {#a \ version = \"$V\";" $NIXPKGS/pkgs/os-specific/linux/kernel/$FILE
53-54- # Commit the changes
55- git add -u $NIXPKGS/pkgs/os-specific/linux/kernel/$FILE
56- git commit -m "linux: $OLDVER -> $V" >/dev/null 2>&1
57-58- echo "Updated $OLDVER -> $V"
59-done
6061-# Allowing errors again: one broken update script shouldn't inhibit the
62-# update of other kernel variants.
63-set +e
6465-echo Update linux-rt
66-COMMIT=1 $NIXPKGS/pkgs/os-specific/linux/kernel/update-rt.sh || echo "update-rt failed with exit code $?"
6768-echo Update linux-libre
69-COMMIT=1 $NIXPKGS/pkgs/os-specific/linux/kernel/update-libre.sh || echo "update-libre failed with exit code $?"
7071-echo Update linux-hardened
72-COMMIT=1 $NIXPKGS/pkgs/os-specific/linux/kernel/hardened/update.py || echo "update-hardened failed with exit code $?"
···87, enabledProviders ? []
88}:
89let
90- version = "2.7.0";
9192 airflow-src = fetchFromGitHub rec {
93 owner = "apache";
···96 # Download using the git protocol rather than using tarballs, because the
97 # GitHub archive tarballs don't appear to include tests
98 forceFetchGit = true;
99- hash = "sha256-zB4PWcPkm+lat4tNfVld051RHlC1dW2EbgyoxDao52o=";
100 };
101102 # airflow bundles a web interface, which is built using webpack by an undocumented shell script in airflow's source tree.
···87, enabledProviders ? []
88}:
89let
90+ version = "2.7.1";
9192 airflow-src = fetchFromGitHub rec {
93 owner = "apache";
···96 # Download using the git protocol rather than using tarballs, because the
97 # GitHub archive tarballs don't appear to include tests
98 forceFetchGit = true;
99+ hash = "sha256-TxlOdazdaEKt9U+t/zjRChUABLhVTqXvH8nUbYrRrQs=";
100 };
101102 # airflow bundles a web interface, which is built using webpack by an undocumented shell script in airflow's source tree.
+2
pkgs/servers/dns/nsd/default.nix
···2930 buildInputs = [ libevent openssl ];
310032 configureFlags =
33 let edf = c: o: if c then ["--enable-${o}"] else ["--disable-${o}"];
34 in edf bind8Stats "bind8-stats"
···2930 buildInputs = [ libevent openssl ];
3132+ enableParallelBuilding = true;
33+34 configureFlags =
35 let edf = c: o: if c then ["--enable-${o}"] else ["--disable-${o}"];
36 in edf bind8Stats "bind8-stats"
+9
pkgs/servers/mail/spamassassin/default.nix
···3perlPackages.buildPerlPackage rec {
4 pname = "SpamAssassin";
5 version = "4.0.0";
067 src = fetchurl {
8 url = "mirror://apache/spamassassin/source/Mail-${pname}-${version}.tar.bz2";
9 hash = "sha256-5aoXBQowvHK6qGr9xgSMrepNHsLsxh14dxegWbgxnog=";
000010 };
1112 patches = [
···52 postInstall = ''
53 mkdir -p $out/share/spamassassin
54 mv "rules/"* $out/share/spamassassin/
00005556 for n in "$out/bin/"*; do
57 # Skip if this isn't a perl script
···3perlPackages.buildPerlPackage rec {
4 pname = "SpamAssassin";
5 version = "4.0.0";
6+ rulesRev = "r1905950";
78 src = fetchurl {
9 url = "mirror://apache/spamassassin/source/Mail-${pname}-${version}.tar.bz2";
10 hash = "sha256-5aoXBQowvHK6qGr9xgSMrepNHsLsxh14dxegWbgxnog=";
11+ };
12+ defaultRulesSrc = fetchurl {
13+ url = "mirror://apache/spamassassin/source/Mail-${pname}-rules-${version}.${rulesRev}.tgz";
14+ hash = "sha256-rk/7uRfrx/76ckD8W7UVHdpmP45AWRYa18m0Lu0brG0=";
15 };
1617 patches = [
···57 postInstall = ''
58 mkdir -p $out/share/spamassassin
59 mv "rules/"* $out/share/spamassassin/
60+61+ tar -xzf ${defaultRulesSrc} -C $out/share/spamassassin/
62+ local moduleversion="$(${perlPackages.perl}/bin/perl -I lib -e 'use Mail::SpamAssassin; print $Mail::SpamAssassin::VERSION')"
63+ sed -i -e "s/@@VERSION@@/$moduleversion/" $out/share/spamassassin/*.cf
6465 for n in "$out/bin/"*; do
66 # Skip if this isn't a perl script