diff --git a/home/modules/baseline/vim/config.nix b/home/modules/baseline/vim/config.nix index 652b8cd..29035cb 100644 --- a/home/modules/baseline/vim/config.nix +++ b/home/modules/baseline/vim/config.nix @@ -1,4 +1,9 @@ -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: let vim-xonsh = pkgs.vimUtils.buildVimPlugin { name = "vim-xonsh"; @@ -46,13 +51,18 @@ in }; keymaps = let - winMove = key: { mode = "n"; key = ""; action = "${key}"; }; + winMove = key: { + mode = "n"; + key = ""; + action = "${key}"; + }; in - [{ - mode = "n"; - key = ""; - action = ":BufExplorer"; - } + [ + { + mode = "n"; + key = ""; + action = ":BufExplorer"; + } { mode = "n"; key = ""; @@ -67,7 +77,8 @@ in (winMove "h") (winMove "j") (winMove "k") - (winMove "l")]; + (winMove "l") + ]; plugins = { airline.enable = true; cmp = { @@ -76,15 +87,24 @@ in settings = { sources = [ { name = "nvim_lsp"; } - { name = "buffer"; group_index = 2; } - { name = "copilot-vim"; group_index = 2; } - { name = "path"; gruop_index = 3; } + { + name = "buffer"; + group_index = 2; + } + { + name = "copilot-vim"; + group_index = 2; + } + { + name = "path"; + gruop_index = 3; + } ]; mapping = { "" = "cmp.mapping.complete()"; "" = "cmp.mapping.confirm({ select = true })"; - "" = "cmp.mapping.scroll_docs(4)"; - "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.select_prev_item()"; "" = "cmp.mapping.abort()"; }; }; @@ -137,16 +157,16 @@ in }; neo-tree.enable = true; notify.enable = true; - } // (if (lib.versionAtLeast lib.version "24.11") then { - web-devicons.enable = true; - } else { }); + } // (if (lib.versionAtLeast lib.version "24.11") then { web-devicons.enable = true; } else { }); userCommands = { Ggr = { command = "Ggrep! | cw | redraw!"; nargs = "+"; }; }; - extraConfigLua = builtins.replaceStrings [ "@git@" ] [ "${pkgs.git}/bin/git" ] (builtins.readFile ./extra.lua); + extraConfigLua = builtins.replaceStrings [ "@git@" ] [ "${pkgs.git}/bin/git" ] ( + builtins.readFile ./extra.lua + ); extraConfigVim = builtins.readFile ./extra.vimrc; extraPlugins = with pkgs.vimPlugins; [ bufexplorer diff --git a/pkgs/zim.nix b/pkgs/zim.nix index cf8ac19..fa5ca1b 100644 --- a/pkgs/zim.nix +++ b/pkgs/zim.nix @@ -7,23 +7,21 @@ }: let inherit (lib.attrsets) mapAttrs mapAttrsRecursiveCond; - # Converts the inputs from the file into a fetchurl command + # Converts the inputs from the file into a fetchtorrent command zim = type: val: - fetchtorrent { - inherit (val) hash; + (fetchtorrent { + inherit (val) hash name; url = "https://download.kiwix.org/zim/${type}/${val.name}.torrent"; - curlOptsList = [ "-L" ]; - }; - # Uses the function above to convert the JSON into a structure of fetchurl derivations - zims = mapAttrs (_: types: (mapAttrs (type: hash: zim type hash) types)) ( - builtins.fromJSON (builtins.readFile ./zim/blobs.json) - ); - # Turns the fetchurl derivations into a list of strings, copying the results into a final output + }); + rawZims = builtins.fromJSON (builtins.readFile ./zim/blobs.json); + # Uses the function above to convert the JSON into a structure of fetchtorrent derivations + zims = mapAttrs (_: types: (mapAttrs (type: info: zim type info) types)) (rawZims); + # Turns the fetchtorrent derivations into a list of strings, copying the results into a final output copies = builtins.concatStringsSep "\n" ( lib.attrsets.collect builtins.isString ( mapAttrsRecursiveCond (as: !(lib.attrsets.isDerivation as)) # don't recurse derivations - (_: v: "cp ${v} $out/") # copy derivation to destination + (_: v: "ln -s ${v} $out/") # copy derivation to destination zims ) ); @@ -33,7 +31,7 @@ stdenv.mkDerivation { version = "2024-10"; passthru = { - inherit zims; + inherit zims rawZims; updater = (callPackage ./zim/updater.nix { }); }; @@ -42,6 +40,6 @@ stdenv.mkDerivation { # Collect all the zim files into a single folder derivation installPhase = '' mkdir -p $out - echo "${copies}" > $out/derp.txt + ${copies} ''; } diff --git a/pkgs/zim/blobs.json b/pkgs/zim/blobs.json index 827ca87..10072fd 100644 --- a/pkgs/zim/blobs.json +++ b/pkgs/zim/blobs.json @@ -1,382 +1 @@ -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -error: - … - - at «none»:0: (source not available) - - … in the left operand of the update (//) operator - - at /nix/store/3hh72ymqzdmlxzw39zgmadigibrqv7wl-nix-prefetch-0.4.1/lib/nix-prefetch/prelude.nix:3:46: - - 2| - 3| let prelude = with prelude; import ./lib.nix // { - | ^ - 4| fetcher = if orig.fetcher == null || elem orig.fetcher.type [ "file" "attr" ] - - (stack trace truncated; use '--show-trace' to show the full trace) - - error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override - -{ - "en": { - "wikipedia": { - "name": "wikipedia_en_all_maxi_2024-01.zim", - "hash": "" - }, - "wiktionary": { - "name": "wiktionary_en_all_nopic_2024-05.zim", - "hash": "" - }, - "wikiversity": { - "name": "wikiversity_en_all_maxi_2021-03.zim", - "hash": "" - }, - "wikibooks": { - "name": "wikibooks_en_all_maxi_2021-03.zim", - "hash": "" - }, - "wikisource": { - "name": "wikisource_en_all_maxi_2022-09.zim", - "hash": "" - }, - "phet": { - "name": "phet_en_all_2023-04.zim", - "hash": "" - }, - "gutenberg": { - "name": "gutenberg_en_all_2023-08.zim", - "hash": "" - } - }, - "fr": { - "wikipedia": { - "name": "wikipedia_fr_all_maxi_2024-05.zim", - "hash": "" - }, - "wiktionary": { - "name": "wiktionary_fr_all_nopic_2024-06.zim", - "hash": "" - }, - "wikiversity": { - "name": "wikiversity_fr_all_maxi_2021-02.zim", - "hash": "" - }, - "wikibooks": { - "name": "wikibooks_fr_all_maxi_2024-06.zim", - "hash": "" - }, - "wikisource": { - "name": "wikisource_fr_all_maxi_2022-04.zim", - "hash": "" - }, - "phet": { - "name": "phet_fr_all_2023-04.zim", - "hash": "" - }, - "gutenberg": { - "name": "gutenberg_fr_all_2023-08.zim", - "hash": "" - } - }, - "ht": { - "wikipedia": { - "name": "wikipedia_ht_all_maxi_2024-06.zim", - "hash": "" - }, - "wikisource": { - "name": "wikisource_ht_all_maxi_2019-03.zim", - "hash": "" - }, - "phet": { - "name": "phet_ht_all_2023-04.zim", - "hash": "" - } - } -} +{"en":{"gutenberg":{"name":"gutenberg_en_all_2023-08.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="},"phet":{"name":"phet_en_all_2023-04.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="},"wikibooks":{"name":"wikibooks_en_all_maxi_2021-03.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="},"wikipedia":{"name":"wikipedia_en_all_maxi_2024-01.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="},"wikisource":{"name":"wikisource_en_all_maxi_2022-09.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="},"wikiversity":{"name":"wikiversity_en_all_maxi_2021-03.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="},"wiktionary":{"name":"wiktionary_en_all_nopic_2024-05.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="}},"fr":{"gutenberg":{"name":"gutenberg_fr_all_2023-08.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="},"phet":{"name":"phet_fr_all_2023-04.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="},"wikibooks":{"name":"wikibooks_fr_all_maxi_2024-06.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="},"wikipedia":{"name":"wikipedia_fr_all_maxi_2024-05.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="},"wikisource":{"name":"wikisource_fr_all_maxi_2022-04.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="},"wikiversity":{"name":"wikiversity_fr_all_maxi_2021-02.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="},"wiktionary":{"name":"wiktionary_fr_all_nopic_2024-06.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="}},"ht":{"phet":{"name":"phet_ht_all_2023-04.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="},"wikipedia":{"name":"wikipedia_ht_all_maxi_2024-06.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="},"wikisource":{"name":"wikisource_ht_all_maxi_2019-03.zim","hash":"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="}}}