Merge remote-tracking branch 'ni/master'

This commit is contained in:
lassulus 2022-12-27 22:55:20 +01:00
commit d34de27336
5 changed files with 58 additions and 3 deletions

View File

@ -8,6 +8,7 @@
services.ergochat = {
enable = true;
settings = {
server.name = "irc.r";
server.secure-nets = [
"42::0/16"
"10.240.0.0/12"

View File

@ -0,0 +1,24 @@
{ pkgs, stdenv }:
stdenv.mkDerivation rec {
pname = "git-assembler";
version = "1.3";
src = pkgs.fetchFromGitLab {
owner = "wavexx";
repo = "git-assembler";
rev = "v${version}";
hash = "sha256-A+ygt6Fxiu6EkVoQU5L1rhxu2e1HU0nbqJFzLzXzHBo=";
};
buildInputs = [
pkgs.python3
];
buildPhase = ":";
installPhase = ''
mkdir -p $out/bin
cp git-assembler $out/bin
'';
}

View File

@ -39,6 +39,8 @@ let
ne = x: y: x != y;
mod = x: y: x - y * (x / y);
on = b: u: x: y: b (u x) (u y);
genid = lib.genid_uint32; # TODO remove
genid_uint31 = x: ((lib.genid_uint32 x) + 16777216) / 2;
genid_uint32 = import ./genid.nix { inherit lib; };
@ -185,6 +187,30 @@ let
in
filter (x: x != []) ([acc.chunk] ++ acc.chunks);
# Filter adjacent duplicate elements.
uniq = uniqBy eq;
# Filter adjacent duplicate elements determined via the given function.
uniqBy = cmp: let
f = a: s:
if length s == 0 then
[]
else let
b = head s;
in
if cmp a b then
f b (tail s)
else
[b] ++ f b (tail s);
in
s:
if length s == 0 then
[]
else let
b = head s;
in
[b] ++ f b (tail s);
warnOldVersion = oldName: newName:
if compareVersions oldName newName != -1 then
trace "Upstream `${oldName}' gets overridden by `${newName}'." newName

View File

@ -39,7 +39,12 @@ rec {
in
if parse == null then
(pkgs.writeText name s).overrideAttrs (old: {
dependencies = old.dependencies or [] ++ dependencies;
dependencies =
lib.uniq
(lib.sort (lib.on lib.lessThan (lib.getAttr "name"))
(filter
(lib.ne null)
(old.dependencies or [] ++ dependencies)));
})
else

View File

@ -70,8 +70,7 @@ pkgs.symlinkJoin {
# Install stored configuration if it has changed.
# This allows for both declarative updates and runtime modifications.
${pkgs.coreutils}/bin/mkdir -p "$HOME"
ref=$(${pkgs.coreutils}/bin/cat "$HOME"/ref)
if test "$ref" != ${config-file}; then
if test "$(${pkgs.coreutils}/bin/cat "$HOME"/ref)" != ${config-file}; then
echo ${config-file} > "$HOME"/ref
${pkgs.coreutils}/bin/cp ${config-file} "$HOME"/.alacritty.yml
fi