1
0
Fork 0

Haskelltweaks

This commit is contained in:
Malte Brandy 2019-08-02 15:10:43 +02:00
parent c17a6d379c
commit 013b30532f
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9

View file

@ -1,7 +1,7 @@
let
inherit (import ../pkgs) niv;
inherit (import ../lib)
pkgs writeHaskellScript get-niv-path home-manager unstable haskellList;
pkgs writeHaskellScript get-niv-path home-manager unstable haskellList;
in rec {
haskellBody = commandline: ''
getNivPath dir = readTrim . get_niv_path ([i|#{dir :: String}/nix/sources.nix|] :: String)
@ -41,15 +41,13 @@ in rec {
imports = [
"Control.Exception (bracket)"
"System.Directory (withCurrentDirectory)"
"Control.Monad (when)"
"Control.Monad (when, ap)"
"Data.Maybe (listToMaybe)"
];
} ''
checkout :: IO FilePath
checkout = do
dir <- LBSC.unpack <$> (readTrim $ mktemp "-d")
git "clone" "${repoSrc}" dir
return dir
checkout = (mktemp "-d" |> captureTrim)
>>= ((ap (<$) $ git "clone" "${repoSrc}") . LBSC.unpack)
main = do
path <- readTrim pwd
@ -57,7 +55,7 @@ in rec {
bracket checkout (rm "-rf") $ \dir -> do
withCurrentDirectory dir $ do
mapM_ (\x -> git_crypt "unlock" ([i|${configPath}/.git/git-crypt/keys/#{x}|] :: String)) ${
haskellList keys
haskellList keys
}
when bump $ ignoreFailure $ niv "update"
mapM_ (test_system_config dir) ${haskellList systems}