From 1537fea0bd3da339dfb41415dc7e8bb4e0b7ec55 Mon Sep 17 00:00:00 2001 From: Hung Date: Fri, 16 Jun 2023 16:12:54 -0700 Subject: [PATCH] wip: interface-like structure but im sadge on development with no type-safety --- docs/vim-plugins.md | 2 +- flake.lock | 199 ++--- native_configs/README.md | 11 +- native_configs/neovim/init.lua | 28 +- native_configs/starship/starship.toml | 5 + .../home-manager/base/darwin-spotlight.nix | 15 +- nix-conf/home-manager/base/graphics.nix | 2 +- nix-conf/home-manager/base/neovim.nix | 2 +- .../home-manager/base/private_chromium.nix | 1 + nix-conf/home-manager/base/shells.nix | 10 +- nix-conf/home-manager/flake.lock | 740 +++--------------- nix-conf/home-manager/flake.nix | 5 +- nix-conf/home-manager/overlays.nix | 6 - nix-conf/lib/serde/default.nix | 3 +- nix/cells/repo/home-modules.nix | 9 - nix/cells/repo/home-modules/default.nix | 241 ++++++ nix/cells/repo/home-modules/nixgl.nix | 40 + nix/cells/repo/home-modules/shells.nix | 121 +++ nix/cells/repo/home-profiles/default.nix | 60 ++ nix/cells/repo/home-profiles/neovim.nix | 181 +++++ nix/cells/repo/lib/default.nix | 35 + 21 files changed, 896 insertions(+), 820 deletions(-) delete mode 100644 nix/cells/repo/home-modules.nix create mode 100644 nix/cells/repo/home-modules/default.nix create mode 100644 nix/cells/repo/home-modules/nixgl.nix create mode 100644 nix/cells/repo/home-modules/shells.nix create mode 100644 nix/cells/repo/home-profiles/default.nix create mode 100644 nix/cells/repo/home-profiles/neovim.nix create mode 100644 nix/cells/repo/lib/default.nix diff --git a/docs/vim-plugins.md b/docs/vim-plugins.md index 2c10cc3..15ccabc 100644 --- a/docs/vim-plugins.md +++ b/docs/vim-plugins.md @@ -1,4 +1,4 @@ -# Vim Plugins +# Offset Vim Plugins onto nix packer The current [`scripts/vim.dsl`](../scripts/vim.dsl) grabs the upstream supported vim plugins onto a sqlite database to be stored in memory. We could perform some data exploration via this database diff --git a/flake.lock b/flake.lock index e9b7ce5..2a7e5b3 100644 --- a/flake.lock +++ b/flake.lock @@ -77,21 +77,18 @@ }, "devshell": { "inputs": { - "flake-utils": [ - "std", - "flake-utils" - ], "nixpkgs": [ "std", "nixpkgs" - ] + ], + "systems": "systems" }, "locked": { - "lastModified": 1682700442, - "narHash": "sha256-qjaAAcCYgp1pBBG7mY9z95ODUBZMtUpf0Qp3Gt/Wha0=", + "lastModified": 1686680692, + "narHash": "sha256-SsLZz3TDleraAiJq4EkmdyewSyiv5g0LZYc6vaLZOMQ=", "owner": "numtide", "repo": "devshell", - "rev": "fb6673fe9fe4409e3f43ca86968261e970918a83", + "rev": "fd6223370774dd9c33354e87a007004b5fd36442", "type": "github" }, "original": { @@ -117,10 +114,13 @@ }, "dmerge": { "inputs": { - "haumea": "haumea_2", - "namaka": "namaka", + "haumea": [ + "std", + "haumea" + ], "nixlib": [ "std", + "haumea", "nixpkgs" ], "yants": [ @@ -129,16 +129,16 @@ ] }, "locked": { - "lastModified": 1684178600, - "narHash": "sha256-EtSQcCHRQUBBEj4vbYU0vgPUYiKP261ero5k1QfQ3Bc=", + "lastModified": 1686862774, + "narHash": "sha256-ojGtRQ9pIOUrxsQEuEPerUkqIJEuod9hIflfNkY+9CE=", "owner": "divnix", "repo": "dmerge", - "rev": "ac9932f26325afac5baa59cf6478432d17762a4e", + "rev": "9f7f7a8349d33d7bd02e0f2b484b1f076e503a96", "type": "github" }, "original": { "owner": "divnix", - "ref": "0.2.0", + "ref": "0.2.1", "repo": "dmerge", "type": "github" } @@ -248,44 +248,19 @@ }, "haumea_2": { "inputs": { - "nixpkgs": [ - "std", - "dmerge", - "nixlib" - ] + "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1681176209, - "narHash": "sha256-bJLDun6esIyWtwRVXcsgzGbh4UKu8wJDrPgykqPyzmg=", + "lastModified": 1685133229, + "narHash": "sha256-FePm/Gi9PBSNwiDFq3N+DWdfxFq0UKsVVTJS3cQPn94=", "owner": "nix-community", "repo": "haumea", - "rev": "b915b66b27da3a595d77b139e945bb0a2fcac926", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "haumea", - "type": "github" - } - }, - "haumea_3": { - "inputs": { - "nixpkgs": [ - "std", - "paisano", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1681176209, - "narHash": "sha256-bJLDun6esIyWtwRVXcsgzGbh4UKu8wJDrPgykqPyzmg=", - "owner": "nix-community", - "repo": "haumea", - "rev": "b915b66b27da3a595d77b139e945bb0a2fcac926", + "rev": "34dd58385092a23018748b50f9b23de6266dffc2", "type": "github" }, "original": { "owner": "nix-community", + "ref": "v0.2.2", "repo": "haumea", "type": "github" } @@ -333,6 +308,7 @@ "inputs": { "nixlib": [ "std", + "haumea", "nixpkgs" ] }, @@ -362,11 +338,11 @@ ] }, "locked": { - "lastModified": 1677330646, - "narHash": "sha256-hUYCwJneMjnxTvj30Fjow6UMJUITqHlpUGpXMPXUJsU=", + "lastModified": 1685771919, + "narHash": "sha256-3lVKWrhNXjHJB6QkZ2SJaOs4X/mmYXtY6ovPVpDMOHc=", "owner": "nlewo", "repo": "nix2container", - "rev": "ebca8f58d450cae1a19c07701a5a8ae40afc9efc", + "rev": "95e2220911874064b5d809f8d35f7835184c4ddf", "type": "github" }, "original": { @@ -375,57 +351,6 @@ "type": "github" } }, - "namaka": { - "inputs": { - "haumea": [ - "std", - "dmerge", - "haumea" - ], - "nixpkgs": [ - "std", - "dmerge", - "nixlib" - ] - }, - "locked": { - "lastModified": 1683059428, - "narHash": "sha256-ZTMqleCWmuNWhZE375gtF1j1JRkaKEUFN1AM43e7h4Y=", - "owner": "nix-community", - "repo": "namaka", - "rev": "2deba2f416454aec770bc1cc7365e39c73e6b1d7", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "v0.1.1", - "repo": "namaka", - "type": "github" - } - }, - "namaka_2": { - "inputs": { - "haumea": [ - "std", - "paisano", - "haumea" - ], - "nixpkgs": "nixpkgs_5" - }, - "locked": { - "lastModified": 1681604203, - "narHash": "sha256-oA/fW/85GmSNprghgAnZi0XeVMvW9xVuCYprzPw2hz0=", - "owner": "nix-community", - "repo": "namaka", - "rev": "1550ddc025334cff2e8ec9021256473b2ffb27e5", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "namaka", - "type": "github" - } - }, "nixago": { "inputs": { "flake-utils": [ @@ -504,11 +429,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1686592866, - "narHash": "sha256-riGg89eWhXJcPNrQGcSwTEEm7CGxWC06oSX44hajeMw=", + "lastModified": 1686869522, + "narHash": "sha256-tbJ9B8WLCTnVP/LwESRlg0dII6Zyg2LmUU/mB9Lu98E=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0eeebd64de89e4163f4d3cf34ffe925a5cf67a05", + "rev": "7c67f006ea0e7d0265f16d7df07cc076fdffd91f", "type": "github" }, "original": { @@ -519,6 +444,21 @@ } }, "nixpkgs_4": { + "locked": { + "lastModified": 1681001314, + "narHash": "sha256-5sDnCLdrKZqxLPK4KA8+f4A3YKO/u6ElpMILvX0g72c=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "367c0e1086a4eb4502b24d872cea2c7acdd557f4", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs_5": { "locked": { "lastModified": 1675940568, "narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=", @@ -534,22 +474,6 @@ "type": "github" } }, - "nixpkgs_5": { - "locked": { - "lastModified": 1680758185, - "narHash": "sha256-sCVWwfnk7zEX8Z+OItiH+pcSklrlsLZ4TJTtnxAYREw=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "0e19daa510e47a40e06257e205965f3b96ce0ac9", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_6": { "locked": { "lastModified": 1677063315, @@ -695,8 +619,6 @@ }, "paisano_2": { "inputs": { - "haumea": "haumea_3", - "namaka": "namaka_2", "nixpkgs": [ "std", "nixpkgs" @@ -708,16 +630,16 @@ ] }, "locked": { - "lastModified": 1685757649, - "narHash": "sha256-gu21uo35i5OguZ5laGpqIFgVRcowbjvLn2mxSyNKZfQ=", + "lastModified": 1686862844, + "narHash": "sha256-m8l/HpRBJnZ3c0F1u0IyQ3nYGWE0R9V5kfORuqZPzgk=", "owner": "paisano-nix", "repo": "core", - "rev": "db53b8a8e2e3e557bf5ec5842b7a52ee5de04e87", + "rev": "6674b3d3577212c1eeecd30d62d52edbd000e726", "type": "github" }, "original": { "owner": "paisano-nix", - "ref": "0.1.0", + "ref": "0.1.1", "repo": "core", "type": "github" } @@ -786,6 +708,7 @@ "devshell": "devshell", "dmerge": "dmerge", "flake-utils": "flake-utils", + "haumea": "haumea_2", "incl": "incl", "makes": [ "std", @@ -797,18 +720,18 @@ ], "n2c": "n2c", "nixago": "nixago", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "paisano": "paisano_2", "paisano-mdbook-preprocessor": "paisano-mdbook-preprocessor", "paisano-tui": "paisano-tui", "yants": "yants_2" }, "locked": { - "lastModified": 1686337240, - "narHash": "sha256-JedAsyUIbSIhVrRWSl0R3lSWemVWsHg0w3MuzW7h4tg=", + "lastModified": 1686890041, + "narHash": "sha256-yLucgr7q8o63yJHLd5b5rF/h27ktYTQrn9rYxVxrs3E=", "owner": "divnix", "repo": "std", - "rev": "1bd99cec90a5cee8575f45dbc193d6dd860a5f35", + "rev": "8671b6892e45d795d7409940750832d68c929dcf", "type": "github" }, "original": { @@ -817,6 +740,21 @@ "type": "github" } }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "utils": { "locked": { "lastModified": 1667395993, @@ -858,15 +796,16 @@ "inputs": { "nixpkgs": [ "std", + "haumea", "nixpkgs" ] }, "locked": { - "lastModified": 1667096281, - "narHash": "sha256-wRRec6ze0gJHmGn6m57/zhz/Kdvp9HS4Nl5fkQ+uIuA=", + "lastModified": 1686863218, + "narHash": "sha256-kooxYm3/3ornWtVBNHM3Zh020gACUyFX2G0VQXnB+mk=", "owner": "divnix", "repo": "yants", - "rev": "d18f356ec25cb94dc9c275870c3a7927a10f8c3c", + "rev": "8f0da0dba57149676aa4817ec0c880fbde7a648d", "type": "github" }, "original": { diff --git a/native_configs/README.md b/native_configs/README.md index 63955ee..f2414b2 100644 --- a/native_configs/README.md +++ b/native_configs/README.md @@ -1,3 +1,12 @@ # Native configs -Contains all configurations that are written in their native language +Contains all configurations that are written in their native configuration language. + +## Why native language? + +- Easier portability +- Nix can read from [JSON](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-fromJSON), +[TOML](https://nixos.org/manual/nix/stable/release-notes/rl-2.6.html#release-26-2022-01-24). +- We have also managed to hack together a [fromYaml](./../nix-conf/lib/serde/default.nix), +though it will not work for strictly pure builds or bootstrapping builds. + diff --git a/native_configs/neovim/init.lua b/native_configs/neovim/init.lua index 38b72c8..d510a64 100644 --- a/native_configs/neovim/init.lua +++ b/native_configs/neovim/init.lua @@ -293,12 +293,19 @@ vim.api.nvim_create_user_command( -- telescope local fb_actions = require "telescope".extensions.file_browser.actions +local tel_actions = require("telescope.actions") +local tel_actionset = require("telescope.actions.set") + +local function term_height() + return vim.opt.lines:get() +end + require('telescope').setup { defaults = { mappings = { - i = { - [''] = false, - [''] = false, + n = { + [''] = function(prompt_bufnr) tel_actionset.shift_selection(prompt_bufnr, -math.floor(term_height() / 2)) end, + [''] = function(prompt_bufnr) tel_actionset.shift_selection(prompt_bufnr, math.floor(term_height() / 2)) end, }, }, }, @@ -361,13 +368,13 @@ end, { desc = '[F]ind [A]ll files' }) remap('n', 'fg', function() require('telescope.builtin').live_grep() -end, { desc = '[F]ind by [G]rep' }) +end, { desc = '[F]ind thru [G]rep' }) remap('n', 'fug', function() -- This relies on many factors: We use `rg` and that `-g '**/*'` effectively -- drops ignore rules like the default `.gitignore` rule. require('telescope.builtin').live_grep({ glob_pattern = '**/*' }) -end, { desc = '[F]ind by [u]nrestricted [G]rep' }) +end, { desc = '[F]ind thru [u]nrestricted [G]rep' }) remap('n', 'fb', function() require('telescope.builtin').buffers() @@ -427,7 +434,7 @@ end -- Close all tabs except the first one vim.api.nvim_set_keymap('n', 'x', ':tabdo if tabpagenr() > 1 | tabclose | endif', - { noremap = true, silent = true }) + { noremap = true, silent = true, desc = "Close all tabs except the first one", }) -- }}} @@ -749,7 +756,6 @@ local cmp_config = { entry_filter(entry, function(entry) if entry.source_name == "nvim_lsp" then log.debug('format:entry: ' .. vim.inspect(entry, { depth = 2 })) - end end) @@ -805,7 +811,7 @@ local cmp_config = { cmp.setup(vim.tbl_deep_extend("force", require('cmp.config.default')(), cmp_config)) -- set max autocomplete height. this prevents huge recommendations to take over the screen vim.o.pumheight = 15 -- 15/70 is good enough ratio for me. I generally go with 80-90 max height, though -vim.o.pumblend = 15 -- semi-transparent for the art, nothing too useful +vim.o.pumblend = 10 -- semi-transparent for the art, nothing too useful (neovim recommends 0-30) -- `/` cmdline search. cmp.setup.cmdline('/', { @@ -864,7 +870,10 @@ require("mason").setup({ }) require('mason-lspconfig').setup({ -- ensure_installed = servers, - ensure_installed = { "pylsp", "pyright", "tailwindcss", "svelte", "astro", "lua_ls", "tsserver" }, + ensure_installed = { + "pylsp", "pyright", "tailwindcss", "svelte", "astro", "lua_ls", "tsserver", + "ansiblels", "yamlls", "docker_compose_language_service", "jsonls", + }, automatic_installation = false, }) @@ -1206,7 +1215,6 @@ require('zk.commands').add("ZkGrep", function(match_ctor) if match_ctor == nil or match_ctor == '' then vim.fn.inputsave() grep_str = vim.fn.input('Grep string: >') - vim.fn.inputrestore() match = { match = grep_str } elseif type(match_ctor) == 'string' then match = { match = grep_str } diff --git a/native_configs/starship/starship.toml b/native_configs/starship/starship.toml index 14eaf5c..ab52873 100644 --- a/native_configs/starship/starship.toml +++ b/native_configs/starship/starship.toml @@ -3,6 +3,11 @@ [aws] symbol = " " +[c] +disabled = false +commmands = [ [ 'cc', '--version' ], [ 'gcc', '--version' ], [ 'clang', '--version' ] ] +detect_extensions = ["c", "h", "cc", "cpp", "hh", "hpp"] + [conda] symbol = " " diff --git a/nix-conf/home-manager/base/darwin-spotlight.nix b/nix-conf/home-manager/base/darwin-spotlight.nix index 6892fa3..800ffa9 100644 --- a/nix-conf/home-manager/base/darwin-spotlight.nix +++ b/nix-conf/home-manager/base/darwin-spotlight.nix @@ -1,12 +1,13 @@ -# This patch exists since Darwin's search bar requires solid apps and not -# symlinked -# TODO: QA -# - [x] works for base case -# - [x] works for repeated case -# - [ ] works after base case, then removed -# - [ ] works for repeated case, then removed { lib, pkgs, config, ... }: { + # This patch exists since Darwin's search bar requires solid apps and not + # symlinked + # TODO: QA + # - [x] works for base case + # - [x] works for repeated case + # - [ ] works after base case, then removed + # - [ ] works for repeated case, then removed + # Copy GUI apps to "~/Applications/Home Manager Apps" # Based on this comment: https://github.com/nix-community/home-manager/issues/1341#issuecomment-778820334 home.activation.patch-spotlight = diff --git a/nix-conf/home-manager/base/graphics.nix b/nix-conf/home-manager/base/graphics.nix index 646b720..71dfbae 100644 --- a/nix-conf/home-manager/base/graphics.nix +++ b/nix-conf/home-manager/base/graphics.nix @@ -30,7 +30,7 @@ in }; }; }; - # importing shells does not mean we're enabling everything, if we do mkDefault false + # NOTE: importing shells does not mean we're enabling everything, if we do mkDefault false # but the dilemma is, if the user import BOTH graphics.nix and shells.nix # they will also need to do `config.base.shells.enable` # generally, we want the behavior: import means enable diff --git a/nix-conf/home-manager/base/neovim.nix b/nix-conf/home-manager/base/neovim.nix index a040407..ab74aab 100644 --- a/nix-conf/home-manager/base/neovim.nix +++ b/nix-conf/home-manager/base/neovim.nix @@ -28,7 +28,7 @@ let pkgs.rnix-lsp # doesn't work, Mason just installs it using cargo pkgs.rust4cargo pkgs.nickel - pkgs.lsp-nls + pkgs.nls pkgs.go # doesn't work, Mason installs from runtime path diff --git a/nix-conf/home-manager/base/private_chromium.nix b/nix-conf/home-manager/base/private_chromium.nix index 6679332..981459e 100644 --- a/nix-conf/home-manager/base/private_chromium.nix +++ b/nix-conf/home-manager/base/private_chromium.nix @@ -21,6 +21,7 @@ in package = pkgs.ungoogled-chromium; extensions = let + # TODO: how about a chrome extension registry? mkChromiumExtForVersion = browserVersion: { id, sha256, extVersion, ... }: { inherit id; diff --git a/nix-conf/home-manager/base/shells.nix b/nix-conf/home-manager/base/shells.nix index 36b293e..5f85cc1 100644 --- a/nix-conf/home-manager/base/shells.nix +++ b/nix-conf/home-manager/base/shells.nix @@ -37,7 +37,6 @@ in }; }; config = myLib.mkIf cfg.enable { - xdg.configFile."starship.toml".source = "${proj_root.config.path}//starship/starship.toml"; # nix: Propagates the environment with packages and vars when enter (children of) # a directory with shell.nix-compatible and .envrc programs.direnv = { @@ -68,6 +67,15 @@ in programs.starship = { enable = true; enableZshIntegration = true; + settings = let + native = builtins.fromTOML (builtins.readFile "${proj_root.config.path}/starship/starship.toml"); + patch-nix = pkgs.lib.recursiveUpdate native ({ + c.commands = [ + ["nix" "run" "nixpkgs#clang" "--" "--version"] + ["nix" "run" "nixpkgs#gcc" "--" "--version"] + ]; + }); + in patch-nix; }; # Fuzzy finder. `fzf` for TUI, `fzf -f ''` for UNIX piping programs.fzf.enable = true; diff --git a/nix-conf/home-manager/flake.lock b/nix-conf/home-manager/flake.lock index c55775b..7a5c2ea 100644 --- a/nix-conf/home-manager/flake.lock +++ b/nix-conf/home-manager/flake.lock @@ -1,21 +1,5 @@ { "nodes": { - "advisory-db": { - "flake": false, - "locked": { - "lastModified": 1684292571, - "narHash": "sha256-OpCnswRyIATPNoiQR4O7jE7iAyI9dekG7HfYhgZI3aI=", - "owner": "rustsec", - "repo": "advisory-db", - "rev": "0e97e6e71f0dd52b4b4e0ab3fa6e5e5dd72f852a", - "type": "github" - }, - "original": { - "owner": "rustsec", - "repo": "advisory-db", - "type": "github" - } - }, "blank": { "locked": { "lastModified": 1625557891, @@ -51,58 +35,9 @@ "inputs": { "flake-compat": "flake-compat_4", "flake-utils": "flake-utils_4", - "nixpkgs": [ - "nickel", - "nixpkgs" - ], + "nixpkgs": "nixpkgs_3", "rust-overlay": "rust-overlay" }, - "locked": { - "lastModified": 1686186025, - "narHash": "sha256-SuQjKsO1G87qM5j8VNtq6kIw4ILYE03Y8yL/FoKwR+4=", - "owner": "ipetkov", - "repo": "crane", - "rev": "057d95721ee67d421391dda7031977d247ddec28", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "crane_2": { - "inputs": { - "flake-compat": "flake-compat_6", - "flake-utils": "flake-utils_6", - "nixpkgs": [ - "nickel", - "topiary", - "nixpkgs" - ], - "rust-overlay": "rust-overlay_3" - }, - "locked": { - "lastModified": 1684468982, - "narHash": "sha256-EoC1N5sFdmjuAP3UOkyQujSOT6EdcXTnRw8hPjJkEgc=", - "owner": "ipetkov", - "repo": "crane", - "rev": "99de890b6ef4b4aab031582125b6056b792a4a30", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "crane_3": { - "inputs": { - "flake-compat": "flake-compat_7", - "flake-utils": "flake-utils_9", - "nixpkgs": "nixpkgs_5", - "rust-overlay": "rust-overlay_5" - }, "locked": { "lastModified": 1681680516, "narHash": "sha256-EB8Adaeg4zgcYDJn9sR6UMjN/OHdIiMMK19+3LmmXQY=", @@ -117,17 +52,17 @@ "type": "github" } }, - "crane_4": { + "crane_2": { "inputs": { - "flake-compat": "flake-compat_9", - "flake-utils": "flake-utils_13", + "flake-compat": "flake-compat_6", + "flake-utils": "flake-utils_8", "nixpkgs": [ "nix-boost", "std", "paisano-mdbook-preprocessor", "nixpkgs" ], - "rust-overlay": "rust-overlay_7" + "rust-overlay": "rust-overlay_3" }, "locked": { "lastModified": 1676162383, @@ -199,7 +134,7 @@ }, "fenix": { "inputs": { - "nixpkgs": "nixpkgs_10", + "nixpkgs": "nixpkgs_8", "rust-analyzer-src": "rust-analyzer-src" }, "locked": { @@ -309,54 +244,6 @@ "type": "github" } }, - "flake-compat_7": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_8": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_9": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -438,88 +325,7 @@ }, "flake-utils_10": { "inputs": { - "systems": "systems_7" - }, - "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_11": { - "inputs": { - "systems": "systems_8" - }, - "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_12": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_13": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_14": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_15": { - "inputs": { - "systems": "systems_9" + "systems": "systems_4" }, "locked": { "lastModified": 1681202837, @@ -566,15 +372,12 @@ } }, "flake-utils_4": { - "inputs": { - "systems": "systems_2" - }, "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", "owner": "numtide", "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", "type": "github" }, "original": { @@ -585,14 +388,14 @@ }, "flake-utils_5": { "inputs": { - "systems": "systems_3" + "systems": "systems_2" }, "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", "owner": "numtide", "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", "type": "github" }, "original": { @@ -603,7 +406,7 @@ }, "flake-utils_6": { "inputs": { - "systems": "systems_4" + "systems": "systems_3" }, "locked": { "lastModified": 1681202837, @@ -620,15 +423,12 @@ } }, "flake-utils_7": { - "inputs": { - "systems": "systems_5" - }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "owner": "numtide", "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", "type": "github" }, "original": { @@ -638,15 +438,12 @@ } }, "flake-utils_8": { - "inputs": { - "systems": "systems_6" - }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { @@ -657,11 +454,11 @@ }, "flake-utils_9": { "locked": { - "lastModified": 1678901627, - "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "owner": "numtide", "repo": "flake-utils", - "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", "type": "github" }, "original": { @@ -694,28 +491,6 @@ "type": "github" } }, - "gitignore_2": { - "inputs": { - "nixpkgs": [ - "nickel", - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, "gnmic": { "flake": false, "locked": { @@ -734,7 +509,7 @@ }, "gomod2nix": { "inputs": { - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_4", "utils": "utils" }, "locked": { @@ -811,26 +586,6 @@ "type": "github" } }, - "home-manager": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1686852570, - "narHash": "sha256-Hzufya/HxjSliCwpuLJCGY0WCQajzcpsnhFGa+TCkCM=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "4e09c83255c5b23d58714d56672d3946faf1bcef", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, "incl": { "inputs": { "nixlib": [ @@ -943,39 +698,16 @@ "type": "github" } }, - "nickel": { - "inputs": { - "crane": "crane", - "flake-utils": "flake-utils_5", - "nixpkgs": "nixpkgs_3", - "pre-commit-hooks": "pre-commit-hooks", - "rust-overlay": "rust-overlay_2", - "topiary": "topiary" - }, - "locked": { - "lastModified": 1686837312, - "narHash": "sha256-/izfKcPXT/Y4N8zgAncPp7ov5Qb39J3p74FaNsLUk/c=", - "owner": "tweag", - "repo": "nickel", - "rev": "6f424fd5f8e9c5bcdc07d855427d3dce14cd247e", - "type": "github" - }, - "original": { - "owner": "tweag", - "repo": "nickel", - "type": "github" - } - }, "nix-boost": { "inputs": { "cargo-leptos": "cargo-leptos", - "crane": "crane_3", - "flake-compat": "flake-compat_8", + "crane": "crane", + "flake-compat": "flake-compat_5", "gnmic": "gnmic", "gomod2nix": "gomod2nix", - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_5", "poetry2nix": "poetry2nix", - "rust-overlay": "rust-overlay_6", + "rust-overlay": "rust-overlay_2", "std": "std" }, "locked": { @@ -1015,21 +747,6 @@ "type": "github" } }, - "nix-filter": { - "locked": { - "lastModified": 1681154353, - "narHash": "sha256-MCJ5FHOlbfQRFwN0brqPbCunLEVw05D/3sRVoNVt2tI=", - "owner": "numtide", - "repo": "nix-filter", - "rev": "f529f42792ade8e32c4be274af6b6d60857fbee7", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "nix-filter", - "type": "github" - } - }, "nix-index-database": { "inputs": { "nixpkgs": [ @@ -1084,8 +801,8 @@ }, "nixgl": { "inputs": { - "flake-utils": "flake-utils_14", - "nixpkgs": "nixpkgs_11" + "flake-utils": "flake-utils_9", + "nixpkgs": "nixpkgs_9" }, "locked": { "lastModified": 1, @@ -1116,11 +833,11 @@ }, "nixpkgs-latest": { "locked": { - "lastModified": 1686856014, - "narHash": "sha256-3V2uo9xR7jMJLimzVGj7DO7qYwvZbf02UaXFIP3k0IE=", + "lastModified": 1686940302, + "narHash": "sha256-hTBVlV53sfi7ZyTkRKIVZy3V26ixnWGZnYrHvb9rCZU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "7a53daed2a71fd4b7b177bc48f2f9c996a5bb4b2", + "rev": "1f5b5df0d309144d10d409d161b50adc94157ef6", "type": "github" }, "original": { @@ -1163,29 +880,13 @@ "type": "github" } }, - "nixpkgs-stable_2": { - "locked": { - "lastModified": 1685801374, - "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_10": { "locked": { - "lastModified": 1677063315, - "narHash": "sha256-qiB4ajTeAOVnVSAwCNEEkoybrAlA+cpeiBxLobHndE8=", + "lastModified": 1686869522, + "narHash": "sha256-tbJ9B8WLCTnVP/LwESRlg0dII6Zyg2LmUU/mB9Lu98E=", "owner": "nixos", "repo": "nixpkgs", - "rev": "988cc958c57ce4350ec248d2d53087777f9e1949", + "rev": "7c67f006ea0e7d0265f16d7df07cc076fdffd91f", "type": "github" }, "original": { @@ -1196,37 +897,6 @@ } }, "nixpkgs_11": { - "locked": { - "lastModified": 1660551188, - "narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_12": { - "locked": { - "lastModified": 1686592866, - "narHash": "sha256-riGg89eWhXJcPNrQGcSwTEEm7CGxWC06oSX44hajeMw=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "0eeebd64de89e4163f4d3cf34ffe925a5cf67a05", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_13": { "locked": { "lastModified": 1681358109, "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", @@ -1259,37 +929,6 @@ } }, "nixpkgs_3": { - "locked": { - "lastModified": 1686412476, - "narHash": "sha256-inl9SVk6o5h75XKC79qrDCAobTD1Jxh6kVYTZKHzewA=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "21951114383770f96ae528d0ae68824557768e81", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-unstable", - "type": "indirect" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1681358109, - "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_5": { "locked": { "lastModified": 1680487167, "narHash": "sha256-9FNIqrxDZgSliGGN2XJJSvcDYmQbgOANaZA4UWnTdg4=", @@ -1305,7 +944,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_4": { "locked": { "lastModified": 1658285632, "narHash": "sha256-zRS5S/hoeDGUbO+L95wXG9vJNwsSYcl93XiD0HQBXLk=", @@ -1321,7 +960,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_5": { "locked": { "lastModified": 1682526928, "narHash": "sha256-2cKh4O6t1rQ8Ok+v16URynmb0rV7oZPEbXkU0owNLQs=", @@ -1337,7 +976,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_6": { "locked": { "lastModified": 1681358109, "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", @@ -1353,7 +992,7 @@ "type": "github" } }, - "nixpkgs_9": { + "nixpkgs_7": { "locked": { "lastModified": 1675940568, "narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=", @@ -1369,6 +1008,37 @@ "type": "github" } }, + "nixpkgs_8": { + "locked": { + "lastModified": 1677063315, + "narHash": "sha256-qiB4ajTeAOVnVSAwCNEEkoybrAlA+cpeiBxLobHndE8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "988cc958c57ce4350ec248d2d53087777f9e1949", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_9": { + "locked": { + "lastModified": 1660551188, + "narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, "nosys": { "locked": { "lastModified": 1668010795, @@ -1437,7 +1107,7 @@ }, "paisano-mdbook-preprocessor": { "inputs": { - "crane": "crane_4", + "crane": "crane_2", "fenix": "fenix", "nixpkgs": [ "nix-boost", @@ -1493,7 +1163,7 @@ }, "poetry2nix": { "inputs": { - "flake-utils": "flake-utils_10", + "flake-utils": "flake-utils_5", "nixpkgs": [ "nix-boost", "nixpkgs" @@ -1513,34 +1183,6 @@ "type": "github" } }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat_5", - "flake-utils": [ - "nickel", - "flake-utils" - ], - "gitignore": "gitignore_2", - "nixpkgs": [ - "nickel", - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable_2" - }, - "locked": { - "lastModified": 1686213770, - "narHash": "sha256-Re6xXLEqQ/HRnThryumyGzEf3Uv0Pl4cuG50MrDofP8=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "182af51202998af5b64ddecaa7ff9be06425399b", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "pre-commit-hooks-nix": { "inputs": { "flake-compat": "flake-compat_3", @@ -1572,16 +1214,17 @@ "inputs": { "flake-compat": "flake-compat", "flake-utils": "flake-utils", - "home-manager": "home-manager", + "home-manager": [ + "nixpkgs" + ], "kpcli-py": "kpcli-py", "neovim-nightly-overlay": "neovim-nightly-overlay", - "nickel": "nickel", "nix-boost": "nix-boost", "nix-index-database": "nix-index-database", "nixgl": "nixgl", - "nixpkgs": "nixpkgs_12", + "nixpkgs": "nixpkgs_10", "nixpkgs-latest": "nixpkgs-latest", - "rust-overlay": "rust-overlay_8" + "rust-overlay": "rust-overlay_4" } }, "rust-analyzer-src": { @@ -1602,106 +1245,6 @@ } }, "rust-overlay": { - "inputs": { - "flake-utils": [ - "nickel", - "crane", - "flake-utils" - ], - "nixpkgs": [ - "nickel", - "crane", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1685759304, - "narHash": "sha256-I3YBH6MS3G5kGzNuc1G0f9uYfTcNY9NYoRc3QsykLk4=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "c535b4f3327910c96dcf21851bbdd074d0760290", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "rust-overlay_2": { - "inputs": { - "flake-utils": [ - "nickel", - "flake-utils" - ], - "nixpkgs": [ - "nickel", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1686364106, - "narHash": "sha256-h4gCQg+jizmAbdg6UPlhxQVk4A7Ar/zoLa0wx3wBya0=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "ba011dd1c5028dbb880bc3b0f427e0ff689e6203", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "rust-overlay_3": { - "inputs": { - "flake-utils": [ - "nickel", - "topiary", - "crane", - "flake-utils" - ], - "nixpkgs": [ - "nickel", - "topiary", - "crane", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1683080331, - "narHash": "sha256-nGDvJ1DAxZIwdn6ww8IFwzoHb2rqBP4wv/65Wt5vflk=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "d59c3fa0cba8336e115b376c2d9e91053aa59e56", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "rust-overlay_4": { - "inputs": { - "flake-utils": "flake-utils_8", - "nixpkgs": "nixpkgs_4" - }, - "locked": { - "lastModified": 1684808436, - "narHash": "sha256-WG5LgB1+Oguj4H4Bpqr5GoLSc382LyGlaToiOw5xhwA=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "a227d4571dd1f948138a40ea8b0d0c413eefb44b", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "rust-overlay_5": { "inputs": { "flake-utils": [ "nix-boost", @@ -1728,10 +1271,10 @@ "type": "github" } }, - "rust-overlay_6": { + "rust-overlay_2": { "inputs": { - "flake-utils": "flake-utils_11", - "nixpkgs": "nixpkgs_8" + "flake-utils": "flake-utils_6", + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1682561982, @@ -1747,7 +1290,7 @@ "type": "github" } }, - "rust-overlay_7": { + "rust-overlay_3": { "inputs": { "flake-utils": [ "nix-boost", @@ -1778,17 +1321,17 @@ "type": "github" } }, - "rust-overlay_8": { + "rust-overlay_4": { "inputs": { - "flake-utils": "flake-utils_15", - "nixpkgs": "nixpkgs_13" + "flake-utils": "flake-utils_10", + "nixpkgs": "nixpkgs_11" }, "locked": { - "lastModified": 1686795910, - "narHash": "sha256-jDa40qRZ0GRQtP9EMZdf+uCbvzuLnJglTUI2JoHfWDc=", + "lastModified": 1686882360, + "narHash": "sha256-6iWVGIdIzmx/CgXPVLPyyxxBhPGYMl8sG09S8hpQ6pc=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "5c2b97c0a9bc5217fc3dfb1555aae0fb756d99f9", + "rev": "b519b1d7a31f1bd35423990398adecc6f7dd4dd2", "type": "github" }, "original": { @@ -1807,7 +1350,7 @@ "blank": "blank", "devshell": "devshell", "dmerge": "dmerge", - "flake-utils": "flake-utils_12", + "flake-utils": "flake-utils_7", "incl": "incl", "makes": [ "nix-boost", @@ -1821,7 +1364,7 @@ ], "n2c": "n2c", "nixago": "nixago", - "nixpkgs": "nixpkgs_9", + "nixpkgs": "nixpkgs_7", "paisano": "paisano", "paisano-mdbook-preprocessor": "paisano-mdbook-preprocessor", "paisano-tui": "paisano-tui", @@ -1901,107 +1444,6 @@ "type": "github" } }, - "systems_5": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_6": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_7": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_8": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_9": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "topiary": { - "inputs": { - "advisory-db": "advisory-db", - "crane": "crane_2", - "flake-utils": "flake-utils_7", - "nix-filter": "nix-filter", - "nixpkgs": [ - "nickel", - "nixpkgs" - ], - "rust-overlay": "rust-overlay_4" - }, - "locked": { - "lastModified": 1686167925, - "narHash": "sha256-2OU00zeoIS2jFBdXKak1Y2txC6IXEP0LsIUKSvr0qbc=", - "owner": "tweag", - "repo": "topiary", - "rev": "61d076c216422af7f865e2ade3bbdb4729e767ef", - "type": "github" - }, - "original": { - "owner": "tweag", - "repo": "topiary", - "type": "github" - } - }, "utils": { "locked": { "lastModified": 1653893745, diff --git a/nix-conf/home-manager/flake.nix b/nix-conf/home-manager/flake.nix index 5ec6ea5..cdb25ae 100644 --- a/nix-conf/home-manager/flake.nix +++ b/nix-conf/home-manager/flake.nix @@ -18,7 +18,8 @@ nixpkgs-latest.url = "github:nixos/nixpkgs"; home-manager = { url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; + # url = "github:pegasust/home-manager/starship-config-type"; + follows = "nixpkgs"; }; flake-utils.url = "github:numtide/flake-utils"; nixgl.url = "path:./../../out-of-tree/nixGL"; @@ -40,7 +41,6 @@ url = "github:mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; }; - nickel.url = "github:tweag/nickel"; }; outputs = @@ -51,7 +51,6 @@ , flake-utils , kpcli-py , neovim-nightly-overlay - , nickel , nix-boost , nixpkgs-latest , ... diff --git a/nix-conf/home-manager/overlays.nix b/nix-conf/home-manager/overlays.nix index c873730..59db437 100644 --- a/nix-conf/home-manager/overlays.nix +++ b/nix-conf/home-manager/overlays.nix @@ -3,7 +3,6 @@ flake_input@{ kpcli-py , rust-overlay , neovim-nightly-overlay , system -, nickel , nix-boost , nixpkgs-latest , ... @@ -60,10 +59,6 @@ let rust4normi = nightlyRustWithExts rust-default-components; }); - nickel = (final: prev: { - inherit (flake_input.nickel.packages.${system}) - lsp-nls nickel nickelWasm; - }); vimPlugins = (final: prev: { inherit (nixpkgs-latest.legacyPackages.${system}) vimPlugins; @@ -76,6 +71,5 @@ in neovim-nightly-overlay.overlay rust kpcli-py - nickel vimPlugins ] diff --git a/nix-conf/lib/serde/default.nix b/nix-conf/lib/serde/default.nix index b4c9299..b734f4c 100644 --- a/nix-conf/lib/serde/default.nix +++ b/nix-conf/lib/serde/default.nix @@ -26,5 +26,6 @@ in ( builtins.readFile yamlPath) "any-output.json")); - # TODO: fromToml? + fromTOML = builtins.fromTOML; + fromJSON = builtins.fromJSON; } diff --git a/nix/cells/repo/home-modules.nix b/nix/cells/repo/home-modules.nix deleted file mode 100644 index 73e8273..0000000 --- a/nix/cells/repo/home-modules.nix +++ /dev/null @@ -1,9 +0,0 @@ -{inputs, cell}: { - nerd_font_module = {config, pkgs, ...}: { - fonts.fontconfig.enable = true; - home.packages = [ - (pkgs.nerdfonts.override { fonts = [ "Hack" ]; }) - ]; - base.alacritty.font.family = "Hack Nerd Font Mono"; - }; -} diff --git a/nix/cells/repo/home-modules/default.nix b/nix/cells/repo/home-modules/default.nix new file mode 100644 index 0000000..77286c3 --- /dev/null +++ b/nix/cells/repo/home-modules/default.nix @@ -0,0 +1,241 @@ +# This is an interface for home-profiles and should not contain opinionated +# configurations. It should provide alternative configurations, aggregates +# or new configurations +_imports@{inputs, cell}: let + namespace = "repo"; + imports = _imports // {inherit namespace;}; +in { + git = { config , lib , ... }: let + cfg = config."${namespace}".git; + baseAliases = { + a = "add"; + c = "commit"; + ca = "commit --amend"; + cm = "commit -m"; + lol = "log --graph --decorate --pretty=oneline --abbrev-commit"; + lola = "log --graph --decorate --pretty=oneline --abbrev-commit --all"; + sts = "status"; + co = "checkout"; + b = "branch"; + }; + default-user = "Pegasust"; + default-email = "pegasucksgg@gmail.com"; + in { + options."${namespace}".git = { + aliases = lib.mkOption { + type = lib.types.attrs; + default = { }; + example = baseAliases; + description = '' + Additional git aliases. This settings comes with base configuration. + Redeclaring the base config will override the values. + ''; # TODO: Add baseAliases as string here (builtins.toString doesn't work) + }; + name = lib.mkOption { + type = lib.types.str; + default = default-user; + description = "Git username that appears on commits"; + example = default-user; + }; + email = lib.mkOption { + type = lib.types.str; + default = default-email; + example = default-email; + description = "Git email that appears on commits"; + }; + ignores = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ + ".vscode" # vscode settings + ".direnv" # .envrc cached outputs + ".DS_Store" # MacOS users, amrite + ]; + description = '' + .gitignore patterns that are applied in every "${namespace}"sitory. + This is useful for IDE-specific settings. + ''; + example = [ ".direnv" "node_modules" ]; + }; + enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Enables git + ''; + example = false; + }; + credentialCacheTimeoutSeconds = lib.mkOption { + type = lib.types.int; + default = 3000; + description = "Credential cache (in-memory store) for Git in seconds."; + example = 3000; + }; + }; + # TODO : anyway to override configuration? + # idk wtf I was thinking about. there is no context in this question + config.programs.git = { + inherit (cfg) enable ignores; + userName = cfg.name; + userEmail = cfg.email; + aliases = baseAliases // cfg.aliases; + extraConfig = { + # TODO: in the case of darwin, git always open up the built-in keychain. + # possibly something we can't really control since we don't have access to `nix-darwin` + credential.helper = "cache --timeout=${builtins.toString cfg.credentialCacheTimeoutSeconds}"; + }; + lfs.enable = true; + }; + }; + + alacritty = {config, lib}: let + inherit (inputs.cells.repo.lib) fromYAML; + cfg = config."${namespace}".alacritty; + in { + options."${namespace}".alacritty = { + font.family = lib.mkOption { + type = lib.types.nullOr lib.types.singleLineStr; + default = null; + description = '' + The font family for Alacritty + ''; + example = "DroidSansMono NF"; + }; + font.size = lib.mkOption { + type = lib.types.nullOr lib.types.number; + default = null; + description = '' + The default font size for Alacritty. This is probably measured in px. + ''; + example = 7.0; + }; + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Enables alacritty + ''; + example = true; + }; + config-file = lib.mkOption { + type = lib.types.path; + description = "Path to alacritty yaml"; + default = null; + example = "./config/alacritty.yaml"; + }; + }; + config.programs.alacritty = { + enable = cfg.enable; + settings = let ; + actualConfig = if cfg.config-file != null then fromYAML (builtins.readFile cfg.config-file) else {}; + in lib.recursiveUpdate actualConfig { + font.normal.family = opt-toNullable(opt-leftmostSome (builtins.map opt-fromNullable [ + cfg.font.family actualConfig.font.family actualConfig.font.normal.family + ])); + font.size = cfg.font.size or actualConfig.font.size or 7.0; + }; + }; + }; + + # TODO: chromium is not really supported on darwin + private_chromium = { config, pkgs, lib, ... }: let + cfg = config."${namespace}".private_chromium; + in { + options."${namespace}".private_chromium = { + enable = lib.mkOption { + type = lib.types.bool; + default = true; + example = false; + description = '' + Enable extremely lightweight chromium with vimium plugin + ''; + }; + }; + config = lib.mkIf (cfg.enable) { + # home.packages = [pkgs.ungoogled-chromium]; + programs.chromium = { + enable = true; + package = pkgs.ungoogled-chromium; + extensions = + let + # TODO: how about a chrome extension registry? + mkChromiumExtForVersion = browserVersion: { id, sha256, extVersion, ... }: + { + inherit id; + crxPath = builtins.fetchurl { + url = "https://clients2.google.com/service/update2/crx" + + "?response=redirect" + + "&acceptformat=crx2,crx3" + + "&prodversion=${browserVersion}" + + "&x=id%3D${id}%26installsource%3Dondemand%26uc"; + name = "${id}.crx"; + inherit sha256; + }; + version = extVersion; + }; + mkChromiumExt = mkChromiumExtForVersion (lib.versions.major pkgs.ungoogled-chromium.version); + in + [ + # vimium + (mkChromiumExt { + id = "dbepggeogbaibhgnhhndojpepiihcmeb"; + sha256 = "00qhbs41gx71q026xaflgwzzridfw1sx3i9yah45cyawv8q7ziic"; + extVersion = "1.67.4"; + }) + ]; + }; + }; + }; + + darwin-spotlight = { lib, pkgs, config, ... }: { + # This patch exists since Darwin's search bar requires solid apps and not + # symlinked + # TODO: QA + # - [x] works for base case + # - [x] works for repeated case + # - [ ] works after base case, then removed + # - [ ] works for repeated case, then removed + + # Copy GUI apps to "~/Applications/Home Manager Apps" + # Based on this comment: https://github.com/nix-community/home-manager/issues/1341#issuecomment-778820334 + home.activation.patch-spotlight = + if pkgs.stdenv.isDarwin then + let + apps = pkgs.buildEnv { + name = "home-manager-applications"; + paths = config.home.packages; + pathsToLink = "/Applications"; + }; + in + lib.hm.dag.entryAfter [ "linkGeneration" ] '' + # Install MacOS applications to the user environment. + HM_APPS="$HOME/Applications/Home Manager Apps" + # Reset current state + if [ -e "$HM_APPS" ]; then + $DRY_RUN_CMD mv "$HM_APPS" "$HM_APPS.$(date +%Y%m%d%H%M%S)" + fi + $DRY_RUN_CMD mkdir -p "$HM_APPS" + # .app dirs need to be actual directories for Finder to detect them as Apps. + # In the env of Apps we build, the .apps are symlinks. We pass all of them as + # arguments to cp and make it dereference those using -H + $DRY_RUN_CMD cp --archive -H --dereference ${apps}/Applications/* "$HM_APPS" + $DRY_RUN_CMD chmod +w -R "$HM_APPS" + '' + else + ""; + # We need this in case upstream home-manager changes the behavior of linking + # applications + home.activation.remove-patch-spotlight = + if pkgs.stdenv.isDarwin then + lib.hm.dag.entryBefore [ "checkLinkTargets" ] '' + HM_APPS="$HOME/Applications/Home Manager Apps" + # Reset current state + if [ -e "$HM_APPS" ]; then + $DRY_RUN_CMD mv "$HM_APPS" "$HM_APPS.$(date +%Y%m%d%H%M%S)" + fi + '' + else + ""; + }; + +} + diff --git a/nix/cells/repo/home-modules/nixgl.nix b/nix/cells/repo/home-modules/nixgl.nix new file mode 100644 index 0000000..6ee8452 --- /dev/null +++ b/nix/cells/repo/home-modules/nixgl.nix @@ -0,0 +1,40 @@ +{inputs, cell, namespace}: { pkgs, config, lib, ... }: +let + cfg = config."${namespace}".graphics; + cfgEnable = cfg.enable or (cfg.useNixGL.defaultPackage != null); + types = lib.types; +in +{ + imports = [ ./shells.nix ]; + options."${namespace}".nixgl = { + enable = lib.mkEnableOption "nixgl"; + useNixGL = { + package = lib.mkPackageOption pkgs "nixGL package" { + default = [ + "nixgl" + "auto" + "nixGLDefault" + ]; + }; + defaultPackage = lib.mkOption { + type = types.nullOr (types.enum [ "nixGLIntel" "nixGLNvidia" "nixGLNvidiaBumblebee" ]); + description = "Which nixGL package to be aliased as `nixGL` on the shell"; + default = null; + example = "nixGLIntel"; + }; + }; + }; + # NOTE: importing shells does not mean we're enabling everything, if we do mkDefault false + # but the dilemma is, if the user import BOTH graphics.nix and shells.nix + # they will also need to do `config."${namespace}".shells.enable` + # generally, we want the behavior: import means enable + config = lib.mkIf cfgEnable { + "${namespace}".graphics._enable = lib.mkForce true; + "${namespace}".shells = { + shellAliases = lib.mkIf (cfg.useNixGL.defaultPackage != null) { + nixGL = cfg.useNixGL.defaultPackage; + }; + }; + home.packages = [ cfg.useNixGL.package ]; + }; +} diff --git a/nix/cells/repo/home-modules/shells.nix b/nix/cells/repo/home-modules/shells.nix new file mode 100644 index 0000000..e3ed1a2 --- /dev/null +++ b/nix/cells/repo/home-modules/shells.nix @@ -0,0 +1,121 @@ +{inputs, cell, namespace}: { config +, lib +, pkgs +, ... +}: +let cfg = config."${namespace}".shells; +in +{ + options."${namespace}".shells = { + enable = lib.mkOption { + type = lib.types.bool; + description = "Enable umbrella shell configuration"; + default = true; + example = false; + }; + shellInitExtra = lib.mkOption { + type = lib.types.str; + description = "Extra shell init. The syntax should be sh-compliant"; + default = ""; + example = '' + # X11 support for WSL + export DISPLAY=$(ip route list default | awk '{print $3}'):0 + export LIBGL_ALWAYS_INDIRECT=1 + ''; + }; + shellAliases = lib.mkOption { + type = lib.types.attrs; + description = "Shell command aliases"; + default = { }; + example = { + nixGL = "nixGLIntel"; + }; + }; + }; + config = lib.mkIf cfg.enable { + # nix: Propagates the environment with packages and vars when enter (children of) + # a directory with shell.nix-compatible and .envrc + programs.direnv = { + enable = true; + nix-direnv.enable = true; + # nix-direnv.enableFlakes = true; # must remove. this will always be supported. + }; + # z as smarter cd + programs.zoxide = { + enable = true; + enableZshIntegration = true; + }; + programs.tmux = { + enable = true; + # extraConfigBeforePlugin = builtins.readFile "${proj_root.config.path}/tmux/tmux.conf"; + plugins = let inherit (pkgs.tmuxPlugins) cpu net-speed; in [ cpu net-speed ]; + extraConfig = (builtins.readFile "${proj_root.config.path}/tmux/tmux.conf"); + }; + xdg.configFile."tmux/tmux.conf".text = lib.mkOrder 600 '' + set -g status-right '#{cpu_bg_color} CPU: #{cpu_icon} #{cpu_percentage} | %a %h-%d %H:%M ' + ''; + # Colored ls + programs.exa = { + enable = true; + enableAliases = true; + }; + # Make the shell look beautiful + programs.starship = { + enable = true; + enableZshIntegration = true; + settings = let + native = builtins.fromTOML (builtins.readFile "${proj_root.config.path}/starship/starship.toml"); + patch-nix = pkgs.lib.recursiveUpdate native ({ + c.commands = [ + ["nix" "run" "nixpkgs#clang" "--" "--version"] + ["nix" "run" "nixpkgs#gcc" "--" "--version"] + ]; + }); + in patch-nix; + }; + # Fuzzy finder. `fzf` for TUI, `fzf -f ''` for UNIX piping + programs.fzf.enable = true; + programs.bash = { + enable = true; + enableCompletion = true; + initExtra = cfg.shellInitExtra or ""; + }; + programs.zsh = { + enable = true; + enableCompletion = true; + enableAutosuggestions = true; + shellAliases = { + nix-rebuild = "sudo nixos-rebuild switch"; + hm-switch = "home-manager switch --flake"; + } // (cfg.shellAliases or { }); + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + }; + oh-my-zsh = { + enable = true; + plugins = [ + "git" # git command aliases: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git#aliases + "command-not-found" # suggests which package to install; does not support nixos (we have solution already) + "gitignore" # `gi list` -> `gi java >>.gitignore` + "ripgrep" # adds completion for `rg` + "rust" # compe for rustc/cargo + "poetry" # compe for poetry - Python's cargo + ]; + }; + sessionVariables = { + # Vim mode on the terminal + # VI_MODE_RESET_PROMPT_ON_MODE_CHANGE = true; + # VI_MODE_SET_CURSOR = true; + # ZVM_VI_ESCAPE_BINDKEY = ""; + ZVM_READKEY_ENGINE = "$ZVM_READKEY_ENGINE_NEX"; + ZVM_KEYTIMEOUT = 0.004; # 40ms, or subtly around 25 FPS. I'm a gamer :) + ZVM_ESCAPE_KEYTIMEOUT = 0.004; # 40ms, or subtly around 25 FPS. I'm a gamer :) + }; + initExtra = (cfg.shellInitExtra or "") + '' + source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh + ''; + + }; + }; +} diff --git a/nix/cells/repo/home-profiles/default.nix b/nix/cells/repo/home-profiles/default.nix new file mode 100644 index 0000000..1218017 --- /dev/null +++ b/nix/cells/repo/home-profiles/default.nix @@ -0,0 +1,60 @@ +_imports@{inputs, cell}: let + namespace = "repo"; + imports = _imports // {inherit namespace;}; +in { + neovim = import ./neovim.nix imports; + nerd_font_module = {config, pkgs, ...}: { + imports = [ + import inputs.cells."${namespace}" + ]; + fonts.fontconfig.enable = true; + home.packages = [ + (pkgs.nerdfonts.override { fonts = [ "Hack" ]; }) + ]; + "${namespace}".alacritty.font.family = "Hack Nerd Font Mono"; + }; + + secrets = { + age.secrets.s3fs = { + file = "${inputs.self}/secrets/s3fs.age"; + # mode = "600"; # owner + group only + # owner = "hungtr"; + # group = "users"; + }; + age.secrets."s3fs.digital-garden" = { + file = "${inputs.self}/secrets/s3fs.digital-garden.age"; + }; + age.secrets._nhitrl_cred = { + file = "${inputs.self}/secrets/_nhitrl.age"; + }; + age.secrets."wifi.env" = { + file = "${inputs.self}/secrets/wifi.env.age"; + }; + }; + + ssh = {config, lib, ...}: let cfg = config."${namespace}".ssh; in { + options."${namespace}".ssh.enable = lib.mkOption { + type = lib.types.bool; + default = true; + example = false; + description = '' + Enables SSH + ''; + }; + config.programs.ssh = { + inherit (cfg) enable; + forwardAgent = true; + includes = ["${inputs.self}/native_configs/ssh/config"]; + }; + }; + + alacritty = {config, lib,...}: let cfg = config."${namespace}".alacritty; in { + imports = [ + import "${inputs.cells.repo.home-modules.alacritty}" + ]; + configs."${namespace}".alacritty = { + enable = true; + config-file = "${inputs.self}//native-configs/alacritty/alacritty.yml"; + }; + }; +} diff --git a/nix/cells/repo/home-profiles/neovim.nix b/nix/cells/repo/home-profiles/neovim.nix new file mode 100644 index 0000000..c312876 --- /dev/null +++ b/nix/cells/repo/home-profiles/neovim.nix @@ -0,0 +1,181 @@ +# TODO: vim-plug and Mason supports laziness. Probably worth it to explore incremental dependencies based on the project TODO: just install these things, then symlink to mason's bin directory +# +# One thing to consider, though, /nix/store of `nix-shell` or `nix-develop` +# might be different from `home-manager`'s (~/.nix_profile/bin/jq) +{inputs, cell, namespace}: { pkgs, lib, config, ... }: +let + # NOTE: Add packages to nvim_pkgs instead, so that it's available at userspace + # and is added to the path after wrapping. + # check: nix repl `homeConfigurations.hungtr.config.programs.neovim.finalPackage.buildCommand` + # see: :/--suffix.*PATH + # there should be mentions of additional packages + my_neovim = pkgs.neovim-unwrapped; + rust_pkgs = (pkgs.rust-bin.selectLatestNightlyWith + ( + toolchain: + toolchain.default.override { + extensions = [ "rust-src" "rust-analyzer" "rust-docs" "rustfmt" "clippy" "miri" ]; + } + )); + nvim_pkgs = [ + # pkgs.gccStdenv + pkgs.tree-sitter + pkgs.fzf # file name fuzzy search + pkgs.ripgrep # content fuzzy search + pkgs.zk # Zettelkasten (limited support) + pkgs.fd # Required by a Telescope plugin (?) + pkgs.stdenv.cc.cc.lib + pkgs.rnix-lsp # doesn't work, Mason just installs it using cargo + pkgs.rust4cargo + pkgs.nickel + pkgs.nls + + pkgs.go # doesn't work, Mason installs from runtime path + + # Language-specific stuffs + pkgs.sumneko-lua-language-server + # pkgs.python3Packages.python-lsp-server + pkgs.nodePackages.pyright + pkgs.python3Packages.pylint + pkgs.python3Packages.flake8 + # FIXME: installing ansible from here just doesn't work :/ + # pkgs.ansible-lint + # pkgs.python38Packages.ansible + # pkgs.ansible-language-server + # TODO: the devShell should provide rust-analyzer so that + # cargo test builds binaries compatible with rust-analyzer + + # pkgs.rust-analyzer + # rust_pkgs + # pkgs.evcxr # Rust REPL for Conjure! + ] ++ lib.optionals (pkgs.stdenv.isDarwin) ( + let + inherit (pkgs.darwin.apple_sdk.frameworks) System CoreFoundation; in + [ + System + CoreFoundation + ] + ); +in +{ + options.base.neovim = { + enable = lib.mkOption { + default = true; + description = "enable personalized neovim as default editor"; + type = lib.types.bool; + example = false; + }; + }; + config = lib.mkIf config.base.neovim.enable { + # home-manager + programs.neovim = { + enable = true; + package = my_neovim; + viAlias = true; + vimAlias = true; + withPython3 = true; + withNodeJs = true; + # NOTE: this adds path to the wrapped version of neovim + extraPackages = nvim_pkgs; + extraLuaConfig = (builtins.readFile "${inputs.self}/native_configs/neovim/init.lua"); + plugins = (let inherit (pkgs.vimPlugins) + plenary-nvim + + nvim-treesitter + nvim-treesitter-textobjects + nvim-treesitter-context + + telescope-fzf-native-nvim + telescope-file-browser-nvim + telescope-nvim + + nvim-lspconfig + + gruvbox-community + + neodev-nvim + + cmp-nvim-lsp + cmp-path + cmp-buffer + cmp-cmdline + nvim-cmp + + lspkind-nvim + nvim-autopairs + nvim-ts-autotag + guess-indent-nvim + harpoon + zk-nvim + luasnip + fidget-nvim + rust-tools-nvim + + cmp_luasnip + gitsigns-nvim + indent-blankline-nvim + lualine-nvim + mason-lspconfig-nvim + mason-nvim + neogit + nlua-nvim + nvim-jqx + nvim-surround + nvim-web-devicons + playground + todo-comments-nvim + trouble-nvim + vim-dispatch + vim-dispatch-neovim + vim-fugitive + vim-jack-in + + ; in [ + plenary-nvim + nvim-treesitter.withAllGrammars + nvim-treesitter-textobjects + telescope-fzf-native-nvim + telescope-file-browser-nvim + telescope-nvim + nvim-lspconfig + gruvbox-community + neodev-nvim + cmp-nvim-lsp + cmp-path + cmp-buffer + cmp-cmdline + nvim-cmp + lspkind-nvim + nvim-autopairs + nvim-ts-autotag + guess-indent-nvim + harpoon + zk-nvim + luasnip + nvim-treesitter-context + fidget-nvim + rust-tools-nvim + + cmp_luasnip + gitsigns-nvim + indent-blankline-nvim + lualine-nvim + mason-lspconfig-nvim + mason-nvim + neogit + nlua-nvim + nvim-jqx + nvim-surround + nvim-web-devicons + playground + todo-comments-nvim + trouble-nvim + vim-dispatch + vim-dispatch-neovim + vim-fugitive + vim-jack-in + ]); + }; + # home.packages = nvim_pkgs; + }; +} diff --git a/nix/cells/repo/lib/default.nix b/nix/cells/repo/lib/default.nix new file mode 100644 index 0000000..01aca6d --- /dev/null +++ b/nix/cells/repo/lib/default.nix @@ -0,0 +1,35 @@ +{inputs, cell}: let + namespace = "repo"; + + + yamlToJsonDrv = pkgs: yamlContent: outputPath: (pkgs.runCommand + outputPath { inherit yamlContent; nativeBuildInputs = [ pkgs.yq ]; } + # run yq which outputs '.' (no filter) on file at yamlPath + # note that $out is passed onto the bash/sh script for execution + '' + echo "$yamlContent" | yq >$out + '') + { }); +in { + fromYAML = yamlContent: bulitins.fromJSON (builtins.readFile (yamlToJsonDrv inputs.nixpkgs yamlContent "fromYaml.json")); + + # ctor + opt-some = a: [a]; + opt-none = []; + opt-none_thunk = _: []; + + # from-to null + opt-fromNullable = nullable: if nullable == null then [] else [nullable]; + opt-toNullable = opt-fork (a:a) (_: null); + + opt-map = builtins.map; + opt-filter = builtins.filter; + opt-fork = on_some: on_none: opt: if opt == [] then (on_none null) else (on_some (builtins.elemAt opt 0)); + + opt-unwrap = opt-fork (a:a) (_: throw "opt-unwrap: expected some, got none"); + opt-unwrapOrElse = opt-fork (a:a); + opt-unwrapOr = fallback_val: opt-fork (a:a) (_: fallback_val); + + opt-orElse = opt: fallback_opt: opt-fork (opt-some) (opt-none_thunk) (opt ++ fallback_opt); + opt-leftmostSome = opts: builtins.foldl' (opt-orElse) [] opts; +}