summary refs log tree commit diff
path: root/nixos/modules/programs
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2017-06-14 10:57:38 +0200
committerJörg Thalheim <Mic92@users.noreply.github.com>2017-06-14 09:57:38 +0100
commit3803864ca61b7737e3b6be843fc8e09598ce4bda (patch)
tree09705ca68b64c1a7cf422ed3ce75ba36a4900747 /nixos/modules/programs
parent9cad7076d1bc5475a857fd2c6e9a56d9ed254252 (diff)
downloadnixlib-3803864ca61b7737e3b6be843fc8e09598ce4bda.tar
nixlib-3803864ca61b7737e3b6be843fc8e09598ce4bda.tar.gz
nixlib-3803864ca61b7737e3b6be843fc8e09598ce4bda.tar.bz2
nixlib-3803864ca61b7737e3b6be843fc8e09598ce4bda.tar.lz
nixlib-3803864ca61b7737e3b6be843fc8e09598ce4bda.tar.xz
nixlib-3803864ca61b7737e3b6be843fc8e09598ce4bda.tar.zst
nixlib-3803864ca61b7737e3b6be843fc8e09598ce4bda.zip
thefuck: init at 3.18 (#26529)
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r--nixos/modules/programs/thefuck.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/nixos/modules/programs/thefuck.nix b/nixos/modules/programs/thefuck.nix
new file mode 100644
index 000000000000..433a0ca95fef
--- /dev/null
+++ b/nixos/modules/programs/thefuck.nix
@@ -0,0 +1,31 @@
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+let
+  cfg = config.programs.thefuck;
+in
+  {
+    options = {
+      programs.thefuck = {
+        enable = mkEnableOption "thefuck";
+
+        alias = mkOption {
+          default = "fuck";
+          type = types.string;
+
+          description = ''
+            `thefuck` needs an alias to be configured.
+            The default value is `fuck`, but you can use anything else as well.
+          '';
+        };
+      };
+    };
+
+    config = mkIf cfg.enable {
+      environment.systemPackages = with pkgs; [ thefuck ];
+      environment.shellInit = ''
+        eval $(${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias})
+      '';
+    };
+  }