Merge release-24.11 into staging-next-24.11

This commit is contained in:
github-actions[bot] 2024-11-22 00:18:59 +00:00 committed by GitHub
commit 4f44a5cbfc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
58 changed files with 13918 additions and 608 deletions

View File

@ -165,7 +165,7 @@ These paths will need to be replaced with relative paths and the xcbuild package
stdenv.mkDerivation {
name = "libfoo-1.2.3";
postPatch = ''
subsituteInPlace Makefile \
substituteInPlace Makefile \
--replace-fail '/usr/bin/xcodebuild' 'xcodebuild' \
--replace-fail '/usr/bin/xcrun' 'xcrun' \
--replace-fail '/usr/bin/PListBuddy' 'PListBuddy'

View File

@ -154,11 +154,13 @@ There are several ways to tweak how Nix handles a package which has been marked
The `allowInsecurePredicate` option is a function which accepts a package and returns a boolean, much like `allowUnfreePredicate`.
The following configuration example only allows insecure packages with very short names:
The following configuration example allows any version of the `ovftool` package:
```nix
{
allowInsecurePredicate = pkg: builtins.stringLength (lib.getName pkg) <= 5;
allowInsecurePredicate = pkg: builtins.elem (lib.getName pkg) [
"ovftool"
];
}
```

View File

@ -12720,6 +12720,14 @@
githubId = 5624721;
name = "Ben Wolsieffer";
};
lordmzte = {
name = "Moritz Thomae";
email = "lord@mzte.de";
matrix = "@lordmzte:mzte.de";
github = "LordMZTE";
githubId = 28735087;
keys = [ { fingerprint = "AB47 3D70 53D2 74CA DC2C 230C B648 02DC 33A6 4FF6"; } ];
};
lord-valen = {
name = "Lord Valen";
matrix = "@lord-valen:matrix.org";

View File

@ -148,6 +148,7 @@
./programs/alvr.nix
./programs/appgate-sdp.nix
./programs/appimage.nix
./programs/arp-scan.nix
./programs/atop.nix
./programs/ausweisapp.nix
./programs/autojump.nix
@ -296,6 +297,7 @@
./programs/sysdig.nix
./programs/system-config-printer.nix
./programs/systemtap.nix
./programs/tcpdump.nix
./programs/thefuck.nix
./programs/thunar.nix
./programs/thunderbird.nix

View File

@ -0,0 +1,32 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.arp-scan;
in
{
options = {
programs.arp-scan = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to configure a setcap wrapper for arp-scan.
'';
};
};
};
config = lib.mkIf cfg.enable {
security.wrappers.arp-scan = {
owner = "root";
group = "root";
capabilities = "cap_net_raw+p";
source = lib.getExe pkgs.arp-scan;
};
};
}

View File

@ -1,10 +1,16 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
let
cfg = config.programs.iftop;
in {
in
{
options = {
programs.iftop.enable = lib.mkEnableOption "iftop + setcap wrapper";
programs.iftop.enable = lib.mkEnableOption "iftop and setcap wrapper for it";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.iftop ];
@ -12,7 +18,7 @@ in {
owner = "root";
group = "root";
capabilities = "cap_net_raw+p";
source = "${pkgs.iftop}/bin/iftop";
source = lib.getExe pkgs.iftop;
};
};
}

View File

@ -0,0 +1,36 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.tcpdump;
in
{
options = {
programs.tcpdump = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to configure a setcap wrapper for tcpdump.
To use it, add your user to the `pcap` group.
'';
};
};
};
config = lib.mkIf cfg.enable {
security.wrappers.tcpdump = {
owner = "root";
group = "pcap";
capabilities = "cap_net_raw+p";
permissions = "u+rx,g+x";
source = lib.getExe pkgs.tcpdump;
};
users.groups.pcap = { };
};
}

View File

@ -1,8 +1,14 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.traceroute;
in {
in
{
options = {
programs.traceroute = {
enable = lib.mkOption {
@ -20,7 +26,7 @@ in {
owner = "root";
group = "root";
capabilities = "cap_net_raw+p";
source = "${pkgs.traceroute}/bin/traceroute";
source = lib.getExe pkgs.traceroute;
};
};
}

View File

@ -1,35 +1,27 @@
{ config, lib, pkgs, ... }:
let
let
cfg = config.services.opendkim;
defaultSock = "local:/run/opendkim/opendkim.sock";
keyFile = "${cfg.keyPath}/${cfg.selector}.private";
args = [ "-f" "-l"
"-p" cfg.socket
"-d" cfg.domains
"-k" keyFile
"-k" "${cfg.keyPath}/${cfg.selector}.private"
"-s" cfg.selector
] ++ lib.optionals (cfg.configFile != null) [ "-x" cfg.configFile ];
configFile = pkgs.writeText "opendkim.conf"
(lib.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "${name} ${value}") cfg.settings));
in {
imports = [
(lib.mkRenamedOptionModule [ "services" "opendkim" "keyFile" ] [ "services" "opendkim" "keyPath" ])
];
###### interface
options = {
services.opendkim = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether to enable the OpenDKIM sender authentication system.";
};
enable = lib.mkEnableOption "OpenDKIM sender authentication system";
socket = lib.mkOption {
type = lib.types.str;
@ -74,21 +66,24 @@ in {
description = "Selector to use when signing.";
};
# TODO: deprecate this?
configFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = "Additional opendkim configuration.";
description = "Additional opendkim configuration as a file.";
};
settings = lib.mkOption {
type = with lib.types; submodule {
freeformType = attrsOf str;
};
default = { };
description = "Additional opendkim configuration";
};
};
};
###### implementation
config = lib.mkIf cfg.enable {
users.users = lib.optionalAttrs (cfg.user == "opendkim") {
opendkim = {
group = cfg.group;
@ -100,7 +95,14 @@ in {
opendkim.gid = config.ids.gids.opendkim;
};
environment.systemPackages = [ pkgs.opendkim ];
environment = {
etc = lib.mkIf (cfg.settings != { }) {
"opendkim/opendkim.conf".source = configFile;
};
systemPackages = [ pkgs.opendkim ];
};
services.opendkim.configFile = lib.mkIf (cfg.settings != { }) configFile;
systemd.tmpfiles.rules = [
"d '${cfg.keyPath}' - ${cfg.user} ${cfg.group} - -"
@ -159,6 +161,5 @@ in {
UMask = "0077";
};
};
};
}

View File

@ -34,7 +34,7 @@ in
If you want to utilize an existing model that you've already
downloaded you'll need to move it into tabby's state directory which
lives in `/var/lib/tabby`. Because the tabby.service is configured to
use a DyanmicUser the service will need to have been started at least
use a DynamicUser the service will need to have been started at least
once before you can move the locally existing model into
`/var/lib/tabby`. You can set the model to 'none' and tabby will
startup and fail to download a model, but will have created the

View File

@ -125,7 +125,9 @@ in
# Install configuration files
environment.etc = {
"ipsec.secrets".source = "${pkgs.libreswan}/etc/ipsec.secrets";
"ipsec.secrets".text = ''
include ${pkgs.libreswan}/etc/ipsec.secrets
'';
"ipsec.conf".source = "${pkgs.libreswan}/etc/ipsec.conf";
"ipsec.d/01-nixos.conf".source = configFile;
} // policyFiles;

View File

@ -31,6 +31,7 @@ let
mkOption
mkPackageOption
optional
optionals
optionalString
splitString
subtractLists
@ -45,10 +46,22 @@ let
serverConfigFile = settingsFormat.generate "server.toml" (filterConfig cfg.serverSettings);
clientConfigFile = settingsFormat.generate "kanidm-config.toml" (filterConfig cfg.clientSettings);
unixConfigFile = settingsFormat.generate "kanidm-unixd.toml" (filterConfig cfg.unixSettings);
certPaths = builtins.map builtins.dirOf [
cfg.serverSettings.tls_chain
cfg.serverSettings.tls_key
];
provisionSecretFiles = filter (x: x != null) (
[
cfg.provision.idmAdminPasswordFile
cfg.provision.adminPasswordFile
]
++ mapAttrsToList (_: x: x.basicSecretFile) cfg.provision.systems.oauth2
);
secretDirectories = unique (
map builtins.dirOf (
[
cfg.serverSettings.tls_chain
cfg.serverSettings.tls_key
]
++ optionals cfg.provision.enable provisionSecretFiles
)
);
# Merge bind mount paths and remove paths where a prefix is already mounted.
# This makes sure that if e.g. the tls_chain is in the nix store and /nix/store is already in the mount
@ -817,7 +830,7 @@ in
(
defaultServiceConfig
// {
BindReadOnlyPaths = mergePaths (defaultServiceConfig.BindReadOnlyPaths ++ certPaths);
BindReadOnlyPaths = mergePaths (defaultServiceConfig.BindReadOnlyPaths ++ secretDirectories);
}
)
{

View File

@ -1094,6 +1094,7 @@ in
};
# We do this because we need the udev rules from the package
services.lvm.enable = true;
boot.initrd.services.lvm.enable = true;
boot.initrd.preFailCommands = mkIf (!config.boot.initrd.systemd.enable) postCommands;

View File

@ -6206,6 +6206,18 @@ final: prev:
meta.homepage = "https://github.com/lspcontainers/lspcontainers.nvim/";
};
lspecho-nvim = buildVimPlugin {
pname = "lspecho.nvim";
version = "2024-10-06";
src = fetchFromGitHub {
owner = "deathbeam";
repo = "lspecho.nvim";
rev = "6b00e2ed29a1f7b254a07d4b8a918ebf855026e5";
sha256 = "0z45b0mk7hd5h9d79318nyhhyhprwr929rpqfbblk5x0j4x2glxf";
};
meta.homepage = "https://github.com/deathbeam/lspecho.nvim/";
};
lspkind-nvim = buildVimPlugin {
pname = "lspkind.nvim";
version = "2024-10-25";

View File

@ -1346,6 +1346,11 @@ in
nvimRequireCheck = "lsp-progress";
};
lspecho-nvim = super.lspecho-nvim.overrideAttrs {
meta.license = lib.licenses.mit;
nvimRequireCheck = "lspecho";
};
luasnip = super.luasnip.overrideAttrs {
dependencies = [ luaPackages.jsregexp ];
nvimRequireCheck = "luasnip";

View File

@ -519,6 +519,7 @@ https://github.com/nvim-lua/lsp_extensions.nvim/,,
https://git.sr.ht/~whynothugo/lsp_lines.nvim,,
https://github.com/ray-x/lsp_signature.nvim/,,
https://github.com/lspcontainers/lspcontainers.nvim/,,
https://github.com/deathbeam/lspecho.nvim/,HEAD,
https://github.com/onsails/lspkind.nvim/,,
https://github.com/nvimdev/lspsaga.nvim/,,
https://github.com/barreiroleo/ltex_extra.nvim/,HEAD,

View File

@ -1,5 +1,5 @@
{ lib, mkChromiumDerivation
, channel, chromiumVersionAtLeast
, chromiumVersionAtLeast
, enableWideVine, ungoogled
}:
@ -90,7 +90,7 @@ mkChromiumDerivation (base: rec {
license = if enableWideVine then lib.licenses.unfree else lib.licenses.bsd3;
platforms = lib.platforms.linux;
mainProgram = "chromium";
hydraPlatforms = lib.optionals (channel == "stable" || channel == "ungoogled-chromium") ["aarch64-linux" "x86_64-linux"];
hydraPlatforms = ["aarch64-linux" "x86_64-linux"];
timeout = 172800; # 48 hours (increased from the Hydra default of 10h)
};
})

