From 885a43f6e7cabf0b3a281b479314b26bf119dd96 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Tue, 7 Feb 2023 14:03:21 +0200 Subject: [PATCH 1/5] flake.nix: transition to flake-parts --- extra.nix | 168 ++++++++++++++++++++++++++++++++ flake.lock | 37 +++++++ flake.nix | 275 ++++++++++------------------------------------------- 3 files changed, 255 insertions(+), 225 deletions(-) create mode 100644 extra.nix diff --git a/extra.nix b/extra.nix new file mode 100644 index 0000000..bd5e705 --- /dev/null +++ b/extra.nix @@ -0,0 +1,168 @@ +inputs: let + modulesWithInputs = import ./modules {inherit inputs;}; + + neovimConfiguration = { + modules ? [], + pkgs, + lib ? pkgs.lib, + check ? true, + extraSpecialArgs ? {}, + }: + modulesWithInputs { + inherit pkgs lib check extraSpecialArgs; + configuration = {...}: { + imports = modules; + }; + }; + + mainConfig = isMaximal: { + config = { + vim = { + viAlias = true; + vimAlias = true; + }; + + vim.lsp = { + enable = true; + formatOnSave = true; + lightbulb.enable = true; + lspsaga.enable = false; + nvimCodeActionMenu.enable = true; + trouble.enable = true; + lspSignature.enable = true; + rust.enable = isMaximal; + python = isMaximal; + clang.enable = isMaximal; + sql = isMaximal; + ts = isMaximal; + go = isMaximal; + zig.enable = isMaximal; + nix = { + enable = true; + formatter = "alejandra"; + }; + }; + + vim.visuals = { + enable = true; + nvimWebDevicons.enable = true; + scrollBar.enable = true; + smoothScroll.enable = true; + cellularAutomaton.enable = true; + lspkind.enable = true; + indentBlankline = { + enable = true; + fillChar = ""; + eolChar = ""; + showCurrContext = true; + }; + cursorWordline = { + enable = true; + lineTimeout = 0; + }; + }; + + vim.statusline.lualine = { + enable = true; + theme = "catppuccin"; + }; + + vim.theme = { + enable = true; + name = "catppuccin"; + style = "mocha"; + }; + vim.autopairs.enable = true; + + vim.autocomplete = { + enable = true; + type = "nvim-cmp"; + }; + + vim.filetree = { + nvimTreeLua = { + enable = true; + view = { + width = 25; + }; + }; + }; + + vim.tabline = { + nvimBufferline.enable = true; + }; + + vim.treesitter = { + enable = true; + context.enable = true; + }; + + vim.binds = { + whichKey.enable = true; + cheatsheet.enable = true; + }; + + vim.telescope = { + enable = true; + }; + + vim.markdown = { + enable = true; + glow.enable = true; + }; + + vim.git = { + enable = true; + gitsigns.enable = true; + }; + + vim.minimap = { + minimap-vim.enable = false; + codewindow.enable = true; # lighter, faster, and uses lua for configuration + }; + + vim.dashboard = { + dashboard-nvim.enable = false; + alpha.enable = true; + }; + + vim.notify = { + nvim-notify.enable = true; + }; + + vim.utility = { + colorizer.enable = true; + icon-picker.enable = true; + venn-nvim.enable = false; # FIXME throws an error when its commands are ran manually + }; + + vim.notes = { + obsidian.enable = false; # FIXME neovim fails to build if obsidian is enabled + orgmode.enable = true; + }; + + vim.terminal = { + toggleterm.enable = true; + }; + + vim.ui = { + noice.enable = true; + }; + + vim.assistant = { + copilot.enable = false; + tabnine.enable = false; # FIXME: this is not working because the plugin depends on an internal script to be ran by the package manager + }; + + vim.session = { + nvim-session-manager.enable = false; + }; + + vim.gestures = { + gesture-nvim.enable = false; + }; + }; + }; +in { + inherit neovimConfiguration mainConfig; +} diff --git a/flake.lock b/flake.lock index 0c74fd2..97fc37c 100644 --- a/flake.lock +++ b/flake.lock @@ -305,6 +305,24 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1675295133, + "narHash": "sha256-dU8fuLL98WFXG0VnRgM00bqKX6CEPBLybhiIDIgO45o=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "bf53492df08f3178ce85e0c9df8ed8d03c030c9f", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1667395993, @@ -557,6 +575,24 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1672350804, + "narHash": "sha256-jo6zkiCabUBn3ObuKXHGqqORUMH27gYDIFFfLq5P4wg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "677ed08a50931e38382dbef01cba08a8f7eac8f6", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1656753965, @@ -1014,6 +1050,7 @@ "dashboard-nvim": "dashboard-nvim", "discord-nvim": "discord-nvim", "dressing-nvim": "dressing-nvim", + "flake-parts": "flake-parts", "flake-utils": "flake-utils", "gesture-nvim": "gesture-nvim", "gitsigns-nvim": "gitsigns-nvim", diff --git a/flake.nix b/flake.nix index 18cdb89..287688d 100644 --- a/flake.nix +++ b/flake.nix @@ -2,26 +2,11 @@ description = "A neovim flake with a modular configuration"; outputs = { nixpkgs, - flake-utils, + flake-parts, ... } @ inputs: let - modulesWithInputs = import ./modules {inherit inputs;}; - - neovimConfiguration = { - modules ? [], - pkgs, - lib ? pkgs.lib, - check ? true, - extraSpecialArgs ? {}, - }: - modulesWithInputs { - inherit pkgs lib check extraSpecialArgs; - configuration = {...}: { - imports = modules; - }; - }; - - nvimBin = pkg: "${pkg}/bin/nvim"; + inherit (nixpkgs) lib; + inherit (import ./extra.nix inputs) neovimConfiguration mainConfig; buildPkg = pkgs: modules: (neovimConfiguration { @@ -30,179 +15,42 @@ .neovim; tidalConfig = { - config = { - vim.tidal.enable = true; - }; - }; - - mainConfig = isMaximal: { - config = { - vim = { - viAlias = true; - vimAlias = true; - }; - - vim.lsp = { - enable = true; - formatOnSave = true; - lightbulb.enable = true; - lspsaga.enable = false; - nvimCodeActionMenu.enable = true; - trouble.enable = true; - lspSignature.enable = true; - rust.enable = isMaximal; - python = isMaximal; - clang.enable = isMaximal; - sql = isMaximal; - ts = isMaximal; - go = isMaximal; - zig.enable = isMaximal; - nix = { - enable = true; - formatter = "alejandra"; - }; - }; - - vim.visuals = { - enable = true; - nvimWebDevicons.enable = true; - scrollBar.enable = true; - smoothScroll.enable = true; - cellularAutomaton.enable = true; - lspkind.enable = true; - indentBlankline = { - enable = true; - fillChar = ""; - eolChar = ""; - showCurrContext = true; - }; - cursorWordline = { - enable = true; - lineTimeout = 0; - }; - }; - - vim.statusline.lualine = { - enable = true; - theme = "catppuccin"; - }; - - vim.theme = { - enable = true; - name = "catppuccin"; - style = "mocha"; - }; - vim.autopairs.enable = true; - - vim.autocomplete = { - enable = true; - type = "nvim-cmp"; - }; - - vim.filetree = { - nvimTreeLua = { - enable = true; - view = { - width = 25; - }; - }; - }; - - vim.tabline = { - nvimBufferline.enable = true; - }; - - vim.treesitter = { - enable = true; - context.enable = true; - }; - - vim.binds = { - whichKey.enable = true; - cheatsheet.enable = true; - }; - - vim.telescope = { - enable = true; - }; - - vim.markdown = { - enable = true; - glow.enable = true; - }; - - vim.git = { - enable = true; - gitsigns.enable = true; - }; - - vim.minimap = { - minimap-vim.enable = false; - codewindow.enable = true; # lighter, faster, and uses lua for configuration - }; - - vim.dashboard = { - dashboard-nvim.enable = false; - alpha.enable = true; - }; - - vim.notify = { - nvim-notify.enable = true; - }; - - vim.utility = { - colorizer.enable = true; - icon-picker.enable = true; - venn-nvim.enable = false; # FIXME throws an error when its commands are ran manually - }; - - vim.notes = { - obsidian.enable = false; # FIXME neovim fails to build if obsidian is enabled - orgmode.enable = true; - }; - - vim.terminal = { - toggleterm.enable = true; - }; - - vim.ui = { - noice.enable = true; - }; - - vim.assistant = { - copilot.enable = false; - tabnine.enable = false; # FIXME: this is not working because the plugin depends on an internal script to be ran by the package manager - }; - - vim.session = { - nvim-session-manager.enable = false; - }; - - vim.gestures = { - gesture-nvim.enable = false; - }; - }; + config.vim.tidal.enable = true; }; nixConfig = mainConfig false; maximalConfig = mainConfig true; in - { - lib = { - nvim = (import ./lib/stdlib-extended.nix nixpkgs.lib).nvim; - inherit neovimConfiguration; + flake-parts.lib.mkFlake {inherit inputs;} { + systems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; + + flake = { + lib = { + nvim = (import ./lib/stdlib-extended.nix nixpkgs.lib).nvim; + inherit neovimConfiguration; + }; + + overlays.default = final: prev: { + inherit neovimConfiguration; + neovim-nix = buildPkg prev [nixConfig]; + neovim-maximal = buildPkg prev [maximalConfig]; + neovim-tidal = buildPkg prev [tidalConfig]; + }; + + nixosModules.hm-module = { + imports = [ + ./lib/hm.nix + # {nixpkgs.overlays = [inputs.self.overlays.default];} what? + ]; + }; }; - overlays.default = final: prev: { - inherit neovimConfiguration; - neovim-nix = buildPkg prev [nixConfig]; - neovim-maximal = buildPkg prev [maximalConfig]; - neovim-tidal = buildPkg prev [tidalConfig]; - }; - } - // (flake-utils.lib.eachDefaultSystem ( - system: let - pkgs = import nixpkgs { + perSystem = { + system, + self', + ... + }: { + legacyPackages = import nixpkgs { inherit system; overlays = [ inputs.tidalcycles.overlays.default @@ -213,42 +61,28 @@ ]; }; - docs = import ./docs { - inherit pkgs; - nmdSrc = inputs.nmd; - }; - - # Available Configurations - tidalPkg = buildPkg pkgs [tidalConfig]; - nixPkg = buildPkg pkgs [nixConfig]; - maximalPkg = buildPkg pkgs [maximalConfig]; - in { apps = - rec { - nix = { - type = "app"; - program = nvimBin nixPkg; - }; - maximal = { - type = "app"; - program = nvimBin maximalPkg; - }; - default = nix; + { + nix.program = lib.getExe self'.packages.nix; + maximal.program = lib.getExe self'.packages.maximal; + default = self'.apps.nix; } // ( if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"]) then { - tidal = { - type = "app"; - program = nvimBin tidalPkg; - }; + tidal.program = lib.getExe self'.packages.tidal; } else {} ); - devShells.default = pkgs.mkShell {nativeBuildInputs = [nixPkg];}; + devShells.default = self'.legacyPackages.mkShell {nativeBuildInputs = [self'.packages.nix];}; - packages = + packages = let + docs = import ./docs { + pkgs = self'.legacyPackages; + nmdSrc = inputs.nmd; + }; + in { # Documentation docs = docs.manual.html; @@ -257,31 +91,22 @@ docs-json = docs.options.json; # Available Configurations - default = nixPkg; - nix = nixPkg; - maximal = maximalPkg; + nix = buildPkg self'.legacyPackages [nixConfig]; + maximal = buildPkg self'.legacyPackages [maximalConfig]; } // ( if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"]) - then { - tidal = tidalPkg; - } + then {tidal = buildPkg self'.legacyPackages [tidalConfig];} else {} ); - - nixosModules.hm-module = { - imports = [ - ./lib/hm.nix - # {nixpkgs.overlays = [inputs.self.overlays.default];} what? - ]; - }; - } - )); + }; + }; # Flake inputs inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; + flake-parts.url = "github:hercules-ci/flake-parts"; # For generating documentation website nmd = { From c759ae02f59198b03a5788f7c825553ac8e7e1db Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Fri, 10 Feb 2023 19:39:31 +0200 Subject: [PATCH 2/5] simplify things --- extra.nix | 6 ++---- flake.nix | 11 +++++------ modules/default.nix | 4 ++-- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/extra.nix b/extra.nix index bd5e705..620efe1 100644 --- a/extra.nix +++ b/extra.nix @@ -1,5 +1,5 @@ inputs: let - modulesWithInputs = import ./modules {inherit inputs;}; + modulesWithInputs = import ./modules inputs; neovimConfiguration = { modules ? [], @@ -10,9 +10,7 @@ inputs: let }: modulesWithInputs { inherit pkgs lib check extraSpecialArgs; - configuration = {...}: { - imports = modules; - }; + configuration.imports = modules; }; mainConfig = isMaximal: { diff --git a/flake.nix b/flake.nix index 287688d..2483c76 100644 --- a/flake.nix +++ b/flake.nix @@ -5,19 +5,18 @@ flake-parts, ... } @ inputs: let - inherit (nixpkgs) lib; inherit (import ./extra.nix inputs) neovimConfiguration mainConfig; + tidalConfig = { + config.vim.tidal.enable = true; + }; + buildPkg = pkgs: modules: (neovimConfiguration { inherit pkgs modules; }) .neovim; - tidalConfig = { - config.vim.tidal.enable = true; - }; - nixConfig = mainConfig false; maximalConfig = mainConfig true; in @@ -26,7 +25,7 @@ flake = { lib = { - nvim = (import ./lib/stdlib-extended.nix nixpkgs.lib).nvim; + inherit (import ./lib/stdlib-extended.nix nixpkgs.lib) nvim; inherit neovimConfiguration; }; diff --git a/modules/default.nix b/modules/default.nix index edf22bd..d8b4515 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,4 +1,4 @@ -{inputs}: { +inputs: { configuration, pkgs, lib ? pkgs.lib, @@ -6,7 +6,7 @@ extraSpecialArgs ? {}, }: let inherit (pkgs) neovim-unwrapped wrapNeovim vimPlugins; - inherit (builtins) map filter isString toString getAttr hasAttr attrNames; + inherit (builtins) map filter isString toString getAttr; inherit (pkgs.vimUtils) buildVimPluginFrom2Nix; extendedLib = import ../lib/stdlib-extended.nix lib; From 2f84ce13c41715a85eb71dbebd929ef00a4a02ab Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Fri, 10 Feb 2023 19:40:13 +0200 Subject: [PATCH 3/5] flake.nix: modularize (pt 1) --- flake.nix | 77 ++++++++++------------------------------ flake/apps.nix | 21 +++++++++++ flake/legacyPackages.nix | 19 ++++++++++ flake/packages.nix | 65 +++++++++++++++++++++++++++++++++ 4 files changed, 124 insertions(+), 58 deletions(-) create mode 100644 flake/apps.nix create mode 100644 flake/legacyPackages.nix create mode 100644 flake/packages.nix diff --git a/flake.nix b/flake.nix index 2483c76..7f79390 100644 --- a/flake.nix +++ b/flake.nix @@ -23,81 +23,42 @@ flake-parts.lib.mkFlake {inherit inputs;} { systems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; + imports = [ + # add lib to module args + {_module.args = {inherit (nixpkgs) lib;};} + ./flake/apps.nix + ./flake/legacyPackages.nix + ./flake/packages.nix + ]; + flake = { lib = { inherit (import ./lib/stdlib-extended.nix nixpkgs.lib) nvim; inherit neovimConfiguration; }; + nixosModules.default = { + imports = [./lib/hm-module.nix]; + nixpkgs.overlays = [ + inputs.tidalcycles.overlays.default + inputs.self.overlays.default + ]; + }; + overlays.default = final: prev: { inherit neovimConfiguration; neovim-nix = buildPkg prev [nixConfig]; neovim-maximal = buildPkg prev [maximalConfig]; neovim-tidal = buildPkg prev [tidalConfig]; }; - - nixosModules.hm-module = { - imports = [ - ./lib/hm.nix - # {nixpkgs.overlays = [inputs.self.overlays.default];} what? - ]; - }; }; perSystem = { - system, - self', + config, + pkgs, ... }: { - legacyPackages = import nixpkgs { - inherit system; - overlays = [ - inputs.tidalcycles.overlays.default - (final: prev: { - rnix-lsp = inputs.rnix-lsp.defaultPackage.${system}; - nil = inputs.nil.packages.${system}.default; - }) - ]; - }; - - apps = - { - nix.program = lib.getExe self'.packages.nix; - maximal.program = lib.getExe self'.packages.maximal; - default = self'.apps.nix; - } - // ( - if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"]) - then { - tidal.program = lib.getExe self'.packages.tidal; - } - else {} - ); - - devShells.default = self'.legacyPackages.mkShell {nativeBuildInputs = [self'.packages.nix];}; - - packages = let - docs = import ./docs { - pkgs = self'.legacyPackages; - nmdSrc = inputs.nmd; - }; - in - { - # Documentation - docs = docs.manual.html; - docs-html = docs.manual.html; - docs-manpages = docs.manPages; - docs-json = docs.options.json; - - # Available Configurations - nix = buildPkg self'.legacyPackages [nixConfig]; - maximal = buildPkg self'.legacyPackages [maximalConfig]; - } - // ( - if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"]) - then {tidal = buildPkg self'.legacyPackages [tidalConfig];} - else {} - ); + devShells.default = pkgs.mkShell {nativeBuildInputs = [config.packages.nix];}; }; }; diff --git a/flake/apps.nix b/flake/apps.nix new file mode 100644 index 0000000..6b53adf --- /dev/null +++ b/flake/apps.nix @@ -0,0 +1,21 @@ +{lib, ...}: { + perSystem = { + system, + config, + ... + }: { + apps = + { + nix.program = lib.getExe config.packages.nix; + maximal.program = lib.getExe config.packages.maximal; + default = config.apps.nix; + } + // ( + if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"]) + then { + tidal.program = lib.getExe config.packages.tidal; + } + else {} + ); + }; +} diff --git a/flake/legacyPackages.nix b/flake/legacyPackages.nix new file mode 100644 index 0000000..d6fb73c --- /dev/null +++ b/flake/legacyPackages.nix @@ -0,0 +1,19 @@ +{inputs, ...}: { + perSystem = { + system, + inputs', + ... + }: { + legacyPackages = import inputs.nixpkgs { + inherit system; + overlays = [ + inputs.tidalcycles.overlays.default + inputs.self.overlays.default + (_: _: { + rnix-lsp = inputs'.rnix-lsp.defaultPackage; + nil = inputs'.nil.packages.default; + }) + ]; + }; + }; +} diff --git a/flake/packages.nix b/flake/packages.nix new file mode 100644 index 0000000..1aff130 --- /dev/null +++ b/flake/packages.nix @@ -0,0 +1,65 @@ +{inputs, ...}: { + # imports = [ + # inputs.flake-parts.flakeModules.easyOverlay + # ]; + + perSystem = { + system, + pkgs, + config, + ... + }: let + # inherit (import ../extra.nix inputs) neovimConfiguration mainConfig; + + # tidalConfig = { + # config.vim.tidal.enable = true; + # }; + + # buildPkg = pkgs: modules: + # (neovimConfiguration { + # inherit pkgs modules; + # }) + # .neovim; + + # nixConfig = mainConfig false; + # maximalConfig = mainConfig true; + in { + # overlayAttrs = + # { + # inherit neovimConfiguration; + # neovim-nix = config.packages.nix; + # neovim-maximal = config.packages.maximal; + # } + # // ( + # if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"]) + # then {neovim-tidal = config.packages.tidal;} + # else {} + # ); + + packages = let + docs = import ../docs { + inherit pkgs; + nmdSrc = inputs.nmd; + }; + in + { + # Documentation + docs = docs.manual.html; + docs-html = docs.manual.html; + docs-manpages = docs.manPages; + docs-json = docs.options.json; + + # nvim configs + # nix = buildPkg pkgs [nixConfig]; + # maximal = buildPkg pkgs [maximalConfig]; + nix = config.legacyPackages.neovim-nix; + maximal = config.legacyPackages.neovim-maximal; + } + // ( + if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"]) + # then {tidal = buildPkg pkgs [tidalConfig];} + then {tidal = config.legacyPackages.neovim-tidal;} + else {} + ); + }; +} From a946045a7c2477b89a40c64a8c3ffdb6cd28b7a7 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Fri, 10 Feb 2023 19:45:23 +0200 Subject: [PATCH 4/5] flake.nix: split overlays --- flake.nix | 27 +++------------------------ flake/overlays.nix | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 24 deletions(-) create mode 100644 flake/overlays.nix diff --git a/flake.nix b/flake.nix index 7f79390..764f8c3 100644 --- a/flake.nix +++ b/flake.nix @@ -4,22 +4,7 @@ nixpkgs, flake-parts, ... - } @ inputs: let - inherit (import ./extra.nix inputs) neovimConfiguration mainConfig; - - tidalConfig = { - config.vim.tidal.enable = true; - }; - - buildPkg = pkgs: modules: - (neovimConfiguration { - inherit pkgs modules; - }) - .neovim; - - nixConfig = mainConfig false; - maximalConfig = mainConfig true; - in + } @ inputs: flake-parts.lib.mkFlake {inherit inputs;} { systems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; @@ -28,13 +13,14 @@ {_module.args = {inherit (nixpkgs) lib;};} ./flake/apps.nix ./flake/legacyPackages.nix + ./flake/overlays.nix ./flake/packages.nix ]; flake = { lib = { inherit (import ./lib/stdlib-extended.nix nixpkgs.lib) nvim; - inherit neovimConfiguration; + inherit (import ./extra.nix inputs) neovimConfiguration; }; nixosModules.default = { @@ -44,13 +30,6 @@ inputs.self.overlays.default ]; }; - - overlays.default = final: prev: { - inherit neovimConfiguration; - neovim-nix = buildPkg prev [nixConfig]; - neovim-maximal = buildPkg prev [maximalConfig]; - neovim-tidal = buildPkg prev [tidalConfig]; - }; }; perSystem = { diff --git a/flake/overlays.nix b/flake/overlays.nix new file mode 100644 index 0000000..44002b5 --- /dev/null +++ b/flake/overlays.nix @@ -0,0 +1,23 @@ +{inputs, ...}: let + inherit (import ../extra.nix inputs) neovimConfiguration mainConfig; + + tidalConfig = { + config.vim.tidal.enable = true; + }; + + buildPkg = pkgs: modules: + (neovimConfiguration { + inherit pkgs modules; + }) + .neovim; + + nixConfig = mainConfig false; + maximalConfig = mainConfig true; +in { + flake.overlays.default = final: prev: { + inherit neovimConfiguration; + neovim-nix = buildPkg prev [nixConfig]; + neovim-maximal = buildPkg prev [maximalConfig]; + neovim-tidal = buildPkg prev [tidalConfig]; + }; +} From 37d05187dfc9c0cc98f3af57e47dd9d35e0df366 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Fri, 10 Feb 2023 19:50:20 +0200 Subject: [PATCH 5/5] packages.nix: niceify --- flake/packages.nix | 39 +++------------------------------------ 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/flake/packages.nix b/flake/packages.nix index 1aff130..b43f964 100644 --- a/flake/packages.nix +++ b/flake/packages.nix @@ -1,41 +1,11 @@ {inputs, ...}: { - # imports = [ - # inputs.flake-parts.flakeModules.easyOverlay - # ]; - perSystem = { system, - pkgs, config, + pkgs, + lib, ... - }: let - # inherit (import ../extra.nix inputs) neovimConfiguration mainConfig; - - # tidalConfig = { - # config.vim.tidal.enable = true; - # }; - - # buildPkg = pkgs: modules: - # (neovimConfiguration { - # inherit pkgs modules; - # }) - # .neovim; - - # nixConfig = mainConfig false; - # maximalConfig = mainConfig true; - in { - # overlayAttrs = - # { - # inherit neovimConfiguration; - # neovim-nix = config.packages.nix; - # neovim-maximal = config.packages.maximal; - # } - # // ( - # if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"]) - # then {neovim-tidal = config.packages.tidal;} - # else {} - # ); - + }: { packages = let docs = import ../docs { inherit pkgs; @@ -50,14 +20,11 @@ docs-json = docs.options.json; # nvim configs - # nix = buildPkg pkgs [nixConfig]; - # maximal = buildPkg pkgs [maximalConfig]; nix = config.legacyPackages.neovim-nix; maximal = config.legacyPackages.neovim-maximal; } // ( if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"]) - # then {tidal = buildPkg pkgs [tidalConfig];} then {tidal = config.legacyPackages.neovim-tidal;} else {} );