mirror of
https://github.com/nix-community/home-manager
synced 2025-02-02 06:15:03 +01:00
lsd: remove with lib;
This commit is contained in:
parent
bb14224f51
commit
96dee79b17
1 changed files with 18 additions and 20 deletions
|
@ -1,7 +1,5 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.lsd;
|
||||
|
@ -21,17 +19,17 @@ in {
|
|||
meta.maintainers = [ ];
|
||||
|
||||
options.programs.lsd = {
|
||||
enable = mkEnableOption "lsd";
|
||||
enable = lib.mkEnableOption "lsd";
|
||||
|
||||
enableAliases = mkOption {
|
||||
enableAliases = lib.mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Whether to enable recommended lsd aliases.
|
||||
'';
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
settings = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
example = {
|
||||
|
@ -46,7 +44,7 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
colors = mkOption {
|
||||
colors = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
example = {
|
||||
|
@ -66,7 +64,7 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
icons = mkOption {
|
||||
icons = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
example = {
|
||||
|
@ -91,35 +89,35 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ pkgs.lsd ];
|
||||
|
||||
programs.bash.shellAliases = mkIf cfg.enableAliases aliases;
|
||||
programs.bash.shellAliases = lib.mkIf cfg.enableAliases aliases;
|
||||
|
||||
programs.zsh.shellAliases = mkIf cfg.enableAliases aliases;
|
||||
programs.zsh.shellAliases = lib.mkIf cfg.enableAliases aliases;
|
||||
|
||||
programs.fish = mkMerge [
|
||||
(mkIf (!config.programs.fish.preferAbbrs) {
|
||||
shellAliases = mkIf cfg.enableAliases aliases;
|
||||
programs.fish = lib.mkMerge [
|
||||
(lib.mkIf (!config.programs.fish.preferAbbrs) {
|
||||
shellAliases = lib.mkIf cfg.enableAliases aliases;
|
||||
})
|
||||
|
||||
(mkIf config.programs.fish.preferAbbrs {
|
||||
shellAbbrs = mkIf cfg.enableAliases aliases;
|
||||
(lib.mkIf config.programs.fish.preferAbbrs {
|
||||
shellAbbrs = lib.mkIf cfg.enableAliases aliases;
|
||||
})
|
||||
];
|
||||
|
||||
programs.lsd =
|
||||
mkIf (cfg.colors != { }) { settings.color.theme = "custom"; };
|
||||
lib.mkIf (cfg.colors != { }) { settings.color.theme = "custom"; };
|
||||
|
||||
xdg.configFile."lsd/colors.yaml" = mkIf (cfg.colors != { }) {
|
||||
xdg.configFile."lsd/colors.yaml" = lib.mkIf (cfg.colors != { }) {
|
||||
source = yamlFormat.generate "lsd-colors" cfg.colors;
|
||||
};
|
||||
|
||||
xdg.configFile."lsd/icons.yaml" = mkIf (cfg.icons != { }) {
|
||||
xdg.configFile."lsd/icons.yaml" = lib.mkIf (cfg.icons != { }) {
|
||||
source = yamlFormat.generate "lsd-icons" cfg.icons;
|
||||
};
|
||||
|
||||
xdg.configFile."lsd/config.yaml" = mkIf (cfg.settings != { }) {
|
||||
xdg.configFile."lsd/config.yaml" = lib.mkIf (cfg.settings != { }) {
|
||||
source = yamlFormat.generate "lsd-config" cfg.settings;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue