packages feed

cachix 0.3.1 → 0.3.2

raw patch · 7 files changed

+181/−177 lines, 7 files

Files

CHANGELOG.md view
@@ -7,6 +7,10 @@  ## Unreleased +## [0.3.2] - 2019-09-16++- #232: brownbag release due to a bug in release process+ ## [0.3.1] - 2019-09-16  ### Fixed
cachix.cabal view
@@ -1,156 +1,156 @@-cabal-version: 2.2-name: cachix-version: 0.3.1-license: Apache-2.0-license-file: LICENSE-copyright: 2018 Domen Kožar-maintainer: domen@enlambda.com-author: Domen Kožar-homepage: https://github.com/cachix/cachix#readme-bug-reports: https://github.com/cachix/cachix/issues-synopsis: Command line client for Nix binary cache hosting https://cachix.org-build-type: Simple+cabal-version:      2.2+name:               cachix+version: 0.3.2+license:            Apache-2.0+license-file:       LICENSE+copyright:          2018 Domen Kožar+maintainer:         domen@enlambda.com+author:             Domen Kožar+homepage:           https://github.com/cachix/cachix#readme+bug-reports:        https://github.com/cachix/cachix/issues+synopsis:+  Command line client for Nix binary cache hosting https://cachix.org++build-type:         Simple extra-source-files:-    CHANGELOG.md-    README.md-    cbits/aliases.h-    test/data/*.input-    test/data/*.output+  CHANGELOG.md+  README.md+  cbits/aliases.h+  test/data/*.input+  test/data/*.output +common defaults+  default-extensions:+    NoImplicitPrelude+    DeriveAnyClass+    DeriveGeneric+    OverloadedStrings++  ghc-options:+    -Wall -Wcompat -Wincomplete-record-updates+    -Wincomplete-uni-patterns -Wredundant-constraints -fwarn-tabs+    -fwarn-unused-imports -fwarn-missing-signatures+    -fwarn-name-shadowing -fwarn-incomplete-patterns++  default-language:   Haskell2010+ source-repository head-    type: git-    location: https://github.com/cachix/cachix+  type:     git+  location: https://github.com/cachix/cachix  library-    exposed-modules:-        Cachix.Client-        Cachix.Client.Commands-        Cachix.Client.Config-        Cachix.Client.Config.Orphans-        Cachix.Client.Env-        Cachix.Client.Exception-        Cachix.Client.InstallationMode-        Cachix.Client.NetRc-        Cachix.Client.NixConf-        Cachix.Client.NixVersion-        Cachix.Client.OptionsParser-        Cachix.Client.Push-        Cachix.Client.Secrets-        Cachix.Client.Servant-        Cachix.Client.Store-        Cachix.Client.Store.Context-        Cachix.Client.URI-    cc-options: -Wall-    pkgconfig-depends: nix-store ==2.0 || >2.0, nix-main ==2.0 || >2.0-    hs-source-dirs: src-    other-modules:-        Paths_cachix-    autogen-modules:-        Paths_cachix-    default-language: Haskell2010-    default-extensions: NoImplicitPrelude DeriveGeneric-                        OverloadedStrings RecordWildCards-    extra-libraries:-        stdc++-        boost_context-    include-dirs: cbits-    ghc-options: -Wall -Wcompat -Wincomplete-record-updates-                 -Wincomplete-uni-patterns -Wredundant-constraints -fwarn-tabs-                 -fwarn-unused-imports -fwarn-missing-signatures-                 -fwarn-name-shadowing -fwarn-incomplete-patterns-    build-depends:-        async -any,-        base >=4.7 && <5,-        base64-bytestring -any,-        bytestring -any,-        cachix-api -any,-        conduit >=1.3.0,-        conduit-extra -any,-        containers -any,-        cookie -any,-        cryptonite -any,-        dhall -any,-        directory -any,-        ed25519 -any,-        filepath -any,-        fsnotify -any,-        here -any,-        hnix-store-core -any,-        http-client -any,-        http-client-tls -any,-        http-conduit -any,-        http-types -any,-        inline-c -any,-        inline-c-cpp -any,-        lzma-conduit -any,-        megaparsec >=7.0.0,-        memory -any,-        mmorph -any,-        netrc -any,-        optparse-applicative -any,-        process -any,-        protolude -any,-        resourcet -any,-        retry -any,-        safe-exceptions -any,-        servant >=0.15,-        servant-auth -any,-        servant-auth-client >=0.3.3.0,-        servant-client >=0.15,-        servant-client-core >=0.15,-        servant-conduit -any,-        text -any,-        unix -any,-        uri-bytestring -any,-        versions -any-    -    if os(osx)-        ghc-options: -pgmc=clang+++  import:            defaults+  exposed-modules:+    Cachix.Client+    Cachix.Client.Commands+    Cachix.Client.Config+    Cachix.Client.Config.Orphans+    Cachix.Client.Env+    Cachix.Client.Exception+    Cachix.Client.InstallationMode+    Cachix.Client.NetRc+    Cachix.Client.NixConf+    Cachix.Client.NixVersion+    Cachix.Client.OptionsParser+    Cachix.Client.Push+    Cachix.Client.Secrets+    Cachix.Client.Servant+    Cachix.Client.Store+    Cachix.Client.Store.Context+    Cachix.Client.URI +  cc-options:        -Wall+  pkgconfig-depends: nix-store ==2.0 || >2.0, nix-main ==2.0 || >2.0+  hs-source-dirs:    src+  other-modules:     Paths_cachix+  autogen-modules:   Paths_cachix+  extra-libraries:+    stdc+++    boost_context++  include-dirs:      cbits+  build-depends:+    , async+    , base                  >=4.7     && <5+    , base64-bytestring+    , bytestring+    , cachix-api+    , conduit               >=1.3.0+    , conduit-extra+    , containers+    , cookie+    , cryptonite+    , dhall+    , directory+    , ed25519+    , filepath+    , fsnotify+    , here+    , hnix-store-core+    , http-client+    , http-client-tls+    , http-conduit+    , http-types+    , inline-c+    , inline-c-cpp+    , lzma-conduit+    , megaparsec            >=7.0.0+    , memory+    , mmorph+    , netrc+    , optparse-applicative+    , process+    , protolude+    , resourcet+    , retry+    , safe-exceptions+    , servant               >=0.15+    , servant-auth+    , servant-auth-client   >=0.3.3.0+    , servant-client        >=0.15+    , servant-client-core   >=0.15+    , servant-conduit+    , text+    , unix+    , uri-bytestring+    , versions++  ghc-options:       -optc=-std=c++17++  if os(osx)+    ghc-options: -pgmc=clang+++ executable cachix-    main-is: Main.hs-    build-tool-depends: hspec-discover:hspec-discover -any-    hs-source-dirs: cachix-    other-modules:-        Paths_cachix-    autogen-modules:-        Paths_cachix-    default-language: Haskell2010-    default-extensions: NoImplicitPrelude DeriveGeneric-                        OverloadedStrings RecordWildCards-    ghc-options: -Wall -Wcompat -Wincomplete-record-updates-                 -Wincomplete-uni-patterns -Wredundant-constraints -fwarn-tabs-                 -fwarn-unused-imports -fwarn-missing-signatures-                 -fwarn-name-shadowing -fwarn-incomplete-patterns-    build-depends:-        base >=4.7 && <5,-        cachix -any,-        cachix-api -any+  import:             defaults+  main-is:            Main.hs+  build-tool-depends: hspec-discover:hspec-discover -any+  hs-source-dirs:     cachix+  other-modules:      Paths_cachix+  autogen-modules:    Paths_cachix+  build-depends:+    , base        >=4.7 && <5+    , cachix+    , cachix-api  test-suite cachix-test-    type: exitcode-stdio-1.0-    main-is: Main.hs-    hs-source-dirs: test-    other-modules:-        InstallationModeSpec-        NetRcSpec-        NixConfSpec-        NixVersionSpec-        Paths_cachix-        Spec-    default-language: Haskell2010-    default-extensions: NoImplicitPrelude DeriveGeneric-                        OverloadedStrings RecordWildCards-    ghc-options: -Wall -Wcompat -Wincomplete-record-updates-                 -Wincomplete-uni-patterns -Wredundant-constraints -fwarn-tabs-                 -fwarn-unused-imports -fwarn-missing-signatures-                 -fwarn-name-shadowing -fwarn-incomplete-patterns-    build-depends:-        base >=4.7 && <5,-        cachix -any,-        cachix-api -any,-        directory -any,-        here -any,-        hspec -any,-        protolude -any,-        temporary -any+  import:         defaults+  type:           exitcode-stdio-1.0+  main-is:        Main.hs+  hs-source-dirs: test+  other-modules:+    InstallationModeSpec+    NetRcSpec+    NixConfSpec+    NixVersionSpec+    Paths_cachix+    Spec++  build-depends:+    , base        >=4.7 && <5+    , cachix+    , cachix-api+    , directory+    , here+    , hspec+    , protolude+    , temporary
src/Cachix/Client/Commands.hs view
@@ -199,7 +199,7 @@   -> IO SigningKey -- ^ Secret key or exception findSigningKey env name = do   maybeEnvSK <- lookupEnv "CACHIX_SIGNING_KEY"-  let matches Config {..} = filter (\bc -> Config.name bc == name) binaryCaches+  let matches c = filter (\bc -> Config.name bc == name) $ binaryCaches c       maybeBCSK = case config env of         Nothing -> Nothing         Just c -> Config.secretKey <$> head (matches c)
src/Cachix/Client/InstallationMode.hs view
@@ -61,10 +61,10 @@ toString UntrustedRequiresSudo = "untrusted-requires-sudo"  getInstallationMode :: NixEnv -> InstallationMode-getInstallationMode NixEnv {..}-  | isNixOS && isRoot = WriteNixOS-  | not isNixOS && isRoot = Install NixConf.Global-  | isTrusted = Install NixConf.Local+getInstallationMode nixenv+  | isNixOS nixenv && isRoot nixenv = WriteNixOS+  | not (isNixOS nixenv) && isRoot nixenv = Install NixConf.Global+  | isTrusted nixenv = Install NixConf.Local   | otherwise = UntrustedRequiresSudo  -- | Add a Binary cache to nix.conf, print nixos config or fail@@ -74,7 +74,7 @@     $ MustBeRoot "Run command as root OR execute: $ echo \"trusted-users = root $USER\" | sudo tee -a /etc/nix/nix.conf && sudo pkill nix-daemon" addBinaryCache maybeConfig bc useOptions WriteNixOS =   nixosBinaryCache maybeConfig bc useOptions-addBinaryCache maybeConfig bc@Api.BinaryCache {..} _ (Install ncl) = do+addBinaryCache maybeConfig bc _ (Install ncl) = do   -- TODO: might need locking one day   gnc <- NixConf.read NixConf.Global   (input, output) <-@@ -84,7 +84,7 @@         lnc <- NixConf.read NixConf.Local         return ([gnc, lnc], lnc)   let nixconf = fromMaybe (NixConf.NixConf []) output-  netrcLocMaybe <- forM (guard $ not isPublic) $ const $ addPrivateBinaryCacheNetRC maybeConfig bc ncl+  netrcLocMaybe <- forM (guard $ not (isPublic bc)) $ const $ addPrivateBinaryCacheNetRC maybeConfig bc ncl   let addNetRCLine :: NixConf.NixConf -> NixConf.NixConf       addNetRCLine = fromMaybe identity $ do         netrcLoc <- netrcLocMaybe :: Maybe FilePath@@ -94,10 +94,10 @@         pure (NixConf.setNetRC $ toS netrcLoc)   NixConf.write ncl $ addNetRCLine $ NixConf.add bc (catMaybes input) nixconf   filename <- NixConf.getFilename ncl-  putStrLn $ "Configured " <> uri <> " binary cache in " <> toS filename+  putStrLn $ "Configured " <> uri bc <> " binary cache in " <> toS filename  nixosBinaryCache :: Maybe Config -> Api.BinaryCache -> UseOptions -> IO ()-nixosBinaryCache maybeConfig bc@Api.BinaryCache {..} UseOptions {useNixOSFolder = baseDirectory} = do+nixosBinaryCache maybeConfig bc UseOptions {useNixOSFolder = baseDirectory} = do   eitherPermissions <- try $ getPermissions (toS baseDirectory) :: IO (Either SomeException Permissions)   case eitherPermissions of     Left _ -> throwIO $ NixOSInstructions noEtcPermissionInstructions@@ -109,7 +109,7 @@       createDirectoryIfMissing True $ toS toplevel       writeFile (toS glueModuleFile) glueModule       writeFile (toS cacheModuleFile) cacheModule-      unless isPublic $ void $ addPrivateBinaryCacheNetRC maybeConfig bc NixConf.Global+      unless (isPublic bc) $ void $ addPrivateBinaryCacheNetRC maybeConfig bc NixConf.Global       putText instructions     configurationNix :: Text     configurationNix = toS $ toS baseDirectory </> "configuration.nix"@@ -120,7 +120,7 @@     glueModuleFile :: Text     glueModuleFile = toplevel <> ".nix"     cacheModuleFile :: Text-    cacheModuleFile = toplevel <> "/" <> toS name <> ".nix"+    cacheModuleFile = toplevel <> "/" <> toS (name bc) <> ".nix"     noEtcPermissionInstructions :: Text     noEtcPermissionInstructions =       [iTrim|@@ -132,7 +132,7 @@     instructions =       [iTrim| Cachix configuration written to ${glueModuleFile}.-Binary cache ${name} configuration written to ${cacheModuleFile}.+Binary cache ${name bc} configuration written to ${cacheModuleFile}.  To start using cachix add the following to your ${configurationNix}: @@ -164,10 +164,10 @@ {   nix = {     binaryCaches = [-      "${uri}"+      "${uri bc}"     ];     binaryCachePublicKeys = [-      ${T.intercalate " " (map (\s -> "\"" <> s <> "\"") publicSigningKeys)}+      ${T.intercalate " " (map (\s -> "\"" <> s <> "\"") (publicSigningKeys bc))}     ];   }; }
src/Cachix/Client/NixConf.hs view
@@ -86,13 +86,13 @@  -- | Pure version of addIO add :: BinaryCache -> [NixConf] -> NixConf -> NixConf-add BinaryCache {..} toRead toWrite =+add bc toRead toWrite =   writeLines isPublicKey (TrustedPublicKeys $ nub publicKeys)     $ writeLines isSubstituter (Substituters $ nub substituters) toWrite   where     -- Note: some defaults are always appended since overriding some setttings in nix.conf overrides defaults otherwise-    substituters = (defaultPublicURI : readLines toRead isSubstituter) <> [uri]-    publicKeys = (defaultSigningKey : readLines toRead isPublicKey) <> publicSigningKeys+    substituters = (defaultPublicURI : readLines toRead isSubstituter) <> [uri bc]+    publicKeys = (defaultSigningKey : readLines toRead isPublicKey) <> publicSigningKeys bc  defaultPublicURI :: Text defaultPublicURI = "https://cache.nixos.org"
src/Cachix/Client/Push.hs view
@@ -157,15 +157,15 @@           let fp = fingerprint storePath narHash narSize references               sig = dsign (signingSecretKey $ pushCacheSigningKey cache) fp               nic = Api.NarInfoCreate-                { cStoreHash = storeHash,-                  cStoreSuffix = storeSuffix,-                  cNarHash = narHash,-                  cNarSize = narSize,-                  cFileSize = fileSize,-                  cFileHash = toS fileHash,-                  cReferences = fmap (T.drop 11) references,-                  cDeriver = deriver,-                  cSig = toS $ B64.encode $ unSignature sig+                { Api.cStoreHash = storeHash,+                  Api.cStoreSuffix = storeSuffix,+                  Api.cNarHash = narHash,+                  Api.cNarSize = narSize,+                  Api.cFileSize = fileSize,+                  Api.cFileHash = toS fileHash,+                  Api.cReferences = fmap (T.drop 11) references,+                  Api.cDeriver = deriver,+                  Api.cSig = toS $ B64.encode $ unSignature sig                   }           escalate $ Api.isNarInfoCreateValid nic           -- Upload narinfo with signature
src/Cachix/Client/URI.hs view
@@ -19,18 +19,18 @@ -- | Partial function from URI to BaseUrl -- getBaseUrl :: URIRef Absolute -> BaseUrl-getBaseUrl URI {..} =-  case uriAuthority of+getBaseUrl uriref =+  case uriAuthority uriref of     Nothing -> panic "missing host in url"     Just authority ->       BaseUrl         getScheme         (toS (hostBS (authorityHost authority)))         getPort-        (toS uriPath)+        (toS (uriPath uriref))       where         getScheme :: Scheme-        getScheme = case uriScheme of+        getScheme = case uriScheme uriref of           UBS.Scheme "http" -> Http           UBS.Scheme "https" -> Https           _ -> panic "uri can only be http/https"