Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- cli :: IO ()
- parseCommand :: Parser (IO ())
- newtype Sources = Sources {}
- getSources :: IO Sources
- setSources :: Sources -> IO ()
- newtype PackageName = PackageName {}
- parsePackageName :: Parser PackageName
- newtype PackageSpec = PackageSpec {}
- attrsToSpec :: Attrs -> PackageSpec
- parsePackageSpec :: Parser PackageSpec
- parsePackage :: Parser (PackageName, PackageSpec)
- parseCmdInit :: ParserInfo (IO ())
- cmdInit :: IO ()
- parseCmdAdd :: ParserInfo (IO ())
- cmdAdd :: Maybe PackageName -> (PackageName, PackageSpec) -> IO ()
- parseCmdShow :: ParserInfo (IO ())
- cmdShow :: Maybe PackageName -> IO ()
- parseCmdUpdate :: ParserInfo (IO ())
- specToFreeAttrs :: PackageSpec -> Attrs
- specToLockedAttrs :: PackageSpec -> Attrs
- cmdUpdate :: Maybe (PackageName, PackageSpec) -> IO ()
- partitionEithersHMS :: (Eq k, Hashable k) => HashMap k (Either a b) -> (HashMap k a, HashMap k b)
- parseCmdModify :: ParserInfo (IO ())
- cmdModify :: (PackageName, PackageSpec) -> IO ()
- parseCmdDrop :: ParserInfo (IO ())
- cmdDrop :: PackageName -> [Text] -> IO ()
- decodeFileStrict :: FromJSON a => FilePath -> IO (Maybe a)
- encodeFile :: ToJSON a => FilePath -> a -> IO ()
- forWithKeyM :: (Eq k, Hashable k, Monad m) => HashMap k v1 -> (k -> v1 -> m v2) -> m (HashMap k v2)
- forWithKeyM_ :: (Eq k, Hashable k, Monad m) => HashMap k v1 -> (k -> v1 -> m ()) -> m ()
- mapWithKeyM :: (Eq k, Hashable k, Monad m) => (k -> v1 -> m v2) -> HashMap k v1 -> m (HashMap k v2)
- mapWithKeyM_ :: (Eq k, Hashable k, Monad m) => (k -> v1 -> m ()) -> HashMap k v1 -> m ()
- nixPrefetchURL :: Bool -> Text -> IO Text
- shouldUpdateNixSourcesNix :: ByteString -> Bool
- warnIfOutdated :: IO ()
- pathNixSourcesNix :: FilePath
- initNixSourcesNixContent :: ByteString
- pathNixSourcesJson :: FilePath
- initNixSourcesJsonContent :: ByteString
- abortSourcesDoesntExist :: IO a
- abortSourcesIsntAMap :: IO a
- abortAttributeIsntAMap :: IO a
- abortSourcesIsntJSON :: IO a
- abortCannotAddPackageExists :: PackageName -> IO a
- abortCannotUpdateNoSuchPackage :: PackageName -> IO a
- abortCannotModifyNoSuchPackage :: PackageName -> IO a
- abortCannotDropNoSuchPackage :: PackageName -> IO a
- abortCannotShowNoSuchPackage :: PackageName -> IO a
- abortCannotAttributesDropNoSuchPackage :: PackageName -> IO a
- abortUpdateFailed :: [(PackageName, SomeException)] -> IO a
- abortNixPrefetchExpectedOutput :: Text -> Text -> IO a
Documentation
parseCommand :: Parser (IO ()) Source #
getSources :: IO Sources Source #
setSources :: Sources -> IO () Source #
newtype PackageName Source #
Instances
Eq PackageName Source # | |
Defined in Niv.Cli (==) :: PackageName -> PackageName -> Bool # (/=) :: PackageName -> PackageName -> Bool # | |
Show PackageName Source # | |
Defined in Niv.Cli showsPrec :: Int -> PackageName -> ShowS # show :: PackageName -> String # showList :: [PackageName] -> ShowS # | |
Hashable PackageName Source # | |
Defined in Niv.Cli hashWithSalt :: Int -> PackageName -> Int # hash :: PackageName -> Int # | |
ToJSONKey PackageName Source # | |
Defined in Niv.Cli | |
FromJSONKey PackageName Source # | |
Defined in Niv.Cli |
newtype PackageSpec Source #
Instances
Show PackageSpec Source # | |
Defined in Niv.Cli showsPrec :: Int -> PackageSpec -> ShowS # show :: PackageSpec -> String # showList :: [PackageSpec] -> ShowS # | |
Semigroup PackageSpec Source # | |
Defined in Niv.Cli (<>) :: PackageSpec -> PackageSpec -> PackageSpec # sconcat :: NonEmpty PackageSpec -> PackageSpec # stimes :: Integral b => b -> PackageSpec -> PackageSpec # | |
Monoid PackageSpec Source # | |
Defined in Niv.Cli mempty :: PackageSpec # mappend :: PackageSpec -> PackageSpec -> PackageSpec # mconcat :: [PackageSpec] -> PackageSpec # | |
ToJSON PackageSpec Source # | |
Defined in Niv.Cli toJSON :: PackageSpec -> Value # toEncoding :: PackageSpec -> Encoding # toJSONList :: [PackageSpec] -> Value # toEncodingList :: [PackageSpec] -> Encoding # | |
FromJSON PackageSpec Source # | |
Defined in Niv.Cli parseJSON :: Value -> Parser PackageSpec # parseJSONList :: Value -> Parser [PackageSpec] # |
attrsToSpec :: Attrs -> PackageSpec Source #
Simply discards the Freedom
parseCmdInit :: ParserInfo (IO ()) Source #
parseCmdAdd :: ParserInfo (IO ()) Source #
cmdAdd :: Maybe PackageName -> (PackageName, PackageSpec) -> IO () Source #
parseCmdShow :: ParserInfo (IO ()) Source #
parseCmdUpdate :: ParserInfo (IO ()) Source #
specToFreeAttrs :: PackageSpec -> Attrs Source #
specToLockedAttrs :: PackageSpec -> Attrs Source #
cmdUpdate :: Maybe (PackageName, PackageSpec) -> IO () Source #
partitionEithersHMS :: (Eq k, Hashable k) => HashMap k (Either a b) -> (HashMap k a, HashMap k b) Source #
parseCmdModify :: ParserInfo (IO ()) Source #
cmdModify :: (PackageName, PackageSpec) -> IO () Source #
parseCmdDrop :: ParserInfo (IO ()) Source #
decodeFileStrict :: FromJSON a => FilePath -> IO (Maybe a) Source #
Efficiently deserialize a JSON value from a file.
If this fails due to incomplete or invalid input, Nothing
is
returned.
The input file's content must consist solely of a JSON document, with no trailing data except for whitespace.
This function parses immediately, but defers conversion. See
json
for details.
encodeFile :: ToJSON a => FilePath -> a -> IO () Source #
Efficiently serialize a JSON value as a lazy ByteString
and write it to a file.
forWithKeyM :: (Eq k, Hashable k, Monad m) => HashMap k v1 -> (k -> v1 -> m v2) -> m (HashMap k v2) Source #
mapWithKeyM :: (Eq k, Hashable k, Monad m) => (k -> v1 -> m v2) -> HashMap k v1 -> m (HashMap k v2) Source #
shouldUpdateNixSourcesNix :: ByteString -> Bool Source #
Checks if content is different than default and if it does not contain
a comment line with niv: no_update
warnIfOutdated :: IO () Source #
pathNixSourcesNix :: FilePath Source #
nix/sources.nix
initNixSourcesNixContent :: ByteString Source #
Glue code between nix and sources.json
pathNixSourcesJson :: FilePath Source #
@nix/sources.json"
initNixSourcesJsonContent :: ByteString Source #
Empty JSON map
abortSourcesDoesntExist :: IO a Source #
abortSourcesIsntAMap :: IO a Source #
abortAttributeIsntAMap :: IO a Source #
abortSourcesIsntJSON :: IO a Source #
abortCannotAddPackageExists :: PackageName -> IO a Source #
abortCannotDropNoSuchPackage :: PackageName -> IO a Source #
abortCannotShowNoSuchPackage :: PackageName -> IO a Source #
abortUpdateFailed :: [(PackageName, SomeException)] -> IO a Source #