View File

@ -1,15 +1,19 @@
{ stdenv, lib, fetchpatch
, recompressTarball
, zstd
, fetchFromGitiles
, fetchNpmDeps
, buildPackages
, pkgsBuildBuild
# Channel data:
, channel, upstream-info
, upstream-info
# Helper functions:
, chromiumVersionAtLeast, versionRange
# Native build inputs:
, ninja, pkg-config
, python3, perl
, nodejs
, npmHooks
, which
, libuuid
, overrideCC
@ -145,12 +149,64 @@ let
else throw "no chromium Rosetta Stone entry for os: ${platform.config}";
};
isElectron = packageName == "electron";
chromiumDeps = lib.mapAttrs (path: args: fetchFromGitiles (removeAttrs args [ "recompress" ] // lib.optionalAttrs args.recompress or false {
name = "source.tar.zstd";
downloadToTemp = false;
passthru.unpack = true;
postFetch = ''
tar \
--use-compress-program="${lib.getExe zstd} -T$NIX_BUILD_CORES" \
--sort=name \
--mtime="1970-01-01" \
--owner=root --group=root \
--numeric-owner --mode=go=rX,u+rw,a-s \
--remove-files \
--directory="$out" \
-cf "$TMPDIR/source.zstd" .
mv "$TMPDIR/source.zstd" "$out"
'';
})) upstream-info.DEPS;
unpackPhaseSnippet = lib.concatStrings (lib.mapAttrsToList (path: dep:
(if dep.unpack or false
then ''
mkdir -p ${path}
pushd ${path}
unpackFile ${dep}
popd
''
else ''
mkdir -p ${builtins.dirOf path}
cp -r ${dep}/. ${path}
''
) + ''
chmod u+w -R ${path}
'') chromiumDeps);
base = rec {
pname = "${lib.optionalString ungoogled "ungoogled-"}${packageName}-unwrapped";
inherit (upstream-info) version;
inherit packageName buildType buildPath;
src = recompressTarball { inherit version; inherit (upstream-info) hash; };
unpackPhase = ''
runHook preUnpack
${unpackPhaseSnippet}
sourceRoot=src
runHook postUnpack
'';
npmRoot = "third_party/node";
npmDeps = (fetchNpmDeps {
src = chromiumDeps."src";
sourceRoot = npmRoot;
hash = upstream-info.deps.npmHash;
}).overrideAttrs (p: {
nativeBuildInputs = p.nativeBuildInputs or [ ] ++ [ zstd ];
});
nativeBuildInputs = [
ninja pkg-config
@ -158,6 +214,9 @@ let
which
buildPackages.rustc.llvmPackages.bintools
bison gperf
] ++ lib.optionals (!isElectron) [
nodejs
npmHooks.npmConfigHook
];
depsBuildBuild = [
@ -317,7 +376,32 @@ let
})
];
postPatch = ''
postPatch = lib.optionalString (!isElectron) ''
ln -s ${./files/gclient_args.gni} build/config/gclient_args.gni
echo 'LASTCHANGE=${upstream-info.DEPS."src".rev}-refs/heads/master@{#0}' > build/util/LASTCHANGE
echo "$SOURCE_DATE_EPOCH" > build/util/LASTCHANGE.committime
cat << EOF > gpu/config/gpu_lists_version.h
/* Generated by lastchange.py, do not edit.*/
#ifndef GPU_CONFIG_GPU_LISTS_VERSION_H_
#define GPU_CONFIG_GPU_LISTS_VERSION_H_
#define GPU_LISTS_VERSION "${upstream-info.DEPS."src".rev}"
#endif // GPU_CONFIG_GPU_LISTS_VERSION_H_
EOF
cat << EOF > skia/ext/skia_commit_hash.h
/* Generated by lastchange.py, do not edit.*/
#ifndef SKIA_EXT_SKIA_COMMIT_HASH_H_
#define SKIA_EXT_SKIA_COMMIT_HASH_H_
#define SKIA_COMMIT_HASH "${upstream-info.DEPS."src/third_party/skia".rev}-"
#endif // SKIA_EXT_SKIA_COMMIT_HASH_H_
EOF
echo -n '${upstream-info.DEPS."src/third_party/dawn".rev}' > gpu/webgpu/DAWN_VERSION
mkdir -p third_party/jdk/current/bin
'' + ''
# Workaround/fix for https://bugs.chromium.org/p/chromium/issues/detail?id=1313361:
substituteInPlace BUILD.gn \
--replace '"//infra/orchestrator:orchestrator_all",' ""
@ -513,6 +597,11 @@ let
# enable those features in our stable builds.
preConfigure = ''
export RUSTC_BOOTSTRAP=1
'' + lib.optionalString (!isElectron) ''
(
cd third_party/node
grep patch update_npm_deps | sh
)
'';
configurePhase = ''
@ -570,11 +659,9 @@ let
'';
passthru = {
updateScript = ./update.py;
chromiumDeps = {
gn = gnChromium;
};
inherit recompressTarball;
updateScript = ./update.mjs;
} // lib.optionalAttrs (!isElectron) {
inherit chromiumDeps npmDeps;
};
}
# overwrite `version` with the exact same `version` from the same source,

View File

