diff --git a/krebs/2configs/ircd.nix b/krebs/2configs/ircd.nix index a802b8a25..5435ea166 100644 --- a/krebs/2configs/ircd.nix +++ b/krebs/2configs/ircd.nix @@ -8,6 +8,7 @@ services.ergochat = { enable = true; settings = { + server.name = "irc.r"; server.secure-nets = [ "42::0/16" "10.240.0.0/12" diff --git a/krebs/5pkgs/simple/git-assembler.nix b/krebs/5pkgs/simple/git-assembler.nix new file mode 100644 index 000000000..095dddf0f --- /dev/null +++ b/krebs/5pkgs/simple/git-assembler.nix @@ -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 + ''; +} diff --git a/lib/default.nix b/lib/default.nix index 149b97a72..280f04299 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -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 diff --git a/lib/haskell.nix b/lib/haskell.nix index 4f0ee05ab..f87cfa761 100644 --- a/lib/haskell.nix +++ b/lib/haskell.nix @@ -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 diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix index 466ff27c5..d80c46cbb 100644 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ b/tv/5pkgs/simple/alacritty-tv.nix @@ -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