Finish zims move and update vim config

Alter the vim-cmp bindings so that it's nicer to me and to selections
Finish updating the Zim packages with their hash values
This commit is contained in:
Greg Hellings
2024-10-12 17:32:32 -05:00
parent 7510136304
commit 26a10f1b86
3 changed files with 49 additions and 412 deletions
+37 -17
View File
@@ -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 = "<C-${key}>"; action = "<C-w>${key}<C-w><CR>"; };
winMove = key: {
mode = "n";
key = "<C-${key}>";
action = "<C-w>${key}<C-w><CR>";
};
in
[{
mode = "n";
key = "<C-e>";
action = "<Esc>:BufExplorer<CR>";
}
[
{
mode = "n";
key = "<C-e>";
action = "<Esc>:BufExplorer<CR>";
}
{
mode = "n";
key = "<C-t>";
@@ -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 = {
"<C-Space>" = "cmp.mapping.complete()";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.select_next_item()";
"<C-b>" = "cmp.mapping.select_prev_item()";
"<C-c>" = "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! <q-args> | 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
+11 -13
View File
@@ -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}
'';
}
+1 -382
View File
@@ -1,382 +1 @@
error:
<borked>
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:
<borked>
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:
<borked>
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:
<borked>
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:
<borked>
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:
<borked>
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:
<borked>
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:
<borked>
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:
<borked>
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:
<borked>
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:
<borked>
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:
<borked>
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:
<borked>
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:
<borked>
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:
<borked>
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:
<borked>
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:
<borked>
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="}}}