From 4c0f04266e714dc570b95ac56cdc611c7f592fe7 Mon Sep 17 00:00:00 2001
From: foo-dogsquared <foo.dogsquared@gmail.com>
Date: Sat, 25 Dec 2021 20:35:55 +0800
Subject: [PATCH] Remove editor module for NixOS

The dedicated editor module for NixOS has been removed seeing as it is
barely used. The only exception is Neovim which is moved into
`modules.dev.neovim`.
---
 hosts/ni/default.nix      |  2 +-
 modules/nixos/dev.nix     | 16 +++++++++++++++-
 modules/nixos/editors.nix | 30 ------------------------------
 3 files changed, 16 insertions(+), 32 deletions(-)
 delete mode 100644 modules/nixos/editors.nix

diff --git a/hosts/ni/default.nix b/hosts/ni/default.nix
index 7063d49e..b37c3ca8 100644
--- a/hosts/ni/default.nix
+++ b/hosts/ni/default.nix
@@ -25,8 +25,8 @@
       enable = true;
       shell.enable = true;
       virtualization.enable = true;
+      neovim.enable = true;
     };
-    editors.neovim.enable = true;
     users.users.foo-dogsquared = {};
     themes = {
       disableLimit = true;
diff --git a/modules/nixos/dev.nix b/modules/nixos/dev.nix
index 37389652..0ccc0a30 100644
--- a/modules/nixos/dev.nix
+++ b/modules/nixos/dev.nix
@@ -1,5 +1,4 @@
 # The module for anything dev-related.
-# If you want to see editor-specific modules, see `modules/editors.nix`.
 { config, options, lib, pkgs, ... }:
 
 let cfg = config.modules.dev;
@@ -11,6 +10,7 @@ in {
       "installation of the shell utilities foo-dogsquared rely on";
     virtualization.enable =
       lib.mkEnableOption "virtualization-related stuff for development";
+    neovim.enable = lib.mkEnableOption "Neovim";
   };
 
   config = lib.mkIf cfg.enable (lib.mkMerge [
@@ -82,5 +82,19 @@ in {
         qemu.ovmf.enable = true;
       };
     })
+
+    (lib.mkIf cfg.neovim.enable {
+      programs.neovim = {
+        enable = true;
+        defaultEditor = true;
+        withNodeJs = true;
+        withRuby = true;
+
+        # I want the BLEEDING EDGE!
+        package = pkgs.neovim-nightly;
+      };
+
+      environment.systemPackages = with pkgs; [ editorconfig-core-c ];
+    })
   ]);
 }
diff --git a/modules/nixos/editors.nix b/modules/nixos/editors.nix
deleted file mode 100644
index a19dbe4f..00000000
--- a/modules/nixos/editors.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-# Your text editor war arsenal.
-{ config, options, lib, pkgs, ... }:
-
-let cfg = config.modules.editors;
-in {
-  options.modules.editors = {
-    neovim.enable = lib.mkEnableOption "Neovim and its components";
-    vscode.enable = lib.mkEnableOption "Visual Studio Code";
-  };
-
-  config = lib.mkMerge [
-    (lib.mkIf cfg.neovim.enable {
-      programs.neovim = {
-        enable = true;
-        defaultEditor = true;
-        withNodeJs = true;
-        withRuby = true;
-
-        # I want the BLEEDING EDGE!
-        package = pkgs.neovim-nightly;
-      };
-
-      environment.systemPackages = with pkgs; [ editorconfig-core-c ];
-    })
-
-    (lib.mkIf cfg.vscode.enable {
-      environment.systemPackages = with pkgs; [ vscode editorconfig-core-c ];
-    })
-  ];
-}