This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ runCommand, patchelf, coreutils, binutils-unwrapped, find-libs }: | |
targetPrefix: inputPackage: | |
runCommand (inputPackage.pname + "-portable") { | |
inherit inputPackage targetPrefix; | |
} '' | |
set -euo pipefail | |
cp -a "$inputPackage" "$out" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let # invert is O(n^2); it's not obvious to me that we can do much better without a lot of work | |
# invert :: Map a [b] -> Map b [a] | |
invert = m: | |
let allBs = builtins.concatLists (builtins.attrValues m); | |
exploded = builtins.concatMap (a: map (b: { ${b} = a; }) m.${a}) (builtins.attrNames m); | |
in builtins.listToAttrs (map (b: { name = b; value = builtins.catAttrs b exploded; }) allBs); | |
# Given a package that installs .desktop files in the usual location, | |
# return a mapping from mime types to lists of desktop file names. | |
# This is suitable for use in home-manager's | |
# xdg.mimeApps.defaultApplications. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE UndecidableInstances #-} | |
module Control.Monad.ExceptionsToErrors where | |
import Control.Exception | |
import Control.Monad.Except | |
import Data.Proxy | |
import Data.Reflection | |
import GHC.IO (mkUserError) | |
-- | This is a monad that translates all IO-style synchronous exceptions into exceptions in ExceptT |
OlderNewer