diff --git a/user/bin/default.nix b/user/bin/default.nix index eea9693..f4870f6 100644 --- a/user/bin/default.nix +++ b/user/bin/default.nix @@ -1,26 +1,27 @@ { config, pkgs, + lib, ... }: let - deps = { - bell = [pkgs.pipewire pkgs.libnotify]; - nsxiv-rifle = [pkgs.nsxiv]; - screenshot = [pkgs.maim pkgs.xclip]; - }; ln = config.u.lib.ln "${config.u.confPath}/user/bin"; in { + u.bin = with pkgs; { + edit = []; + sh-tmux = [tmux]; + sm = []; + } // lib.optionalAttrs config.u.has.graphical { + bell = [pipewire libnotify]; + nsxiv-rifle = [nsxiv]; + screenshot = [maim xclip]; + }; home.file = builtins.listToAttrs ( map (x: { name = ".local/bin/${x}"; value = {source = ln x;}; }) - ( - builtins.filter - (x: x != "default.nix") - (builtins.attrNames (builtins.readDir ./.)) - ) + (builtins.attrNames config.u.bin) ); - home.packages = pkgs.lib.lists.flatten (builtins.attrValues deps); + home.packages = pkgs.lib.lists.flatten (builtins.attrValues config.u.bin); } diff --git a/user/options.nix b/user/options.nix index 1563148..53a1e9b 100644 --- a/user/options.nix +++ b/user/options.nix @@ -21,6 +21,10 @@ default = ""; }; }; + bin = lib.mkOption { + type = lib.types.attrsOf (lib.types.listOf lib.types.package); + description = "scripts to put in .local/bin and their dependencies"; + }; bookmarks = lib.mkOption { type = lib.types.listOf (lib.types.submodule { options = {