mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-20 04:31:52 +00:00
32 lines
671 B
Nix
32 lines
671 B
Nix
|
{ 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})
|
||
|
'';
|
||
|
};
|
||
|
}
|