about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorDanylo Hlynskyi <abcz2.uprola@gmail.com>2020-02-05 22:37:52 +0200
committerGitHub <noreply@github.com>2020-02-05 22:37:52 +0200
commit437e1f69be786bfbd06a611530bbd2fac6af1d35 (patch)
treeaa848e4c78298d532d9225196a1add8670ed3549 /nixos/modules
parent14e53a05086150e38e9ea7e8e584c5cf6281db8f (diff)
parent621bb74bd8b8a8bc0546b4ebdae62db067802104 (diff)
bash-my-aws: init at 20200111 (#76793)
* bash-my-aws: init at 20191231

Create bma-init

* Update
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/programs/bash-my-aws.nix25
2 files changed, 26 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index fb5331f11abd6..878b77969af17 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -98,6 +98,7 @@
   ./programs/autojump.nix
   ./programs/bandwhich.nix
   ./programs/bash/bash.nix
+  ./programs/bash-my-aws.nix
   ./programs/bcc.nix
   ./programs/browserpass.nix
   ./programs/captive-browser.nix
diff --git a/nixos/modules/programs/bash-my-aws.nix b/nixos/modules/programs/bash-my-aws.nix
new file mode 100644
index 0000000000000..15e429a754976
--- /dev/null
+++ b/nixos/modules/programs/bash-my-aws.nix
@@ -0,0 +1,25 @@
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+let
+  prg = config.programs;
+  cfg = prg.bash-my-aws;
+
+  initScript = ''
+    eval $(${pkgs.bash-my-aws}/bin/bma-init)
+  '';
+in
+  {
+    options = {
+      programs.bash-my-aws = {
+        enable = mkEnableOption "bash-my-aws";
+      };
+    };
+
+    config = mkIf cfg.enable {
+      environment.systemPackages = with pkgs; [ bash-my-aws ];
+
+      programs.bash.interactiveShellInit = initScript;
+    };
+  }