-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flakes? #60
Comments
Hi @nomeata that's a good question! I've been thinking of making a copy of this repo and adapting it to work with flakes, but I don't use flakes, so can't dedicate a lot of time to it. I saw that some people tried taking that path, but abandoned the project. |
Yes, if you don’t use them yourself, I wouldn’t expect you to create that project. Let’s see how long it takes until you don’t get around flakes anymore either :-D. Or alternatively |
PRs welcome :) might just be a matter of updating getSourcesEither :: FindSourcesJson -> IO (Either SourcesError Sources)
getSourcesEither fsj = do
Dir.doesFileExist (pathNixSourcesJson fsj) >>= \case
False -> pure $ Left SourcesDoesntExist
True ->
Aeson.decodeFileStrict (pathNixSourcesJson fsj) >>= \case
Just value -> case valueToSources value of
Nothing -> pure $ Left SpecIsntAMap
Just srcs -> pure $ Right srcs
Nothing -> pure $ Left SourceIsntJSON
where
valueToSources :: Aeson.Value -> Maybe Sources
valueToSources = \case
Aeson.Object obj ->
fmap (Sources . mapKeys PackageName . KM.toHashMapText) $
traverse
( \case
Aeson.Object obj' -> Just (PackageSpec obj')
_ -> Nothing
)
obj
_ -> Nothing
mapKeys :: (Eq k2, Hashable k2) => (k1 -> k2) -> HMS.HashMap k1 v -> HMS.HashMap k2 v
mapKeys f = HMS.fromList . map (first f) . HMS.toList if you can decode the flake lock in a way that maps to |
There is also https://github.com/DeterminateSystems/update-flake-lock which might be an alternative. (I’ve opened DeterminateSystems/update-flake-lock#65 to see if they would be interested in adding the changelog listing feature) |
I am quite fond of the niv / niv-update-action combination, but it seems that the Nix world is moving to flakes, which replaces niv.
So I wonder if there is a flake-update-action that is on-par with niv-update-action (e.g. the changelog handling etc)?
Opening this issue mostly as a place for me and others to find links to other projects; I’m not actually suggesting that niv-updater-action learns about flakes (although, why not?)
The text was updated successfully, but these errors were encountered: