From 2ad5af4f902f604cc8e49f39c05345e2d73291e3 Mon Sep 17 00:00:00 2001 From: alejandro-angulo Date: Sun, 28 Jul 2024 22:38:41 -0700 Subject: [PATCH] Converted bat from nixosModule to homeModule --- homes/x86_64-linux/alejandro/default.nix | 1 + modules/home/apps/bat/default.nix | 21 +++++++++ modules/nixos/apps/bat/default.nix | 23 ---------- modules/nixos/suites/utils/default.nix | 55 ++++++++++++------------ 4 files changed, 50 insertions(+), 50 deletions(-) create mode 100644 modules/home/apps/bat/default.nix delete mode 100644 modules/nixos/apps/bat/default.nix diff --git a/homes/x86_64-linux/alejandro/default.nix b/homes/x86_64-linux/alejandro/default.nix index a10f33d..80f68cc 100644 --- a/homes/x86_64-linux/alejandro/default.nix +++ b/homes/x86_64-linux/alejandro/default.nix @@ -9,6 +9,7 @@ }: { aa = { apps = { + bat.enable = true; btop.enable = true; tmux.enable = true; }; diff --git a/modules/home/apps/bat/default.nix b/modules/home/apps/bat/default.nix new file mode 100644 index 0000000..76fb779 --- /dev/null +++ b/modules/home/apps/bat/default.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + namespace, + ... +}: let + inherit (lib) mkIf mkEnableOption; + + cfg = config.${namespace}.apps.bat; +in { + options.${namespace}.apps.bat = { + enable = mkEnableOption "bat"; + }; + + config = mkIf cfg.enable { + programs.bat = { + enable = true; + config.theme = "gruvbox-dark"; + }; + }; +} diff --git a/modules/nixos/apps/bat/default.nix b/modules/nixos/apps/bat/default.nix deleted file mode 100644 index 23eab1d..0000000 --- a/modules/nixos/apps/bat/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - options, - config, - lib, - pkgs, - ... -}: -with lib; let - cfg = config.aa.apps.bat; -in { - options.aa.apps.bat = with types; { - enable = mkEnableOption "bat"; - }; - - config = mkIf cfg.enable { - aa.home.extraOptions = { - programs.bat = { - enable = true; - config.theme = "gruvbox-dark"; - }; - }; - }; -} diff --git a/modules/nixos/suites/utils/default.nix b/modules/nixos/suites/utils/default.nix index 17a8f79..8546047 100644 --- a/modules/nixos/suites/utils/default.nix +++ b/modules/nixos/suites/utils/default.nix @@ -1,41 +1,42 @@ { - options, config, lib, pkgs, inputs, ... -}: -with lib; let +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.aa.suites.utils; in { - options.aa.suites.utils = with lib.types; { + options.aa.suites.utils = { enable = mkEnableOption "common configuration"; }; config = mkIf cfg.enable { - aa.apps.bat.enable = true; - environment.systemPackages = with pkgs; [ - inputs.agenix.packages.x86_64-linux.default - alejandra - bind # for dig - curl - deploy-rs - du-dust - fd - file - htop - jq - killall - lsof - pre-commit - progress - python3 - ripgrep - sqlite - tcpdump - usbutils - wget - ]; + environment.systemPackages = + (with pkgs; [ + alejandra + bat + bind # for dig + curl + deploy-rs + du-dust + fd + file + htop + jq + killall + lsof + pre-commit + progress + python3 + ripgrep + sqlite + tcpdump + usbutils + wget + ]) + ++ [inputs.agenix.packages.x86_64-linux.default]; }; }