Skip to content

Commit

Permalink
Merge master into staging-next
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Nov 13, 2024
2 parents d6721ed + 27d7247 commit b3a71c7
Show file tree
Hide file tree
Showing 80 changed files with 792 additions and 1,167 deletions.
5 changes: 5 additions & 0 deletions lib/licenses.nix
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ lib.mapAttrs mkLicense ({
fullName = "BSD 3-Clause Clear License";
};

bsd3Lbnl = {
spdxId = "BSD-3-Clause-LBNL";
fullName = "Lawrence Berkeley National Labs BSD variant license";
};

bsdOriginal = {
spdxId = "BSD-4-Clause";
fullName = ''BSD 4-clause "Original" or "Old" License'';
Expand Down
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13474,6 +13474,12 @@
githubId = 1709273;
name = "Robin Hack";
};
marnym = {
email = "[email protected]";
github = "marnym";
githubId = 56825922;
name = "Markus Nyman";
};
marsupialgutz = {
email = "[email protected]";
github = "pupbrained";
Expand Down
4 changes: 3 additions & 1 deletion nixos/modules/programs/firefox.nix
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ in
old.extraPrefsFiles or [ ]
++ cfg.autoConfigFiles
++ [ (pkgs.writeText "firefox-autoconfig.js" cfg.autoConfig) ];
nativeMessagingHosts = old.nativeMessagingHosts or [ ] ++ cfg.nativeMessagingHosts.packages;
nativeMessagingHosts = lib.unique (
old.nativeMessagingHosts or [ ] ++ cfg.nativeMessagingHosts.packages
);
cfg = (old.cfg or { }) // cfg.wrapperConfig;
}))
];
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/postgresql/anonymizer.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ let
services.postgresql = {
inherit package;
enable = true;
enableJIT = lib.hasInfix "-jit-" package.name;
extraPlugins = ps: [ ps.anonymizer ];
settings.shared_preload_libraries = [ "anon" ];
};
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/postgresql/pgjwt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ let
services.postgresql = {
inherit package;
enable = true;
enableJIT = lib.hasInfix "-jit-" package.name;
extraPlugins =
ps: with ps; [
pgjwt
Expand Down
7 changes: 4 additions & 3 deletions nixos/tests/postgresql/pgvecto-rs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ let
'';

makeTestFor =
postgresqlPackage:
package:
makeTest {
name = "pgvecto-rs-${postgresqlPackage.name}";
name = "pgvecto-rs-${package.name}";
meta = with lib.maintainers; {
maintainers = [ diogotcorreia ];
};
Expand All @@ -35,8 +35,9 @@ let
{ ... }:
{
services.postgresql = {
inherit package;
enable = true;
package = postgresqlPackage;
enableJIT = lib.hasInfix "-jit-" package.name;
extraPlugins =
ps: with ps; [
pgvecto-rs
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/postgresql/postgresql-tls-client-cert.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ let
services.postgresql = {
inherit package;
enable = true;
enableJIT = lib.hasInfix "-jit-" package.name;
enableTCPIP = true;
ensureUsers = [
{
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/postgresql/postgresql-wal-receiver.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ let
services.postgresql = {
inherit package;
enable = true;
enableJIT = lib.hasInfix "-jit-" package.name;
settings = {
max_replication_slots = 10;
max_wal_senders = 10;
Expand Down
4 changes: 3 additions & 1 deletion nixos/tests/postgresql/postgresql.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ let
{ ... }:
{
services.postgresql = {
inherit (package) ;
inherit package;
enable = true;
enableJIT = lib.hasInfix "-jit-" package.name;
};

services.postgresqlBackup = {
Expand Down Expand Up @@ -158,6 +159,7 @@ let
services.postgresql = {
inherit package;
enable = true;
enableJIT = lib.hasInfix "-jit-" package.name;
ensureUsers = [
{
name = "all-clauses";
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/postgresql/timescaledb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ let
services.postgresql = {
inherit package;
enable = true;
enableJIT = lib.hasInfix "-jit-" package.name;
extraPlugins =
ps: with ps; [
timescaledb
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/postgresql/tsja.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ let
services.postgresql = {
inherit package;
enable = true;
enableJIT = lib.hasInfix "-jit-" package.name;
extraPlugins =
ps: with ps; [
tsja
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/postgresql/wal2json.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let
services.postgresql = {
inherit package;
enable = true;
enableJIT = lib.hasInfix "-jit-" package.name;
extraPlugins = with package.pkgs; [ wal2json ];
settings = {
wal_level = "logical";
Expand Down
36 changes: 36 additions & 0 deletions pkgs/applications/editors/neovim/to-nvim-treesitter-grammar.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
echo "Sourcing to-nvim-treesitter-grammar.sh"

toNvimTreesitterGrammar() {
echo "Executing toNvimTreesitterGrammar"

mkdir -p "$out/parser"
ln -s "$origGrammar/parser" "$out/parser/$grammarName.so"

if [ "$installQueries" != 1 ]; then
echo "Installing queries is disabled: installQueries=$installQueries"
return
fi

echo "Installing queries for $grammarName"

mkdir -p "$out/queries/$grammarName"
if [ -d "$origGrammar/queries/$grammarName" ]; then
echo "Moving queries from neovim queries dir"
for file in "$origGrammar/queries/$grammarName/"*; do
ln -s "$file" "$out/queries/$grammarName/$(basename "$file")"
done
else
if [ -d "$origGrammar/queries" ]; then
echo "Moving queries from standard queries dir"

for file in "$origGrammar/queries/"*; do
ln -s "$file" "$out/queries/$grammarName/$(basename "$file")"
done
else
echo "Missing queries for $grammarName"
fi
fi
}

echo "Using toNvimTreesitterGrammar"
preDistPhases+=" toNvimTreesitterGrammar"
72 changes: 44 additions & 28 deletions pkgs/applications/editors/neovim/utils.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{ lib
, stdenv
, makeSetupHook
, callPackage
, vimUtils
, vimPlugins
, nodejs
, neovim-unwrapped
, bundlerEnv
, ruby
, lua
, python3Packages
, wrapNeovimUnstable
, runCommand
}:
let
inherit (vimUtils) toVimPlugin;
Expand Down Expand Up @@ -173,35 +175,49 @@ let
(lib.removePrefix "tree-sitter-")
(lib.replaceStrings [ "-" ] [ "_" ])
];

nvimGrammars = lib.mapAttrsToList (name: value: value.origGrammar) vimPlugins.nvim-treesitter.grammarPlugins;
isNvimGrammar = x: builtins.elem x nvimGrammars;

toNvimTreesitterGrammar = callPackage ({ }:
makeSetupHook {
name = "to-nvim-treesitter-grammar";
} ./to-nvim-treesitter-grammar.sh) {};
in

toVimPlugin (runCommand "treesitter-grammar-${name}"
{
meta = {
platforms = lib.platforms.all;
} // grammar.meta;
}
''
mkdir -p "$out/parser"
ln -s "${grammar}/parser" "$out/parser/${name}.so"
mkdir -p "$out/queries/${name}"
if [ -d "${grammar}/queries/${name}" ]; then
echo "moving queries from neovim queries dir"
for file in "${grammar}/queries/${name}"*; do
ln -s "$file" "$out/queries/${name}/$(basename "$file")"
done
else
if [ -d "${grammar}/queries" ]; then
echo "moving queries from standard queries dir"
for file in "${grammar}/queries/"*; do
ln -s "$file" "$out/queries/${name}/$(basename "$file")"
done
else
echo "missing queries for ${name}"
fi
fi
'');
(toVimPlugin (stdenv.mkDerivation {
name = "treesitter-grammar-${name}";

origGrammar = grammar;
grammarName = name;

# Queries for nvim-treesitter's (not just tree-sitter's) officially
# supported languages are bundled with nvim-treesitter
# Queries from repositories for such languages are incompatible
# with nvim's implementation of treesitter.
#
# We try our best effort to only include queries for niche languages
# (there are grammars for them in nixpkgs, but they're in
# `tree-sitter-grammars.tree-sitter-*`; `vimPlugins.nvim-treesitter-parsers.*`
# only includes officially supported languages)
#
# To use grammar for a niche language, users usually do:
# packages.all.start = with final.vimPlugins; [
# (pkgs.neovimUtils.grammarToPlugin pkgs.tree-sitter-grammars.tree-sitter-LANG)
# ]
#
# See also https://github.com/NixOS/nixpkgs/pull/344849#issuecomment-2381447839
installQueries = !isNvimGrammar grammar;

dontUnpack = true;
__structuredAttrs = true;

nativeBuildInputs = [ toNvimTreesitterGrammar ];

meta = {
platforms = lib.platforms.all;
} // grammar.meta;
}));

/*
Fork of vimUtils.packDir that additionnally generates a propagated-build-inputs-file that
Expand Down
Loading

0 comments on commit b3a71c7

Please sign in to comment.