nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

commit be12e122b68b4df1a27168122facb4815676257b
parent a6df009e82779061b7767552c684a2bcad43347a
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Wed, 29 Apr 2020 04:21:17 +0300

Add nnn module

Diffstat:
Mmodules/default.nix | 1+
Amodules/home-manager/programs/nnn.nix | 45+++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/modules/default.nix b/modules/default.nix @@ -5,6 +5,7 @@ goldendict = ./home-manager/programs/goldendict.nix; gpxsee = ./home-manager/programs/gpxsee.nix; josm = ./home-manager/programs/josm.nix; + nnn = ./home-manager/programs/nnn.nix; qmapshack = ./home-manager/programs/qmapshack.nix; slack-term = ./home-manager/programs/slack-term.nix; }; diff --git a/modules/home-manager/programs/nnn.nix b/modules/home-manager/programs/nnn.nix @@ -0,0 +1,45 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.programs.nnn; +in +{ + meta.maintainers = with maintainers; [ sikmir ]; + + options.programs.nnn = { + enable = mkEnableOption "The missing terminal file manager for X"; + + package = mkOption { + default = pkgs.nnn; + defaultText = literalExample "pkgs.nnn"; + description = "nnn package to install."; + type = types.package; + }; + + pluginsPackage = mkOption { + default = null; + description = "nnn plugins package to install."; + type = types.nullOr types.package; + }; + }; + + config = mkIf cfg.enable ( + mkMerge [ + { + home.packages = [ cfg.package ]; + + home.sessionVariables = { + NNN_COLORS = "5236"; + }; + } + + ( + mkIf (cfg.pluginsPackage != null) { + xdg.configFile."nnn/plugins".source = + "${cfg.pluginsPackage}/share/nnn/plugins"; + } + ) + ] + ); +}