about summary refs log tree commit diff
path: root/modules/common/bat.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-11-23 04:20:34 +0300
committerAzat Bahawi <azat@bahawi.net>2023-11-23 04:20:34 +0300
commit67b82386d8ad8ae3eea5083bd22809f6192d92a8 (patch)
tree41829a0b3e05a9dbb4b0189e34a7b53e401f489e /modules/common/bat.nix
parent2023-11-19 (diff)
2023-11-23
Diffstat (limited to '')
-rw-r--r--modules/common/bat.nix36
1 files changed, 13 insertions, 23 deletions
diff --git a/modules/common/bat.nix b/modules/common/bat.nix
index 7f78a59..d95f709 100644
--- a/modules/common/bat.nix
+++ b/modules/common/bat.nix
@@ -6,32 +6,22 @@
 with lib; let
   cfg = config.nixfiles.modules.bat;
 in {
-  options.nixfiles.modules.bat.enable =
-    mkEnableOption "bat, an alternative to cat";
+  options.nixfiles.modules.bat.enable = mkEnableOption "bat, an alternative to cat";
 
   config = mkIf cfg.enable {
-    hm.programs = {
-      bat = {
-        enable = true;
-        config = {
-          style = "plain";
-          tabs = "4";
-          theme = "base16";
-          wrap = "never";
-        };
-      };
-
-      bash = {
-        shellAliases = {
-          baj = "bat --language=json --tabs 2";
-          bay = "bat --language=yaml --tabs 2";
-          bas = "bat --language=syslog";
-        };
+    nixfiles.modules.common.shell.aliases = {
+      baj = "bat --language=json --tabs 2";
+      bay = "bat --language=yaml --tabs 2";
+      bas = "bat --language=syslog";
+    };
 
-        initExtra = mkAfter ''
-          _complete_alias bay _bat bat
-          _complete_alias baj _bat bat
-        '';
+    hm.programs.bat = {
+      enable = true;
+      config = {
+        style = "plain";
+        tabs = "4";
+        theme = "base16";
+        wrap = "never";
       };
     };
   };

Consider giving Nix/NixOS a try! <3