diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-11-02 17:58:37 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-11-02 17:58:37 +0100 |
commit | 66ffa2470f7fae22b88c03c27aa7f0baf6906915 (patch) | |
tree | 1857951eec2503828fbf824ced33676a0f5ce104 | |
parent | fix(modules/legacy/alacitty): Update config to include new subsection (diff) | |
download | nixos-config-66ffa2470f7fae22b88c03c27aa7f0baf6906915.tar.gz nixos-config-66ffa2470f7fae22b88c03c27aa7f0baf6906915.zip |
refactor(modules/legacy/less): Migrate to `by-name`
-rw-r--r-- | modules/by-name/le/less/command.less (renamed from modules/home.legacy/conf/less/command.less) | 0 | ||||
-rw-r--r-- | modules/by-name/le/less/env.less (renamed from modules/home.legacy/conf/less/env.less) | 0 | ||||
-rw-r--r-- | modules/by-name/le/less/line-edit.less (renamed from modules/home.legacy/conf/less/line-edit.less) | 0 | ||||
-rw-r--r-- | modules/by-name/le/less/module.nix | 32 | ||||
-rw-r--r-- | modules/home.legacy/conf/default.nix | 1 | ||||
-rw-r--r-- | modules/home.legacy/conf/less/default.nix | 18 |
6 files changed, 32 insertions, 19 deletions
diff --git a/modules/home.legacy/conf/less/command.less b/modules/by-name/le/less/command.less index 95b79b02..95b79b02 100644 --- a/modules/home.legacy/conf/less/command.less +++ b/modules/by-name/le/less/command.less diff --git a/modules/home.legacy/conf/less/env.less b/modules/by-name/le/less/env.less index 30f7645d..30f7645d 100644 --- a/modules/home.legacy/conf/less/env.less +++ b/modules/by-name/le/less/env.less diff --git a/modules/home.legacy/conf/less/line-edit.less b/modules/by-name/le/less/line-edit.less index a7e889db..a7e889db 100644 --- a/modules/home.legacy/conf/less/line-edit.less +++ b/modules/by-name/le/less/line-edit.less diff --git a/modules/by-name/le/less/module.nix b/modules/by-name/le/less/module.nix new file mode 100644 index 00000000..f2475b73 --- /dev/null +++ b/modules/by-name/le/less/module.nix @@ -0,0 +1,32 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.less; +in { + options.soispha.programs.less = { + enable = lib.mkEnableOption "less"; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + home.sessionVariables = { + PAGER = "less"; + MANPAGER = "less --color=d+r --color=u+b"; + + # These are added here because adding them in the lesskey file somehow doesn't work. + LESSHISTSIZE = 10000; + LESSHISTFILE = "${config.home-manager.users.soispha.xdg.dataHome}/less/history"; + }; + + programs.less = { + enable = true; + keys = + builtins.readFile ./command.less + + builtins.readFile ./line-edit.less + + builtins.readFile ./env.less; + }; + }; + }; +} diff --git a/modules/home.legacy/conf/default.nix b/modules/home.legacy/conf/default.nix index 39ae1cd3..138e2080 100644 --- a/modules/home.legacy/conf/default.nix +++ b/modules/home.legacy/conf/default.nix @@ -14,7 +14,6 @@ ./iamb ./keepassxc ./latexindent - ./less ./mail ./mako ./mbsync diff --git a/modules/home.legacy/conf/less/default.nix b/modules/home.legacy/conf/less/default.nix deleted file mode 100644 index 9991ebef..00000000 --- a/modules/home.legacy/conf/less/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{config, ...}: { - home.sessionVariables = { - PAGER = "less"; - MANPAGER = "less --color=d+r --color=u+b"; - - # These are added here because adding them in the lesskey file somehow doesn't work. - LESSHISTSIZE = 10000; - LESSHISTFILE = "${config.xdg.dataHome}/less/history"; - }; - - programs.less = { - enable = true; - keys = - builtins.readFile ./command.less - + builtins.readFile ./line-edit.less - + builtins.readFile ./env.less; - }; -} |