From fbd08add9959785ac034822e309884c1e6aabcb3 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 31 Mar 2023 17:42:15 +0300 Subject: [PATCH] clean up lib --- flake.nix | 6 ++- lib/default.nix | 2 +- lib/hm-module.nix | 45 --------------------- lib/types.nix | 7 ---- lib/{types-dag.nix => types/dag.nix} | 0 lib/types/default.nix | 7 ++++ lib/{types-plugin.nix => types/plugins.nix} | 0 7 files changed, 12 insertions(+), 55 deletions(-) delete mode 100644 lib/hm-module.nix delete mode 100644 lib/types.nix rename lib/{types-dag.nix => types/dag.nix} (100%) create mode 100644 lib/types/default.nix rename lib/{types-plugin.nix => types/plugins.nix} (100%) diff --git a/flake.nix b/flake.nix index 36632c14..a0ab89e0 100644 --- a/flake.nix +++ b/flake.nix @@ -33,7 +33,9 @@ }; nixosModules.default = { - home-manager.sharedModules = [./lib/hm-module.nix]; + home-manager.sharedModules = [ + ./lib/module + ]; nixpkgs.overlays = [ inputs.tidalcycles.overlays.default inputs.self.overlays.default @@ -42,7 +44,7 @@ homeManagerModules.default = { imports = [ - ./lib/hm-module.nix + ./lib/module ]; }; }; diff --git a/lib/default.nix b/lib/default.nix index bb4a2714..873f31bc 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,5 +1,5 @@ {lib}: { dag = import ./dag.nix {inherit lib;}; booleans = import ./booleans.nix {inherit lib;}; - types = import ./types.nix {inherit lib;}; + types = import ./types {inherit lib;}; } diff --git a/lib/hm-module.nix b/lib/hm-module.nix deleted file mode 100644 index 4648966b..00000000 --- a/lib/hm-module.nix +++ /dev/null @@ -1,45 +0,0 @@ -# Home Manager module -{ - self, - config, - pkgs, - lib ? pkgs.lib, - ... -}: let - cfg = config.programs.neovim-flake; - set = self.packages.neovim-maximal {mainConfig = cfg.settings;}; -in - with lib; { - meta.maintainers = [maintainers.notashelf]; - - options.programs.neovim-flake = { - enable = mkEnableOption "A NeoVim IDE with a focus on configurability and extensibility."; - - settings = mkOption { - type = types.attrsOf types.anything; - default = {}; - example = literalExpression '' - { - vim.viAlias = false; - vim.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 = false; - nix = true; - }; - } - ''; - description = "Attribute set of neoflake preferences."; - }; - }; - - config = mkIf cfg.enable { - home.packages = [set.neovim]; - }; - } diff --git a/lib/types.nix b/lib/types.nix deleted file mode 100644 index 8625f189..00000000 --- a/lib/types.nix +++ /dev/null @@ -1,7 +0,0 @@ -{lib}: let - typesDag = import ./types-dag.nix {inherit lib;}; - typesPlugin = import ./types-plugin.nix {inherit lib;}; -in { - inherit (typesDag) dagOf; - inherit (typesPlugin) pluginsOpt; -} diff --git a/lib/types-dag.nix b/lib/types/dag.nix similarity index 100% rename from lib/types-dag.nix rename to lib/types/dag.nix diff --git a/lib/types/default.nix b/lib/types/default.nix new file mode 100644 index 00000000..fca45ba4 --- /dev/null +++ b/lib/types/default.nix @@ -0,0 +1,7 @@ +{lib}: let + typesDag = import ./dag.nix {inherit lib;}; + typesPlugin = import ./plugins.nix {inherit lib;}; +in { + inherit (typesDag) dagOf; + inherit (typesPlugin) pluginsOpt; +} diff --git a/lib/types-plugin.nix b/lib/types/plugins.nix similarity index 100% rename from lib/types-plugin.nix rename to lib/types/plugins.nix