diff options
| author | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2025-06-09 19:43:34 +0000 |
|---|---|---|
| committer | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2025-06-09 19:43:34 +0000 |
| commit | f3b7a6a33588ad425de02c4b841df19f30733e44 (patch) | |
| tree | ab6a8524350fda5868bf3f43187affbdb0895ce6 /lib/cfgWrapper.nix | |
| parent | a45c4551712c1ba5cb82eaf290f311ab0e8690e4 (diff) | |
reorganize programs, move functions to library, and remove the rest of hyprland (all sway now)
Diffstat (limited to 'lib/cfgWrapper.nix')
| -rw-r--r-- | lib/cfgWrapper.nix | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/lib/cfgWrapper.nix b/lib/cfgWrapper.nix deleted file mode 100644 index 2e57656..0000000 --- a/lib/cfgWrapper.nix +++ /dev/null @@ -1,63 +0,0 @@ -{pkgs}: { - pkg, - binName ? pkg.meta.mainProgram, - extraFlags ? [], - extraWrapperFlags ? [], - extraPkgs ? [], - extraEnv ? {}, - postBuild ? "", - hidePkgs ? false, - reducePath ? false, -}: let - extraFlagsArgs = pkgs.lib.pipe extraFlags [ - (builtins.map (x: ''--add-flags "${x}" '')) - (builtins.concatStringsSep " ") - ]; - - extraWrapperFlagsArgs = builtins.concatStringsSep " " extraWrapperFlags; - - pathArg = - if (extraPkgs != []) - then ''--prefix PATH : "${pkgs.lib.makeBinPath extraPkgs}"'' - else ""; - - # Looks like { - # VAR = "value"; - # VAR2 = "value_again"; - # } - envArgs = pkgs.lib.pipe extraEnv [ - (builtins.mapAttrs (k: v: ''--set ${k} "${v}"'')) - builtins.attrValues - (builtins.concatStringsSep " ") - ]; - - extraPkgs2 = - if reducePath - then - (pkgs.symlinkJoin { - name = "${binName}-extra-pkgs"; - paths = extraPkgs; - }) - else extraPkgs; - - wrapped-program = pkgs.symlinkJoin { - name = "${binName}-wrapped-program"; - paths = [pkg] ++ extraPkgs2; - - buildInputs = [pkgs.makeWrapper]; - postBuild = '' - ${postBuild} - - wrapProgram $out/bin/${binName} ${extraFlagsArgs} ${pathArg} ${envArgs} ${extraWrapperFlagsArgs} - ''; - }; -in - if hidePkgs - then - (pkgs.linkFarm "${binName}-only-bin" [ - { - name = "bin/${binName}"; - path = "${wrapped-program}/bin/${binName}"; - } - ]) - else wrapped-program |
