about summary refs log tree commit diff stats
path: root/flake/packages/merge.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-09 16:06:45 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-09 16:08:13 +0100
commita379b2765cd97a03c9b3a9a80180bbdcee2f5dcf (patch)
tree42f0f2ad0be1bbab8249e6dd52184f1eeb752a07 /flake/packages/merge.nix
parentfix(modules/nvim/options): Use shell binary, not only directory (diff)
downloadnixos-config-a379b2765cd97a03c9b3a9a80180bbdcee2f5dcf.tar.gz
nixos-config-a379b2765cd97a03c9b3a9a80180bbdcee2f5dcf.zip
fix(flake/packages): Re-add the `nvim` package
This implementation is by-far better than the previous one and avoids
a whole set of problems that came, with trying to re-implement the NixOS
module system.
Diffstat (limited to '')
-rw-r--r--flake/packages/merge.nix86
1 files changed, 0 insertions, 86 deletions
diff --git a/flake/packages/merge.nix b/flake/packages/merge.nix
deleted file mode 100644
index 43161ba0..00000000
--- a/flake/packages/merge.nix
+++ /dev/null
@@ -1,86 +0,0 @@
-{lib, ...}: let
-  merge = merge_list: let
-    head_of_merge = builtins.head merge_list;
-  in
-    if builtins.isAttrs head_of_merge
-    then
-      builtins.zipAttrsWith (
-        name: values: let
-          head_value = builtins.head values;
-        in
-          if builtins.isString head_value
-          then builtins.concatStringsSep "" values
-          else if builtins.isList head_value
-          then builtins.concatLists values
-          else if builtins.isAttrs head_value
-          then merge values
-          else builtins.head values
-      )
-      merge_list
-    else if builtins.isString head_of_merge
-    then builtins.concatStringsSep "" merge_list
-    else if builtins.isList head_of_merge
-    then builtins.concatLists merge_list
-    else builtins.head merge_list;
-
-  # Tests
-  ## Strings
-  a = {
-    a = ''
-      This is some
-    '';
-  };
-  b = {
-    a = ''
-      example text
-    '';
-  };
-  c = {
-    a = "(which is nice)";
-  };
-  ## Lists
-  d = {
-    a = ["element1" "element2"];
-  };
-  e = {
-    a = [["elment3" "elemnt4"]];
-  };
-  f = {
-    a = ["elemnt5"];
-  };
-  ## Pure strings
-  g = "This";
-  h = "is";
-  i = "some example text";
-  j = ''
-    (with a newline)
-  '';
-  ## Pure lists
-  k = ["element1"];
-  l = ["element2" "element3"];
-  m = ["element4"];
-
-  ## Prepared tests
-  tests = {
-    tests = []; # Comment to actually run the tests
-    test_strings = {
-      expr = merge [a b c];
-      expected = {a = "This is some\nexample text\n(which is nice)";};
-    };
-    test_lists = {
-      expr = merge [d e f];
-      expected = {a = ["element1" "element2" ["elment3" "elemnt4"] "elemnt5"];};
-    };
-    test_pure_strings = {
-      expr = merge [g h i j];
-      expected = "Thisissome example text(with a newline)\n";
-    };
-    test_pure_lists = {
-      expr = merge [k l m];
-      expected = ["element1" "element2" "element3" "element4"];
-    };
-  };
-in {
-  inherit merge;
-  result = lib.debug.runTests tests;
-}