@ -10,8 +10,7 @@
# package customization
# Note: enable* flags should not require full rebuilds (i.e. only affect the wrapper)
, channel ? "stable"
, upstream-info ? (import ./upstream-info.nix).${channel}
, upstream-info ? (lib.importJSON ./info.json).${if !ungoogled then "chromium" else "ungoogled-chromium"}
, proprietaryCodecs ? true
, enableWideVine ? false
, ungoogled ? false # Whether to build chromium or ungoogled-chromium
@ -46,13 +45,14 @@ let
inherit stdenv upstream-info;
mkChromiumDerivation = callPackage ./common.nix ({
inherit channel chromiumVersionAtLeast versionRange;
inherit chromiumVersionAtLeast versionRange;
inherit proprietaryCodecs
cupsSupport pulseSupport ungoogled;
gnChromium = buildPackages.gn.overrideAttrs (oldAttrs: {
inherit (upstream-info.deps.gn) version;
version = if (upstream-info.deps.gn ? "version") then upstream-info.deps.gn.version else "0";
src = fetchgit {
inherit (upstream-info.deps.gn) url rev hash;
url = "https://gn.googlesource.com/gn";
inherit (upstream-info.deps.gn) rev hash;
};
} // lib.optionalAttrs (chromiumVersionAtLeast "127") {
# Relax hardening as otherwise gn unstable 2024-06-06 and later fail with:
@ -65,11 +65,10 @@ let
# As a work around until gn is updated again, we filter specifically that patch out.
patches = lib.filter (e: lib.getName e != "LFS64.patch") oldAttrs.patches;
});
recompressTarball = callPackage ./recompress-tarball.nix { inherit chromiumVersionAtLeast; };
});
browser = callPackage ./browser.nix {
inherit channel chromiumVersionAtLeast enableWideVine ungoogled;
inherit chromiumVersionAtLeast enableWideVine ungoogled;
};
# ungoogled-chromium is, contrary to its name, not a build of
@ -80,8 +79,6 @@ let
ungoogled-chromium = pkgsBuildBuild.callPackage ./ungoogled.nix {};
};
suffix = lib.optionalString (channel != "stable" && channel != "ungoogled-chromium") ("-" + channel);
sandboxExecutableName = chromium.browser.passthru.sandboxExecutableName;
# We want users to be able to enableWideVine without rebuilding all of
@ -99,7 +96,7 @@ let
in stdenv.mkDerivation {
pname = lib.optionalString ungoogled "ungoogled-"
+ "chromium${suffix}";
+ "chromium";
inherit (chromium.browser) version;
nativeBuildInputs = [

View File

@ -0,0 +1,122 @@
#! /usr/bin/env nix-shell
#! nix-shell -i python -p python3
"""
This is a heavily simplified variant of electron's update.py
for use in ./update.mjs and should not be called manually.
It resolves chromium's DEPS file recursively when called with
a working depot_tools checkout and a ref to fetch and prints
the result as JSON to stdout.
"""
import base64
import json
from typing import Optional
from urllib.request import urlopen
import sys
if len(sys.argv) != 3:
print("""This internal script has been called with the wrong amount of parameters.
This script is not supposed to be called manually.
Refer to ./update.mjs instead.""")
exit(1)
_, depot_tools_checkout, chromium_version = sys.argv
sys.path.append(depot_tools_checkout)
import gclient_eval
import gclient_utils
class Repo:
fetcher: str
args: dict
def __init__(self) -> None:
self.deps: dict = {}
self.hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
def get_deps(self, repo_vars: dict, path: str) -> None:
print(
"evaluating " + json.dumps(self, default=vars, sort_keys=True),
file=sys.stderr,
)
deps_file = self.get_file("DEPS")
evaluated = gclient_eval.Parse(deps_file, vars_override=repo_vars, filename="DEPS")
repo_vars = dict(evaluated.get("vars", {})) | repo_vars
prefix = f"{path}/" if evaluated.get("use_relative_paths", False) else ""
self.deps = {
prefix + dep_name: repo_from_dep(dep)
for dep_name, dep in evaluated.get("deps", {}).items()
if (
gclient_eval.EvaluateCondition(dep["condition"], repo_vars)
if "condition" in dep
else True
)
and repo_from_dep(dep) != None
}
for key in evaluated.get("recursedeps", []):
dep_path = prefix + key
if dep_path in self.deps and dep_path != "src/third_party/squirrel.mac":
self.deps[dep_path].get_deps(repo_vars, dep_path)
def flatten_repr(self) -> dict:
return {"fetcher": self.fetcher, "hash": self.hash, **self.args}
def flatten(self, path: str) -> dict:
out = {path: self.flatten_repr()}
for dep_path, dep in self.deps.items():
out |= dep.flatten(dep_path)
return out
def get_file(self, filepath: str) -> str:
raise NotImplementedError
class GitilesRepo(Repo):
def __init__(self, url: str, rev: str) -> None:
super().__init__()
self.fetcher = "fetchFromGitiles"
self.args = {
"url": url,
"rev": rev,
}
def get_file(self, filepath: str) -> str:
return base64.b64decode(
urlopen(
f"{self.args['url']}/+/{self.args['rev']}/{filepath}?format=TEXT"
).read()
).decode("utf-8")
def repo_from_dep(dep: dict) -> Optional[Repo]:
if "url" in dep:
url, rev = gclient_utils.SplitUrlRevision(dep["url"])
return GitilesRepo(url, rev)
else:
# Not a git dependency; skip
return None
chromium = GitilesRepo("https://chromium.googlesource.com/chromium/src.git", chromium_version)
chromium.get_deps(
{
**{
f"checkout_{platform}": platform == "linux" or platform == "x64" or platform == "arm64" or platform == "arm"
for platform in ["ios", "chromeos", "android", "mac", "win", "linux"]
},
**{
f"checkout_{arch}": True
for arch in ["x64", "arm64", "arm", "x86", "mips", "mips64"]
},
},
"",
)
print(json.dumps(chromium.flatten("src")))

View File

@ -0,0 +1,12 @@
build_with_chromium = true
checkout_android = false
checkout_android_prebuilts_build_tools = false
checkout_clang_coverage_tools = false
checkout_copybara = false
checkout_ios_webkit = false
checkout_nacl = false
checkout_openxr = false
checkout_src_internal = false
cros_boards = ""
cros_boards_with_qemu_images = ""
generate_location_tags = true

File diff suppressed because it is too large Load Diff

View File

@ -1,56 +0,0 @@
{ zstd
, fetchurl
, lib
, chromiumVersionAtLeast
}:
{ version
, hash ? ""
} @ args:
fetchurl ({
name = "chromium-${version}.tar.zstd";
url = "https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${version}.tar.xz";
inherit hash;
# chromium xz tarballs are multiple gigabytes big and are sometimes downloaded multiples
# times for different versions as part of our update script.
# We originally inherited fetchzip's default for downloadToTemp (true).
# Given the size of the /run/user tmpfs used defaults to logind's RuntimeDirectorySize=,
# which in turn defaults to 10% of the total amount of physical RAM, this often lead to
# "no space left" errors, eventually resulting in its own section in our chromium
# README.md (for users wanting to run the update script).
# Nowadays, we use fetchurl instead of fetchzip, which defaults to false instead of true.
# We just want to be explicit and provide a place to document the history and reasoning
# behind this.
downloadToTemp = false;
nativeBuildInputs = [ zstd ];
postFetch = ''
cat "$downloadedFile" \
| xz -d --threads=$NIX_BUILD_CORES \
| tar xf - \
--warning=no-timestamp \
--one-top-level=source \
--exclude=third_party/llvm \
--exclude=third_party/rust-src \
--exclude='build/linux/debian_*-sysroot' \
'' + lib.optionalString (chromiumVersionAtLeast "127") ''
--exclude='*.tar.[a-zA-Z0-9][a-zA-Z0-9]' \
--exclude='*.tar.[a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9]' \
--exclude=third_party/llvm-build \
--exclude=third_party/rust-toolchain \
--exclude=third_party/instrumented_libs \
'' + ''
--strip-components=1
tar \
--use-compress-program "zstd -T$NIX_BUILD_CORES" \
--sort name \
--mtime "1970-01-01" \
--owner=root --group=root \
--numeric-owner --mode=go=rX,u+rw,a-s \
-cf $out source
'';
} // removeAttrs args [ "version" ])

View File

@ -0,0 +1,237 @@
#! /usr/bin/env nix-shell
/*
#! nix-shell -i zx -p zx
*/
cd(__dirname)
const nixpkgs = (await $`git rev-parse --show-toplevel`).stdout.trim()
const $nixpkgs = $({
cwd: nixpkgs
})
const dummy_hash = 'sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA='
const lockfile_file = './info.json'
const lockfile_initial = fs.readJsonSync(lockfile_file)
function flush_to_file() {
fs.writeJsonSync(lockfile_file, lockfile, { spaces: 2 })
}
const flush_to_file_proxy = {
get(obj, prop) {
const value = obj[prop]
return typeof value == 'object' ? new Proxy(value, flush_to_file_proxy) : value
},
set(obj, prop, value) {
obj[prop] = value
flush_to_file()
return true
},
}
const lockfile = new Proxy(structuredClone(lockfile_initial), flush_to_file_proxy)
for (const attr_path of Object.keys(lockfile)) {
if (!argv[attr_path]) {
console.log(`[${attr_path}] Skipping ${attr_path}. Pass --${attr_path} as argument to update.`)
continue
}
const ungoogled = attr_path === 'ungoogled-chromium'
const version_nixpkgs = !ungoogled ? lockfile[attr_path].version : lockfile[attr_path].deps['ungoogled-patches'].rev
const version_upstream = !ungoogled ? await get_latest_chromium_release() : await get_latest_ungoogled_release()
console.log(`[${attr_path}] ${chalk.red(version_nixpkgs)} (nixpkgs)`)
console.log(`[${attr_path}] ${chalk.green(version_upstream)} (upstream)`)
if (version_greater_than(version_upstream, version_nixpkgs)) {
console.log(`[${attr_path}] ${chalk.green(version_upstream)} from upstream is newer than our ${chalk.red(version_nixpkgs)}...`)
// unconditionally remove ungoogled-chromium's epoch/sub-version (e.g. 130.0.6723.116-1 -> 130.0.6723.116)
const version_chromium = version_upstream.split('-')[0]
lockfile[attr_path] = {
version: version_chromium,
chromedriver: !ungoogled ? await fetch_chromedriver_binaries(version_chromium) : undefined,
deps: {
depot_tools: {},
gn: {},
'ungoogled-patches': ungoogled ? await fetch_ungoogled(version_upstream) : undefined,
npmHash: dummy_hash,
},
DEPS: {},
}
const depot_tools = await fetch_depot_tools(version_chromium, lockfile_initial[attr_path].deps.depot_tools)
lockfile[attr_path].deps.depot_tools = {
rev: depot_tools.rev,
hash: depot_tools.hash,
}
const gn = await fetch_gn(version_chromium, lockfile_initial[attr_path].deps.gn)
lockfile[attr_path].deps.gn = {
rev: gn.rev,
hash: gn.hash,
}
// DEPS update loop
lockfile[attr_path].DEPS = await resolve_DEPS(depot_tools.out, version_chromium)
for (const [path, value] of Object.entries(lockfile[attr_path].DEPS)) {
delete value.fetcher
delete value.postFetch
if (value.url === 'https://chromium.googlesource.com/chromium/src.git') {
value.recompress = true
}
const cache_hit = (() => {
for (const attr_path in lockfile_initial) {
const cache = lockfile_initial[attr_path].DEPS[path]
const hits_cache =
cache !== undefined &&
value.url === cache.url &&
value.rev === cache.rev &&
value.recompress === cache.recompress &&
cache.hash !== undefined &&
cache.hash !== '' &&
cache.hash !== dummy_hash
if (hits_cache) {
cache.attr_path = attr_path
return cache;
}
}
})();
if (cache_hit) {
console.log(`[${chalk.green(path)}] Reusing hash from previous info.json for ${cache_hit.url}@${cache_hit.rev} from ${cache_hit.attr_path}`)
value.hash = cache_hit.hash
continue
}
console.log(`[${chalk.red(path)}] FOD prefetching ${value.url}@${value.rev}...`)
value.hash = await prefetch_FOD('-A', `${attr_path}.browser.passthru.chromiumDeps."${path}"`)
console.log(`[${chalk.green(path)}] FOD prefetching successful`)
}
lockfile[attr_path].deps.npmHash = await prefetch_FOD('-A', `${attr_path}.browser.passthru.npmDeps`)
console.log(chalk.green(`[${attr_path}] Done updating ${attr_path} from ${version_nixpkgs} to ${version_upstream}!`))
}
}
async function fetch_gn(chromium_rev, gn_previous) {
const DEPS_file = await get_gitiles_file('https://chromium.googlesource.com/chromium/src', chromium_rev, 'DEPS')
const gn_rev = /^\s+'gn_version': 'git_revision:(?<rev>.+)',$/m.exec(DEPS_file).groups.rev
const hash = gn_rev === gn_previous.rev ? gn_previous.hash : ''
return await prefetch_gitiles('https://gn.googlesource.com/gn', gn_rev, hash)
}
async function fetch_chromedriver_binaries(chromium_version) {
// https://developer.chrome.com/docs/chromedriver/downloads/version-selection
const prefetch = async (url) => {
const expr = [`(import ./. {}).fetchzip { url = "${url}"; hash = ""; }`]
const derivation = await $nixpkgs`nix-instantiate --expr ${expr}`
return await prefetch_FOD(derivation)
}
// if the URL ever changes, the URLs in the chromedriver derivations need updating as well!
const url = (platform) => `https://storage.googleapis.com/chrome-for-testing-public/${chromium_version}/${platform}/chromedriver-${platform}.zip`
return {
hash_darwin: await prefetch(url('mac-x64')),
hash_darwin_aarch64: await prefetch(url('mac-arm64')),
}
}
async function resolve_DEPS(depot_tools_checkout, chromium_rev) {
const { stdout } = await $`./depot_tools.py ${depot_tools_checkout} ${chromium_rev}`
const deps = JSON.parse(stdout)
return Object.fromEntries(Object.entries(deps).map(([k, { url, rev, hash }]) => [k, { url, rev, hash }]))
}
async function get_latest_chromium_release() {
const url = `https://versionhistory.googleapis.com/v1/chrome/platforms/linux/channels/stable/versions/all/releases?` + new URLSearchParams({
order_by: 'version desc',
filter: 'endtime=none,fraction>=0.5'
})
const response = await (await fetch(url)).json()
return response.releases[0].version
}
async function get_latest_ungoogled_release() {
const ungoogled_tags = await (await fetch('https://api.github.com/repos/ungoogled-software/ungoogled-chromium/tags')).json()
const chromium_releases = await (await fetch('https://versionhistory.googleapis.com/v1/chrome/platforms/linux/channels/stable/versions/all/releases')).json()
const chromium_release_map = chromium_releases.releases.map((x) => x.version)
return ungoogled_tags.find((x) => chromium_release_map.includes(x.name.split('-')[0])).name
}
async function fetch_ungoogled(rev) {
const expr = (hash) => [`(import ./. {}).fetchFromGitHub { owner = "ungoogled-software"; repo = "ungoogled-chromium"; rev = "${rev}"; hash = "${hash}"; }`]
const hash = await prefetch_FOD('--expr', expr(''))
const checkout = await $nixpkgs`nix-build --expr ${expr(hash)}`
await fs.copy(`${checkout.stdout.trim()}/flags.gn`, './ungoogled-flags.toml')
return {
rev,
hash,
}
}
function version_greater_than(greater, than) {
return greater.localeCompare(than, undefined, { numeric: true, sensitivity: 'base' }) === 1
}
async function get_gitiles_file(repo, rev, path) {
const base64 = await (await fetch(`${repo}/+/${rev}/${path}?format=TEXT`)).text()
return Buffer.from(base64, 'base64').toString('utf-8')
}
async function fetch_depot_tools(chromium_rev, depot_tools_previous) {
const depot_tools_rev = await get_gitiles_file('https://chromium.googlesource.com/chromium/src', chromium_rev, 'third_party/depot_tools')
const hash = depot_tools_rev === depot_tools_previous.rev ? depot_tools_previous.hash : ''
return await prefetch_gitiles('https://chromium.googlesource.com/chromium/tools/depot_tools', depot_tools_rev, hash)
}
async function prefetch_gitiles(url, rev, hash = '') {
const expr = () => [`(import ./. {}).fetchFromGitiles { url = "${url}"; rev = "${rev}"; hash = "${hash}"; }`]
if (hash === '') {
hash = await prefetch_FOD('--expr', expr())
}
const { stdout } = await $nixpkgs`nix-build --expr ${expr()}`
return {
url,
rev,
hash,
out: stdout.trim(),
}
}
async function prefetch_FOD(...args) {
const { stderr } = await $nixpkgs`nix-build ${args}`.nothrow()
const hash = /\s+got:\s+(?<hash>.+)$/m.exec(stderr)?.groups?.hash
if (hash == undefined) {
throw new Error(chalk.red('Expected to find hash in nix-build stderr output:') + stderr)
}
return hash
}

View File

@ -1,300 +0,0 @@
#! /usr/bin/env nix-shell
#! nix-shell -i python -p python3Packages.looseversion nix nixfmt-classic nix-prefetch-git
"""This script automatically updates chromium, google-chrome, chromedriver, and ungoogled-chromium
via upstream-info.nix."""
# Usage: ./update.py [--commit]
import base64
import csv
import json
import re
import subprocess
import sys
from codecs import iterdecode
from collections import OrderedDict
from datetime import datetime
from looseversion import LooseVersion
from os.path import abspath, dirname
from urllib.request import urlopen
RELEASES_URL = 'https://versionhistory.googleapis.com/v1/chrome/platforms/linux/channels/all/versions/all/releases'
PIN_PATH = dirname(abspath(__file__)) + '/upstream-info.nix'
UNGOOGLED_FLAGS_PATH = dirname(abspath(__file__)) + '/ungoogled-flags.toml'
COMMIT_MESSAGE_SCRIPT = dirname(abspath(__file__)) + '/get-commit-message.py'
NIXPKGS_PATH = subprocess.check_output(["git", "rev-parse", "--show-toplevel"], cwd=dirname(PIN_PATH)).strip()
def load_as_json(path):
"""Loads the given nix file as JSON."""
out = subprocess.check_output(['nix-instantiate', '--eval', '--strict', '--json', path])
return json.loads(out)
def save_dict_as_nix(path, input):
"""Saves the given dict/JSON as nix file."""
json_string = json.dumps(input)
nix = subprocess.check_output(['nix-instantiate', '--eval', '--expr', '{ json }: builtins.fromJSON json', '--argstr', 'json', json_string])
formatted = subprocess.check_output(['nixfmt'], input=nix)
with open(path, 'w') as out:
out.write(formatted.decode())
def prefetch_src_sri_hash(attr_path, version):
"""Prefetches the fixed-output-derivation source tarball and returns its SRI-Hash."""
print(f'nix-build (FOD prefetch) {attr_path} {version}')
out = subprocess.run(
["nix-build", "--expr", f'(import ./. {{}}).{attr_path}.browser.passthru.recompressTarball {{ version = "{version}"; }}'],
cwd=NIXPKGS_PATH,
stderr=subprocess.PIPE
).stderr.decode()
for line in iter(out.split("\n")):
match = re.match(r"\s+got:\s+(.+)$", line)
if match:
print(f'Hash: {match.group(1)}')
return match.group(1)
print(f'{out}\n\nError: Expected hash in nix-build stderr output.', file=sys.stderr)
sys.exit(1)
def nix_prefetch_url(url, algo='sha256'):
"""Prefetches the content of the given URL."""
print(f'nix store prefetch-file {url}')
out = subprocess.check_output(['nix', 'store', 'prefetch-file', '--json', '--hash-type', algo, url])
return json.loads(out)['hash']
def nix_prefetch_git(url, rev):
"""Prefetches the requested Git revision of the given repository URL."""
print(f'nix-prefetch-git {url} {rev}')
out = subprocess.check_output(['nix-prefetch-git', '--quiet', '--url', url, '--rev', rev])
return json.loads(out)
def get_file_revision(revision, file_path):
"""Fetches the requested Git revision of the given Chromium file."""
url = f'https://chromium.googlesource.com/chromium/src/+/refs/tags/{revision}/{file_path}?format=TEXT'
with urlopen(url) as http_response:
resp = http_response.read()
return base64.b64decode(resp)
def get_ungoogled_file_revision(revision, file_path):
"""Fetches the requested Git revision of the given Chromium file."""
url = f'https://raw.githubusercontent.com/ungoogled-software/ungoogled-chromium/{revision}/{file_path}'
with urlopen(url) as http_response:
resp = http_response.read()
return resp.decode("utf-8")
def get_chromedriver(channel):
"""Get the latest chromedriver builds given a channel"""
# See https://chromedriver.chromium.org/downloads/version-selection#h.4wiyvw42q63v
chromedriver_versions_url = f'https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json'
print(f'GET {chromedriver_versions_url}')
with urlopen(chromedriver_versions_url) as http_response:
chromedrivers = json.load(http_response)
channel = chromedrivers['channels'][channel]
downloads = channel['downloads']['chromedriver']
def get_chromedriver_url(platform):
for download in downloads:
if download['platform'] == platform:
return download['url']
return {
'version': channel['version'],
'hash_linux': nix_prefetch_url(get_chromedriver_url('linux64')),
'hash_darwin': nix_prefetch_url(get_chromedriver_url('mac-x64')),
'hash_darwin_aarch64': nix_prefetch_url(get_chromedriver_url('mac-arm64'))
}
def get_channel_dependencies(version):
"""Gets all dependencies for the given Chromium version."""
deps = get_file_revision(version, 'DEPS')
gn_pattern = b"'gn_version': 'git_revision:([0-9a-f]{40})'"
gn_commit = re.search(gn_pattern, deps).group(1).decode()
gn = nix_prefetch_git('https://gn.googlesource.com/gn', gn_commit)
return {
'gn': {
'version': datetime.fromisoformat(gn['date']).date().isoformat(),
'url': gn['url'],
'rev': gn['rev'],
'hash': gn['hash']
}
}
def get_latest_ungoogled_chromium_tag(linux_stable_versions):
"""Returns the latest ungoogled-chromium tag for linux using the GitHub API."""
api_tag_url = 'https://api.github.com/repos/ungoogled-software/ungoogled-chromium/tags'
with urlopen(api_tag_url) as http_response:
tags = json.load(http_response)
for tag in tags:
if not tag['name'].split('-')[0] in linux_stable_versions:
continue
return tag['name']
def get_latest_ungoogled_chromium_build(linux_stable_versions):
"""Returns a dictionary for the latest ungoogled-chromium build."""
tag = get_latest_ungoogled_chromium_tag(linux_stable_versions)
version = tag.split('-')[0]
return {
'name': 'chrome/platforms/linux/channels/ungoogled-chromium/versions/',
'version': version,
'ungoogled_rev': tag
}
def get_ungoogled_chromium_build_by_ref(ungoogled_chromium_ref):
"""Returns a dictionary for an ungoogled-chromium build referenced by a ref in the ungoogled-chromium repository."""
version = get_ungoogled_file_revision(ungoogled_chromium_ref, "chromium_version.txt").strip("\n ")
return {
'name': 'chrome/platforms/linux/channels/ungoogled-chromium/versions/',
'version': version,
'ungoogled_rev': ungoogled_chromium_ref
}
def get_ungoogled_chromium_gn_flags(revision):
"""Returns ungoogled-chromium's GN build flags for the given revision."""
gn_flags_url = f'https://raw.githubusercontent.com/ungoogled-software/ungoogled-chromium/{revision}/flags.gn'
return urlopen(gn_flags_url).read().decode()
def channel_name_to_attr_name(channel_name):
"""Maps a channel name to the corresponding main Nixpkgs attribute name."""
if channel_name == 'stable':
return 'chromium'
if channel_name == 'ungoogled-chromium':
return 'ungoogled-chromium'
print(f'Error: Unexpected channel: {channel_name}', file=sys.stderr)
sys.exit(1)
def get_channel_key(item):
"""Orders Chromium channels by their name."""
channel_name = item[0]
if channel_name == 'stable':
return 0
if channel_name == 'beta':
return 1
if channel_name == 'dev':
return 2
if channel_name == 'ungoogled-chromium':
return 3
print(f'Error: Unexpected channel: {channel_name}', file=sys.stderr)
sys.exit(1)
def print_updates(channels_old, channels_new):
"""Print a summary of the updates."""
print('Updates:')
for channel_name in channels_old:
version_old = channels_old[channel_name]["version"]
version_new = channels_new[channel_name]["version"]
if LooseVersion(version_old) < LooseVersion(version_new):
attr_name = channel_name_to_attr_name(channel_name)
print(f'- {attr_name}: {version_old} -> {version_new}')
channels = {}
last_channels = load_as_json(PIN_PATH)
src_hash_cache = {}
print(f'GET {RELEASES_URL}', file=sys.stderr)
with urlopen(RELEASES_URL) as resp:
releases = json.load(resp)['releases']
if len(sys.argv) == 3 and sys.argv[1] == 'ungoogled-rev':
releases.append(get_ungoogled_chromium_build_by_ref(sys.argv[2]))
else:
linux_stable_versions = [release['version'] for release in releases if release['name'].startswith('chrome/platforms/linux/channels/stable/versions/')]
releases.append(get_latest_ungoogled_chromium_build(linux_stable_versions))
for release in releases:
channel_name = re.findall("chrome/platforms/linux/channels/(.*)/versions/", release['name'])[0]
# If we've already found a newer release for this channel, we're
# no longer interested in it.
if channel_name in channels:
continue
# We only look for channels that are listed in our version pin file.
if channel_name not in last_channels:
continue
# If we're back at the last release we used, we don't need to
# keep going -- there's no new version available, and we can
# just reuse the info from last time.
if release['version'] == last_channels[channel_name]['version']:
channels[channel_name] = last_channels[channel_name]
continue
channel = {'version': release['version']}
if channel_name == 'dev':
google_chrome_suffix = 'unstable'
elif channel_name == 'ungoogled-chromium':
google_chrome_suffix = 'stable'
else:
google_chrome_suffix = channel_name
try:
version = release["version"]
existing_releases = dict(map(lambda channel: (channel[1]['version'], channel[1]['hash']), last_channels.items()))
if version in src_hash_cache:
print(f'Already got hash {src_hash_cache[version]} for {version}, skipping FOD prefetch for {channel_name_to_attr_name(channel_name)}')
channel["hash"] = src_hash_cache[version]
elif version in existing_releases:
print(f'Already got hash {existing_releases[version]} for {version} (from upstream-info.nix), skipping FOD prefetch for {channel_name_to_attr_name(channel_name)}')
channel["hash"] = existing_releases[version]
else:
channel["hash"] = prefetch_src_sri_hash(
channel_name_to_attr_name(channel_name),
version
)
src_hash_cache[version] = channel["hash"]
except subprocess.CalledProcessError:
# This release isn't actually available yet. Continue to
# the next one.
continue
channel['deps'] = get_channel_dependencies(channel['version'])
if channel_name == 'stable':
channel['chromedriver'] = get_chromedriver('Stable')
elif channel_name == 'ungoogled-chromium':
ungoogled_repo_url = 'https://github.com/ungoogled-software/ungoogled-chromium.git'
channel['deps']['ungoogled-patches'] = {
'rev': release['ungoogled_rev'],
'hash': nix_prefetch_git(ungoogled_repo_url, release['ungoogled_rev'])['hash']
}
with open(UNGOOGLED_FLAGS_PATH, 'w') as out:
out.write(get_ungoogled_chromium_gn_flags(release['ungoogled_rev']))
channels[channel_name] = channel
sorted_channels = OrderedDict(sorted(channels.items(), key=get_channel_key))
if len(sys.argv) == 2 and sys.argv[1] == '--commit':
for channel_name in sorted_channels.keys():
version_old = last_channels[channel_name]['version']
version_new = sorted_channels[channel_name]['version']
if LooseVersion(version_old) < LooseVersion(version_new):
last_channels[channel_name] = sorted_channels[channel_name]
save_dict_as_nix(PIN_PATH, last_channels)
attr_name = channel_name_to_attr_name(channel_name)
commit_message = f'{attr_name}: {version_old} -> {version_new}'
if channel_name == 'stable':
body = subprocess.check_output([COMMIT_MESSAGE_SCRIPT, version_new]).decode('utf-8')
commit_message += '\n\n' + body
elif channel_name == 'ungoogled-chromium':
subprocess.run(['git', 'add', UNGOOGLED_FLAGS_PATH], check=True)
subprocess.run(['git', 'add', JSON_PATH], check=True)
subprocess.run(['git', 'commit', '--file=-'], input=commit_message.encode(), check=True)
else:
save_dict_as_nix(PIN_PATH, sorted_channels)
print_updates(last_channels, sorted_channels)

View File

@ -1,37 +0,0 @@
{
stable = {
chromedriver = {
hash_darwin = "sha256-+Pcd++19/nJVsqGr2jzyjMTWYfb2U9wSgnNccDyGuGU=";
hash_darwin_aarch64 =
"sha256-vrbIpHrBwbzqars7D546eJ7zhEhAB0abq7MXiqlU4ts=";
hash_linux = "sha256-NbZ1GULLWJ6L3kczz23HoUhGk6VgBOXcjZlL7t4Z6Ec=";
version = "130.0.6723.116";
};
deps = {
gn = {
hash = "sha256-iNXRq3Mr8+wmY1SR4sV7yd2fDiIZ94eReelwFI0UhGU=";
rev = "20806f79c6b4ba295274e3a589d85db41a02fdaa";
url = "https://gn.googlesource.com/gn";
version = "2024-09-09";
};
};
hash = "sha256-eOCUKhFv205MD1gEY1FQQNCwxyELNjIAxUlPcRn74Lk=";
version = "130.0.6723.116";
};
ungoogled-chromium = {
deps = {
gn = {
hash = "sha256-iNXRq3Mr8+wmY1SR4sV7yd2fDiIZ94eReelwFI0UhGU=";
rev = "20806f79c6b4ba295274e3a589d85db41a02fdaa";
url = "https://gn.googlesource.com/gn";
version = "2024-09-09";
};
ungoogled-patches = {
hash = "sha256-+94tSSaOp6vzWkXN1qF3UXMm/Rs3pKmjf+U4x+af818=";
rev = "130.0.6723.116-1";
};
};
hash = "sha256-eOCUKhFv205MD1gEY1FQQNCwxyELNjIAxUlPcRn74Lk=";
version = "130.0.6723.116";
};
}

View File

@ -24,7 +24,6 @@
libnatpmp,
libpulseaudio,
libupnp,
yaml-cpp,
msgpack-cxx,
openssl,
restinio,
@ -32,6 +31,7 @@
speex,
udev,
webrtc-audio-processing,
yaml-cpp,
zlib,
# for dhtnet
@ -68,14 +68,14 @@
stdenv.mkDerivation rec {
pname = "jami";
version = "20240823.0";
version = "20241031.0";
src = fetchFromGitLab {
domain = "git.jami.net";
owner = "savoirfairelinux";
repo = "jami-client-qt";
rev = "stable/${version}";
hash = "sha256-7jGH54sFiS6qrdEiKSS64lJyJXL1FOJVbesxo/FFmyA=";
hash = "sha256-LKezdzM+ltUSgW4GmTXICyufx9mI1AVbdEcwSp6tmao=";
fetchSubmodules = true;
};
@ -137,7 +137,7 @@ stdenv.mkDerivation rec {
domain = "git.jami.net";
owner = "savoirfairelinux";
repo = "dhtnet";
rev = "cfe512b0632eea046f683b22e42d01eeb943d751";
rev = "8cd00200669fa5b7632faa447ba206c3847e2879";
hash = "sha256-SGidaCi5z7hO0ePJIZIkcWAkb+cKsZTdksVS7ldpjME=";
};
@ -173,6 +173,8 @@ stdenv.mkDerivation rec {
"-DBUILD_BENCHMARKS=Off"
"-DBUILD_TOOLS=Off"
"-DBUILD_TESTING=Off"
"-DBUILD_DEPENDENCIES=Off"
"-DBUILD_EXAMPLE=Off"
];
meta = with lib; {
@ -188,6 +190,12 @@ stdenv.mkDerivation rec {
inherit src version meta;
sourceRoot = "${src.name}/daemon";
# Fix for libgit2 breaking changes
postPatch = ''
substituteInPlace src/jamidht/conversationrepository.cpp \
--replace-fail "git_commit* const" "const git_commit*"
'';
nativeBuildInputs = [
autoreconfHook
pkg-config
@ -212,7 +220,6 @@ stdenv.mkDerivation rec {
libnatpmp
libpulseaudio
libupnp
yaml-cpp
msgpack-cxx
opendht-jami
openssl
@ -222,6 +229,7 @@ stdenv.mkDerivation rec {
speex
udev
webrtc-audio-processing
yaml-cpp
zlib
];

View File

@ -62,7 +62,6 @@ stdenv.mkDerivation (finalAttrs: rec {
++ lib.optionals stdenv.hostPlatform.isLinux [ "-sOSVER=26" ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"-sOSVER=1013"
"-sMACOSX_SDK=${emptyDirectory}"
"-sLIBC++DIR=${lib.getLib stdenv.cc.libcxx}/lib"
];
@ -81,6 +80,10 @@ stdenv.mkDerivation (finalAttrs: rec {
(stdenv.cc.isClang || (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.cc.version "11.0.0"))
[ "-include" "limits" "-include" "thread" ];
preBuild = lib.optionalString stdenv.hostPlatform.isDarwin ''
export MACOSX_SDK=$SDKROOT
'';
buildPhase = ''
runHook preBuild
jam $jamFlags -j$NIX_BUILD_CORES p4

View File

@ -1,61 +0,0 @@
diff --git a/src/Gui/PreferencePages/DlgSettingsEditor.cpp b/src/Gui/PreferencePages/DlgSettingsEditor.cpp
index 5f92058c18..b00104497b 100644
--- a/src/Gui/PreferencePages/DlgSettingsEditor.cpp
+++ b/src/Gui/PreferencePages/DlgSettingsEditor.cpp
@@ -56,27 +56,34 @@ namespace
*
* Based on
* https://stackoverflow.com/questions/18896933/qt-qfont-selection-of-a-monospace-font-doesnt-work
+ * Local fix to based on comment in
+ * https://github.com/FreeCAD/FreeCAD/issues/10514#issuecomment-1849176386
*/
+bool hasFixedPitch(const QFont& font)
+{
+ return QFontInfo(font).fixedPitch();
+}
+
QFont getMonospaceFont()
{
- QFont font(QString::fromLatin1("monospace"));
- if (font.fixedPitch()) {
- return font;
- }
- font.setStyleHint(QFont::Monospace);
- if (font.fixedPitch()) {
- return font;
+ if (QFont font = QFontDatabase::systemFont(QFontDatabase::FixedFont); hasFixedPitch(font)) {
+ return font; // should typically work.
}
- font.setStyleHint(QFont::TypeWriter);
- if (font.fixedPitch()) {
+
+ QFont font; // default QApplication font
+ font.setStyleHint(QFont::Courier); // may not work
+ if (hasFixedPitch(font)) {
return font;
}
- font.setFamily(QString::fromLatin1("courier"));
- if (font.fixedPitch()) {
- return font;
+ for (const char* family : {"Monospace", "Courier"}) {
+ font.setFamily(QString::fromLatin1(family));
+ if (hasFixedPitch(font)) {
+ return font;
+ }
}
- return font; // We failed, but return whatever we have anyway
+ return font;
}
+
} // namespace
/* TRANSLATOR Gui::Dialog::DlgSettingsEditor */
@@ -302,7 +309,7 @@ void DlgSettingsEditor::loadSettings()
ui->fontSize->setValue(10);
ui->fontSize->setValue(hGrp->GetInt("FontSize", ui->fontSize->value()));
- QByteArray defaultMonospaceFont = getMonospaceFont().family().toLatin1();
+ QByteArray defaultMonospaceFont = QFontInfo(getMonospaceFont()).family().toLatin1();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStringList familyNames = QFontDatabase().families(QFontDatabase::Any);

View File

@ -63,13 +63,13 @@ let
in
stdenv.mkDerivation (finalAttrs: {
pname = "freecad";
version = "1.0rc2";
version = "1.0.0";
src = fetchFromGitHub {
owner = "FreeCAD";
repo = "FreeCAD";
rev = finalAttrs.version;
hash = "sha256-kPmfx/C1fCYwBqh6ZOKZAVNVR9m3VryPmBKu3ksDD5E=";
hash = "sha256-u7RYSImUMAgKaAQSAGCFha++RufpZ/QuHAirbSFOUCI=";
fetchSubmodules = true;
};
@ -131,7 +131,6 @@ stdenv.mkDerivation (finalAttrs: {
patches = [
./0001-NIXOS-don-t-ignore-PYTHONPATH.patch
./0002-FreeCad-OndselSolver-pkgconfig.patch
./0003-freecad-font-issue-10514.patch
];
cmakeFlags = [

View File

@ -0,0 +1,51 @@
{
lib,
fetchFromGitHub,
rustPlatform,
installShellFiles,
makeWrapper,
fzf,
stdenv,
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
pname = "git-smash";
version = "0.1.1";
src = fetchFromGitHub {
owner = "anthraxx";
repo = "git-smash";
rev = "refs/tags/v${version}";
hash = "sha256-NyNYEF5g0O9xNhq+CoDPhQXZ+ISiY4DsShpjk5nP0N8=";
};
cargoHash = "sha256-omITZMBWzYlHHim/IXNa1rtiwHqpgLJ5G9z15YvDRi0=";
nativeBuildInputs = [
installShellFiles
makeWrapper
];
postFixup = ''
wrapProgram "$out/bin/git-smash" --suffix PATH : "${lib.makeBinPath [ fzf ]}"
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd git-smash \
--bash <($out/bin/git-smash completions bash) \
--fish <($out/bin/git-smash completions fish) \
--zsh <($out/bin/git-smash completions zsh)
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Smash staged changes into previous commits to support your Git workflow, pull request and feature branch maintenance";
homepage = "https://github.com/anthraxx/git-smash";
changelog = "https://github.com/anthraxx/git-smash/blob/${src.rev}/CHANGELOG.md";
license = lib.licenses.mit;
mainProgram = "git-smash";
maintainers = with lib.maintainers; [ bcyran ];
};
}

View File

@ -166,11 +166,11 @@ let
linux = stdenv.mkDerivation (finalAttrs: {
inherit pname meta passthru;
version = "131.0.6778.69";
version = "131.0.6778.85";
src = fetchurl {
url = "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${finalAttrs.version}-1_amd64.deb";
hash = "sha256-7aE6RZE5kB3DaJFUDdc2Ter8SsZZM0JzYmKn1hF1BUs=";
hash = "sha256-Cn0fg6WI1kFdk8s0LCksMCMLSDkPImXBDNK+hNMlMpQ=";
};
# With strictDeps on, some shebangs were not being patched correctly
@ -266,11 +266,11 @@ let
darwin = stdenvNoCC.mkDerivation (finalAttrs: {
inherit pname meta passthru;
version = "131.0.6778.70";
version = "131.0.6778.86";
src = fetchurl {
url = "http://dl.google.com/release2/chrome/acwi7l3xj4g6lag6mccophfiv2aa_131.0.6778.70/GoogleChrome-131.0.6778.70.dmg";
hash = "sha256-Gikqdh9g3FAnWBLrxMtbomKceIaMsz/GnguiEUpKJW0=";
url = "http://dl.google.com/release2/chrome/neljlxhync4hvd3scdidzwcaj4_131.0.6778.86/GoogleChrome-131.0.6778.86.dmg";
hash = "sha256-EIX74r86/J8dgz585O7dcx0pv/OlR3ZNLiUe6E/V2C8=";
};
dontPatch = true;

View File

@ -0,0 +1,15 @@
{
"serif" = "sha256-8ygaAeMKygYS4GCub4YUQmkh87pYHfi3s0PQ6AbaeGw=";
"sans" = "sha256-mK+8GGl2ugF2+fS6yd3p5NWPHHcKEJWiShDS3lihOlI=";
"sans-condensed" = "sha256-/aJTXmrHuoPSrtCKNodBY7I0CriayNTx5LCXw+/MFvE=";
"sans-arabic" = "sha256-qi4k7kMLftIuq87idyxq46FOD6QYycdG6j3zJmu8mhI=";
"sans-devanagari" = "sha256-K57OVqcH5r9tZx8NFEoz1P3xpUooqpF7xxJzNmnObwE=";
"sans-thai" = "sha256-JZVbvZdj+IfBthiqivOXHrvAUe392M9ECGsiJkm0saE=";
"sans-thai-looped" = "sha256-cry/Ctwt1bsrdbvWkJIYWLjsvV6a1lLFsT85znqERnw=";
"sans-tc" = "sha256-kZvzSK6fEjfVMR4kxC4lxtD7GskqvJZx8BBJVT4T9MU=";
"sans-kr" = "sha256-FsHxMvLlI4yylgG96DOZIdW2DYpk7I+c5QgkVIkNZIE=";
"sans-jp" = "sha256-hUl/SSkN6q3pDTtrY2mJepw3ljhhLJskGbxfsTl9TuI=";
"sans-hebrew" = "sha256-rTuBQYLI+6gEFTumCdaWpeoLzRoyFSmqWbXziq+UG6I=";
"mono" = "sha256-OwUmrPfEehLDz0fl2ChYLK8FQM2p0G1+EMrGsYEq+6g=";
"math" = "sha256-dJA6uqxa/yb3eLY4l39NeP0yIl2NfrbaRpf6h0/F7Xc=";
}

View File

@ -1,28 +1,51 @@
{ lib, stdenvNoCC, fetchzip }:
{
lib,
stdenvNoCC,
fetchzip,
families ? [ ],
}:
let
version = import ./version.nix;
availableFamilies = import ./hashes.nix;
stdenvNoCC.mkDerivation rec {
availableFamilyNames = builtins.attrNames availableFamilies;
selectedFamilies = if (families == [ ]) then availableFamilyNames else families;
unknownFamilies = lib.subtractLists availableFamilyNames families;
in
assert lib.assertMsg (unknownFamilies == [ ]) "Unknown font(s): ${toString unknownFamilies}";
stdenvNoCC.mkDerivation {
pname = "ibm-plex";
version = "6.4.0";
inherit version;
src = fetchzip {
url = "https://github.com/IBM/plex/releases/download/v${version}/OpenType.zip";
hash = "sha256-/aR3bu03VxenSPed6EqrGoPjWCcKT//MVtb9OC8tSRs=";
};
srcs = builtins.map (
family:
fetchzip {
url = "https://github.com/IBM/plex/releases/download/%40ibm%2Fplex-${family}%40${version}/ibm-plex-${family}.zip";
hash = availableFamilies.${family};
}
) selectedFamilies;
dontUnpack = true;
sourceRoot = ".";
installPhase = ''
runHook preInstall
install -Dm644 */*.otf IBM-Plex-Sans-JP/unhinted/* -t $out/share/fonts/opentype
find $srcs -type f -name '*.otf' -exec install -Dm644 {} -t $out/share/fonts/opentype \;
runHook postInstall
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "IBM Plex Typeface";
homepage = "https://www.ibm.com/plex/";
changelog = "https://github.com/IBM/plex/raw/v${version}/CHANGELOG.md";
license = licenses.ofl;
platforms = platforms.all;
maintainers = [ maintainers.romildo ];
maintainers = with maintainers; [
romildo
ryanccn
];
};
}

View File

@ -0,0 +1,42 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p nix nix-prefetch jq
# shellcheck shell=bash
set -eo pipefail
families=(
"serif"
"sans"
"sans-condensed"
"sans-arabic"
"sans-devanagari"
"sans-thai"
"sans-thai-looped"
"sans-tc"
"sans-kr"
"sans-jp"
"sans-hebrew"
"mono"
"math"
)
version=$(curl --silent 'https://api.github.com/repos/IBM/plex/releases/latest' | jq -r '.tag_name | sub("^@ibm/[\\w-]+@"; "")')
dirname="$(dirname "$0")"
echo \""${version}"\" >"$dirname/version-new.nix"
if diff -q "$dirname/version-new.nix" "$dirname/version.nix"; then
echo No new version available, current: "$version"
rm "$dirname/version-new.nix"
exit 0
else
echo Updated to version "$version"
mv "$dirname/version-new.nix" "$dirname/version.nix"
fi
printf '{\n' > "$dirname/hashes.nix"
for family in "${families[@]}"; do
url="https://github.com/IBM/plex/releases/download/%40ibm%2Fplex-${family}%40${version}/ibm-plex-${family}.zip"
printf ' "%s" = "%s";\n' "$family" "$(nix-prefetch-url --unpack "$url" | xargs nix hash convert --hash-algo sha256)" >>"$dirname/hashes.nix"
done
printf '}\n' >> "$dirname/hashes.nix"

View File

@ -0,0 +1 @@
"1.1.0"

View File

@ -0,0 +1,82 @@
{
lib,
stdenvNoCC,
inkscape,
xcursorgen,
fetchFromGitHub,
fetchpatch2,
}:
let
styles = [
"LyraB"
"LyraF"
"LyraG"
"LyraP"
"LyraQ"
"LyraR"
"LyraS"
"LyraX"
"LyraY"
];
# This is a patch from a fork of the upstream repository which addresses several issues with the
# build script such as the fact that the style to build isn't hardcoded. We don't simply use this
# fork as source, as the upstream repository is what we want to track.
buildScriptPatch = fetchpatch2 {
name = "use-more-flexible-build-script.patch";
url = "https://github.com/KiranWells/Lyra-Cursors/commit/2735acb37a51792388497c666cc28370660217cb.patch?full_index=1";
hash = "sha256-KCT4zNdep1TB7Oa4qrPw374ahT30o9/QrNTEgobp8zM=";
};
in
stdenvNoCC.mkDerivation {
pname = "lyra-cursors";
version = "0-unstable-2021-12-04";
src = fetchFromGitHub {
owner = "yeyushengfan258";
repo = "Lyra-Cursors";
rev = "c096c54034f95bd35699b3226250e5c5ec015d9a";
hash = "sha256-lfaX8ouE0JaQwVBpAGsrLIExQZ2rCSFKPs3cch17eYg=";
};
nativeBuildInputs = [
inkscape
xcursorgen
];
patches = [ buildScriptPatch ];
dontConfigure = true;
postPatch = ''
patchShebangs build.sh
'';
buildPhase = ''
runHook preBuild
rm -r dist
for THEME in ${lib.escapeShellArgs styles}; do
./build.sh "$THEME"
done
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/icons
mv dist/*-cursors $out/share/icons
runHook postInstall
'';
meta = {
description = "A cursor theme inspired by macOS and based on capitaine-cursors";
homepage = "https://github.com/yeyushengfan258/Lyra-Cursors";
license = lib.licenses.gpl3Only;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ lordmzte ];
};
}

View File

@ -5,16 +5,16 @@
buildGoModule rec {
pname = "oauth2c";
version = "1.16.0";
version = "1.17.0";
src = fetchFromGitHub {
owner = "cloudentity";
repo = pname;
rev = "v${version}";
hash = "sha256-spD6BEyDwY2Nrk/XOWA+XJA1l7ixN4j6N5m9e8DLg88=";
hash = "sha256-2EfkNtTbHSa0UZGfYylz0HlyVxGdSJNIUj6682DICSg=";
};
vendorHash = "sha256-PdLh/J0HUvr1JjW/ew5PQe9TJNykI4tJhlRoVjRT/hg=";
vendorHash = "sha256-ZQFIETfiNKyeZuskwNfoTXBy3MSWmG0tDztz0Mm7xJY=";
doCheck = false; # tests want to talk to oauth2c.us.authz.cloudentity.io

View File

@ -73,7 +73,12 @@ stdenv.mkDerivation rec {
) "XSLTPROC=${buildPackages.libxslt}/bin/xsltproc")
];
PCSC_CFLAGS = lib.optionalString withApplePCSC "-I${darwin.apple_sdk.frameworks.PCSC}/Library/Frameworks/PCSC.framework/Headers";
PCSC_CFLAGS = lib.concatStringsSep " " (
lib.optionals withApplePCSC [
"-I${darwin.apple_sdk.frameworks.PCSC}/Library/Frameworks/PCSC.framework/Headers"
"-I${lib.getDev pcsclite}/include/PCSC"
]
);
installFlags = [
"sysconfdir=$(out)/etc"

View File

@ -8,13 +8,13 @@
python3.pkgs.toPythonModule (
python3.pkgs.buildPythonApplication rec {
pname = "searxng";
version = "0-unstable-2024-10-05";
version = "0-unstable-2024-11-17";
src = fetchFromGitHub {
owner = "searxng";
repo = "searxng";
rev = "e7a4d7d7c3d688b69737f2b1ecd23571f5e3a0b9";
hash = "sha256-JfcB19Tfk5e7DyArzz9TNjidOZjkSxTLEU3ZhE105qs=";
rev = "10d3af84b833ab2f2d1095efa3a7ba240ffb32fc";
hash = "sha256-dXALuiPCzK0Az64Fj9ygsNFoPKf0oJ2LyZDeg00Bfyo=";
};
postPatch = ''
@ -52,10 +52,11 @@ python3.pkgs.toPythonModule (
brotli
jinja2
lxml
msgspec
pygments
pytomlpp
pyyaml
redis
typer
uvloop
setproctitle
httpx

View File

@ -3,17 +3,26 @@
lib,
fetchurl,
}:
appimageTools.wrapType2 rec {
let
pname = "snipaste";
version = "2.10.2";
src = fetchurl {
url = "https://download.snipaste.com/archives/Snipaste-${version}-x86_64.AppImage";
hash = "sha256-u9e2d9ZpHDbDIsFkseOdJX2Kspn9TkhFfZxbeielDA8=";
};
contents = appimageTools.extract { inherit pname version src; };
in
appimageTools.wrapType2 {
inherit pname version src;
passthru.updateScript = ./update.sh;
extraInstallCommands = ''
install -d $out/share/{applications,icons}
cp ${contents}/usr/share/applications/*.desktop -t $out/share/applications/
cp -r ${contents}/usr/share/icons/* -t $out/share/icons/
substituteInPlace $out/share/applications/*.desktop --replace-warn 'Exec=Snipaste' 'Exec=${pname}'
'';
meta = {
description = "Screenshot tools";
homepage = "https://www.snipaste.com/";

View File

@ -10,6 +10,8 @@
fluidsynth,
libpulseaudio,
lilv,
which,
wrapGAppsHook3,
nixosTests,
}:
@ -24,8 +26,11 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
makeWrapper
wrapGAppsHook3
];
dontWrapGApps = true;
installPhase = ''
mkdir -p $out/bin
cp -r dist lib share $out/
@ -34,9 +39,17 @@ stdenv.mkDerivation (finalAttrs: {
ln -s $out/dist $out/bin/dist
ln -s $out/lib $out/bin/lib
ln -s $out/share $out/bin/share
'';
postFixup = ''
wrapProgram $out/bin/tuxguitar \
--set JAVA "${jre}/bin/java" \
"''${gappsWrapperArgs[@]}" \
--prefix PATH : ${
lib.makeBinPath [
jre
which
]
} \
--prefix LD_LIBRARY_PATH : "$out/lib/:${
lib.makeLibraryPath [
swt

View File

@ -0,0 +1,92 @@
{
lib,
fetchFromGitLab,
glib,
gtk4,
meson,
ninja,
gitUpdater,
desktop-file-utils,
appstream,
blueprint-compiler,
python3Packages,
pkg-config,
libadwaita,
wrapGAppsHook4,
upscayl-ncnn,
}:
python3Packages.buildPythonApplication rec {
pname = "upscaler";
version = "1.4.0";
pyproject = false; # meson instead of pyproject
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "World";
repo = "Upscaler";
rev = version;
hash = "sha256-Dy8tykIbK5o0XulurG+TxORZZSxfRe5Kjh6aGpsh+0Y=";
};
passthru.updateScript = gitUpdater { };
postPatch = ''
substituteInPlace upscaler/window.py \
--replace-fail '"upscayl-bin",' '"${lib.getExe upscayl-ncnn}",'
'';
strictDeps = true;
nativeBuildInputs = [
wrapGAppsHook4
meson
ninja
desktop-file-utils
appstream
blueprint-compiler
pkg-config
gtk4
glib
];
dependencies = with python3Packages; [
pygobject3
pillow
vulkan
];
buildInputs = [
libadwaita
upscayl-ncnn
];
mesonFlags = [
(lib.mesonBool "network_tests" false)
];
# NOTE: `postCheck` is intentionally not used here, as the entire checkPhase
# is skipped by `buildPythonApplication`
# https://github.com/NixOS/nixpkgs/blob/9d4343b7b27a3e6f08fc22ead568233ff24bbbde/pkgs/development/interpreters/python/mk-python-derivation.nix#L296
postInstallCheck = ''
mesonCheckPhase
'';
dontWrapGApps = true;
makeWrapperArgs = [ "\${gappsWrapperArgs[@]}" ];
meta = {
description = "Upscale and enhance images";
homepage = "https://tesk.page/upscaler";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [
grimmauld
getchoo
aleksana
];
mainProgram = "upscaler";
platforms = lib.platforms.linux;
};
}

View File

@ -0,0 +1,27 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e4da27..85cf911 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -106,20 +106,13 @@ if(USE_SYSTEM_NCNN)
message(STATUS "Using glslang install located at ${GLSLANG_TARGET_DIR}")
find_package(Threads)
+ find_package(glslang REQUIRED)
+ find_package(SPIRV-Tools-opt REQUIRED)
- include("${GLSLANG_TARGET_DIR}/OSDependentTargets.cmake")
- include("${GLSLANG_TARGET_DIR}/OGLCompilerTargets.cmake")
if(EXISTS "${GLSLANG_TARGET_DIR}/HLSLTargets.cmake")
# hlsl support can be optional
include("${GLSLANG_TARGET_DIR}/HLSLTargets.cmake")
endif()
- include("${GLSLANG_TARGET_DIR}/glslangTargets.cmake")
- include("${GLSLANG_TARGET_DIR}/SPIRVTargets.cmake")
-
- if (NOT TARGET glslang OR NOT TARGET SPIRV)
- message(WARNING "glslang or SPIRV target not found! USE_SYSTEM_NCNN will be turned off.")
- set(USE_SYSTEM_NCNN OFF)
- endif()
endif()
endif()

View File

@ -0,0 +1,22 @@
diff --git a/main.cpp b/main.cpp
index 9d44c3d..40d2b27 100644
--- a/main.cpp
+++ b/main.cpp
@@ -207,7 +207,7 @@ static void print_usage()
fprintf(stderr, " -w width resize output to a width (default=W:default), use '-r help' for more details\n");
fprintf(stderr, " -c compress compression of the output image, default 0 and varies to 100\n");
fprintf(stderr, " -t tile-size tile size (>=32/0=auto, default=0) can be 0,0,0 for multi-gpu\n");
- fprintf(stderr, " -m model-path folder path to the pre-trained models. default=models\n");
+ fprintf(stderr, " -m model-path folder path to the pre-trained models. default=REPLACE_MODELS\n");
fprintf(stderr, " -n model-name model name (default=realesrgan-x4plus, can be realesr-animevideov3 | realesrgan-x4plus-anime | realesrnet-x4plus or any other model)\n");
fprintf(stderr, " -g gpu-id gpu device to use (default=auto) can be 0,1,2 for multi-gpu\n");
fprintf(stderr, " -j load:proc:save thread count for load/proc/save (default=1:2:2) can be 1:2,2,2:2 for multi-gpu\n");
@@ -688,7 +688,7 @@ int main(int argc, char **argv)
bool resizeProvided = false;
bool hasCustomWidth = false;
std::vector<int> tilesize;
- path_t model = PATHSTR("models");
+ path_t model = PATHSTR("REPLACE_MODELS");
path_t modelname = PATHSTR("realesrgan-x4plus");
std::vector<int> gpuid;
int jobs_load = 1;

View File

@ -0,0 +1,92 @@
{
cmake,
fetchFromGitHub,
fetchzip,
glslang,
installShellFiles,
lib,
libwebp,
ncnn,
stdenv,
vulkan-headers,
vulkan-loader,
}:
# upscayl-ncnn is a fork of /pkgs/by-name/re/realesrgan-ncnn-vulkan, so the nix package is basically the same.
stdenv.mkDerivation (finalAttrs: {
pname = "upscayl-ncnn";
version = "20240601-103425";
src = fetchFromGitHub {
owner = "upscayl";
repo = "upscayl-ncnn";
rev = "refs/tags/${finalAttrs.version}";
hash = "sha256-rGnjL+sU5x3VXHnvuYXVdxGmHdj9eBkIZK3CwL89lN0=";
};
models = fetchzip {
# Choose the newst release from https://github.com/xinntao/Real-ESRGAN/releases to update
url = "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-ubuntu.zip";
hash = "sha256-1YiPzv1eGnHrazJFRvl37+C1F2xnoEbN0UQYkxLT+JQ=";
stripRoot = false;
};
patches = [
./cmakelists.patch
./models_path.patch
];
sourceRoot = "${finalAttrs.src.name}/src";
postPatch = ''
substituteInPlace main.cpp --replace REPLACE_MODELS $out/share/models
'';
nativeBuildInputs = [
cmake
glslang
installShellFiles
];
cmakeFlags = [
(lib.cmakeBool "USE_SYSTEM_NCNN" true)
(lib.cmakeBool "USE_SYSTEM_WEBP" true)
(lib.cmakeFeature "GLSLANG_TARGET_DIR" "${glslang}/lib/cmake")
];
buildInputs = [
vulkan-loader
libwebp
ncnn
vulkan-headers
glslang
];
installPhase = ''
runHook preInstall
mkdir -p $out/share
installBin upscayl-bin
ln -s ${finalAttrs.models}/models $out/share
runHook postInstall
'';
env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isLinux "-rpath ${
lib.makeLibraryPath [ vulkan-loader ]
}";
meta = {
changelog = "https://github.com/upscayl/upscayl-ncnn/releases/tag/${finalAttrs.version}";
description = "Upscayl backend powered by the NCNN framework and Real-ESRGAN architecture";
homepage = "https://github.com/upscayl/upscayl-ncnn";
license = lib.licenses.agpl3Only;
mainProgram = "upscayl-bin";
maintainers = with lib.maintainers; [
grimmauld
getchoo
];
platforms = lib.platforms.all;
};
})

View File

@ -2,6 +2,7 @@
, hackrf, rtl-sdr, airspy, limesuite, libiio
, libbladeRF
, qt5
, wrapGAppsHook3
, USRPSupport ? false, uhd }:
python3Packages.buildPythonApplication rec {
@ -15,7 +16,7 @@ python3Packages.buildPythonApplication rec {
sha256 = "sha256-4Fe2+BUdnVdNQHqZeftXLabn/vTzgyynOtqy0rAb0Rk=";
};
nativeBuildInputs = [ qt5.wrapQtAppsHook ];
nativeBuildInputs = [ qt5.wrapQtAppsHook wrapGAppsHook3 ];
buildInputs = [ hackrf rtl-sdr airspy limesuite libiio libbladeRF ]
++ lib.optional USRPSupport uhd
++ lib.optional stdenv.hostPlatform.isLinux qt5.qtwayland;

View File

@ -1,33 +1,24 @@
{ lib, stdenv, fetchurl, fetchpatch, gettext, pkg-config, perlPackages
{ lib, stdenv, fetchurl, gettext, pkg-config, perlPackages
, libidn2, zlib, pcre, libuuid, libiconv, libintl
, python3, lzip, darwin
, nukeReferences, python3, lzip, darwin
, withLibpsl ? false, libpsl
, withOpenssl ? true, openssl
}:
stdenv.mkDerivation rec {
pname = "wget";
version = "1.24.5";
version = "1.25.0";
src = fetchurl {
url = "mirror://gnu/wget/wget-${version}.tar.lz";
hash = "sha256-V6EHFR5O+U/flK/+z6xZiWPzcvEyk+2cdAMhBTkLNu4=";
hash = "sha256-GSJcx1awoIj8gRSNxqQKDI8ymvf9hIPxx7L+UPTgih8=";
};
patches = [
./remove-runtime-dep-on-openssl-headers.patch
(fetchpatch {
name = "CVE-2024-38428.patch";
url = "https://git.savannah.gnu.org/cgit/wget.git/patch/?id=ed0c7c7e0e8f7298352646b2fd6e06a11e242ace";
hash = "sha256-4ZVPufgG/h0UkxF9hQBAtF6QAG4GEz9hHeqEsD47q4U=";
})
];
preConfigure = ''
patchShebangs doc
'';
nativeBuildInputs = [ gettext pkg-config perlPackages.perl lzip libiconv libintl ];
nativeBuildInputs = [ gettext pkg-config perlPackages.perl lzip libiconv libintl nukeReferences ];
buildInputs = [ libidn2 zlib pcre libuuid ]
++ lib.optional withOpenssl openssl
++ lib.optional withLibpsl libpsl
@ -40,6 +31,14 @@ stdenv.mkDerivation rec {
"--without-included-regex"
];
preBuild = ''
# avoid runtime references to build-only depends
make -C src version.c
nuke-refs src/version.c
'';
enableParallelBuilding = true;
__darwinAllowLocalNetworking = true;
doCheck = true;
preCheck = ''

View File

@ -1,17 +0,0 @@
diff --git a/src/Makefile.in b/src/Makefile.in
index 1a36a9b..e279c84 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -2211,10 +2211,9 @@ version.c: $(wget_SOURCES) ../lib/libgnu.a
echo '' >> $@
echo '#include "version.h"' >> $@
echo 'const char *version_string = "@VERSION@";' >> $@
- echo 'const char *compilation_string = "'$(COMPILE)'";' \
+ echo 'const char *compilation_string = 0;' \
| $(ESCAPEQUOTE) >> $@
- echo 'const char *link_string = "'$(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(wget_LDADD)'";' \
+ echo 'const char *link_string = 0;' \
| $(ESCAPEQUOTE) >> $@
css.c: $(srcdir)/css.l

View File

@ -17,13 +17,13 @@ python3Packages.buildPythonApplication rec {
# The websites yt-dlp deals with are a very moving target. That means that
# downloads break constantly. Because of that, updates should always be backported
# to the latest stable release.
version = "2024.11.4";
version = "2024.11.18";
pyproject = true;
src = fetchPypi {
inherit version;
pname = "yt_dlp";
hash = "sha256-7SBMG2G8Vj4TREd2bRqzQxc1QHmeE+u5U+iHzn3PaGU=";
hash = "sha256-uKTCPTya/X5Ha824fzi2wOjhLjojnXmI8TrLQ0IA9U0=";
};
build-system = with python3Packages; [

View File

@ -0,0 +1,63 @@
{
buildPythonPackage,
cffi,
fetchFromGitHub,
inflection,
jinja2,
lib,
pysdl2,
setuptools,
vulkan-loader,
wheel,
xmltodict,
}:
buildPythonPackage rec {
pname = "vulkan";
version = "1.3.275.1";
pyproject = true;
src = fetchFromGitHub {
owner = "realitix";
repo = "vulkan";
rev = "refs/tags/${version}";
hash = "sha256-b1jHNKdHF7pIC6H4O2yxy36Ppb60J0uN2P0WaCw51Gc=";
};
postPatch = ''
substituteInPlace vulkan/_vulkan.py \
--replace-fail 'lib = ffi.dlopen(name)' 'lib = ffi.dlopen("${vulkan-loader}/lib/" + name)'
'';
buildInputs = [
vulkan-loader
];
build-system = [
setuptools
wheel
];
dependencies = [
inflection
jinja2
pysdl2
xmltodict
cffi
];
pythonImportsCheck = [
"vulkan"
];
meta = {
description = "Ultimate Python binding for Vulkan API";
homepage = "https://github.com/realitix/vulkan";
license = lib.licenses.asl20;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [
grimmauld
getchoo
];
};
}

View File

@ -1,7 +1,7 @@
{
lib,
stdenv,
fetchurl,
fetchzip,
unzip,
testers,
chromedriver,
@ -9,19 +9,18 @@
let
upstream-info =
(import ../../../../applications/networking/browsers/chromium/upstream-info.nix)
.stable.chromedriver;
(lib.importJSON ../../../../applications/networking/browsers/chromium/info.json).chromium;
# See ./source.nix for Linux
allSpecs = {
x86_64-darwin = {
system = "mac-x64";
hash = upstream-info.hash_darwin;
hash = upstream-info.chromedriver.hash_darwin;
};
aarch64-darwin = {
system = "mac-arm64";
hash = upstream-info.hash_darwin_aarch64;
hash = upstream-info.chromedriver.hash_darwin_aarch64;
};
};
@ -35,7 +34,7 @@ stdenv.mkDerivation {
pname = "chromedriver";
inherit version;
src = fetchurl {
src = fetchzip {
url = "https://storage.googleapis.com/chrome-for-testing-public/${version}/${spec.system}/chromedriver-${spec.system}.zip";
inherit (spec) hash;
};

View File

@ -4,13 +4,13 @@
callPackage ../generic.nix rec {
pname = "rat-king-adventure";
version = "2.0.1";
version = "2.0.2";
src = fetchFromGitHub {
owner = "TrashboxBobylev";
repo = "Rat-King-Adventure";
rev = version;
hash = "sha256-FAIFrlVyNYTiS+UBLZFOhuMzj8C6qNGAffYrTxcNeDM=";
hash = "sha256-mh54m2YwGOmE03fxndk3wNX/xi6UyIdXWEguiC3mDeA=";
};
desktopName = "Rat King Adventure";

View File

@ -14,12 +14,12 @@ let
# kernel config in the xanmod version commit
variants = {
lts = {
version = "6.6.60";
hash = "sha256-hbuMuLoXVaFb/HnkVlJm8BSwStxsWmz5e4y65kXBJto=";
version = "6.6.62";
hash = "sha256-KbD5YaaZLDDsp5wuEkenUe+/KrFjOgUomXtLKHtQzvs=";
};
main = {
version = "6.11.7";
hash = "sha256-+gj6sR20v4+NHR4cqsVK5fVpqXs9zxcBh0kJUH5qpNE=";
version = "6.11.9";
hash = "sha256-lR7GXFy3eYq75+LwVlXScPYWbdVW6wAV+He0YZ+5AF4=";
};
};

View File

@ -31,21 +31,15 @@ mkDerivation rec {
url = "https://github.com/open-eid/DigiDoc4-Client/commit/bb324d18f0452c2ab1b360ff6c42bb7f11ea60d7.patch";
hash = "sha256-JpaU9inupSDsZKhHk+sp5g+oUynVFxR7lshjTXoFIbU=";
})
# Regularly update this with what's on https://src.fedoraproject.org/rpms/qdigidoc/blob/rawhide/f/sandbox.patch
# This prevents attempts to download TSL lists inside the build sandbox.
# The list files are regularly updated (get new signatures), though this also happens at application runtime.
./sandbox.patch
];
# Check https://dss.nowina.lu/tl-info, "Pivots loaded" section
tsl = fetchurl {
url = "https://ec.europa.eu/tools/lotl/eu-lotl-pivot-341.xml";
hash = "sha256-/TI8qYxXzourjGFPBpsQzi9Depi7lLQ2JaV+FyP0FtE=";
};
nativeBuildInputs = [ cmake gettext pkg-config qttools ];
postPatch = ''
substituteInPlace client/CMakeLists.txt \
--replace $\{TSL_URL} file://${tsl}
'';
buildInputs = [
flatbuffers
libdigidocpp

File diff suppressed because one or more lines are too long

View File

@ -16157,7 +16157,6 @@ with pkgs;
ungoogled-chromium = callPackage ../applications/networking/browsers/chromium ((config.chromium or {}) // {
ungoogled = true;
channel = "ungoogled-chromium";
});
unigine-tropics = pkgsi686Linux.callPackage ../applications/graphics/unigine-tropics { };

View File

@ -17545,6 +17545,8 @@ self: super: with self; {
vulcan-api = callPackage ../development/python-modules/vulcan-api { };
vulkan = callPackage ../development/python-modules/vulkan { };
vultr = callPackage ../development/python-modules/vultr { };
vulture = callPackage ../development/python-modules/vulture { };