lsd: add module

This commit is contained in:
Mario Rodas 2019-03-17 16:37:21 -05:00 committed by Robert Helgesson
parent 24b5f62090
commit 95e36dfe74
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
3 changed files with 49 additions and 0 deletions

View file

@ -1005,6 +1005,13 @@ in
A new module is available: 'programs.bat'.
'';
}
{
time = "2019-03-19T23:07:34+00:00";
message = ''
A new module is available: 'programs.lsd'.
'';
}
];
};
}

View file

@ -60,6 +60,7 @@ let
(loadModule ./programs/jq.nix { })
(loadModule ./programs/keychain.nix { })
(loadModule ./programs/lesspipe.nix { })
(loadModule ./programs/lsd.nix { })
(loadModule ./programs/man.nix { })
(loadModule ./programs/matplotlib.nix { })
(loadModule ./programs/mbsync.nix { })

41
modules/programs/lsd.nix Normal file
View file

@ -0,0 +1,41 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.lsd;
aliases = {
ls = "${pkgs.lsd}/bin/lsd";
ll = "ls -l";
la = "ls -a";
lt = "ls --tree";
lla ="ls -la";
};
in
{
meta.maintainers = [ maintainers.marsam ];
options.programs.lsd = {
enable = mkEnableOption "lsd";
enableAliases = mkOption {
default = false;
type = types.bool;
description = ''
Whether to enable recommended lsd aliases.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.lsd ];
programs.bash.shellAliases = mkIf cfg.enableAliases aliases;
programs.zsh.shellAliases = mkIf cfg.enableAliases aliases;
};
}