summary refs log tree commit diff
path: root/nixos/modules/programs
diff options
context:
space:
mode:
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})
+      '';
+    };
+  }