Commit Graph

14 Commits

Author SHA1 Message Date
Parnell Springmeyer
14fa8ec148
docker2nix: inprocWithErr -> procStrictWithErr (#57)
* docker2nix: `inprocWithErr` -> `procStrictWithErr`

... because `nix` utilities will sometimes return warnings and other
information to `stderr`. The type of `inprocWithErr` makes it pretty
clear that we should expect a result of _either_ the stderr text _or_
the stdout text. Not both! Normally, this is fine because errors will
be returned on `stderr`, however this is problematic when nix outputs
warnings as the utility will end up treating them as errors.

So we need a function that will give us both and that's
`procStrictWithErr`.

* Fix CI

* Cleanup a lot of annoying compiler warnings

* Fixup prettyprinter deprecation warnings

* One more prettyprinter fix

* Swap the stdout and stderr return field bindings...

* s/Prettyprint/Prettyprinter/

* Strip whitespace from result
2023-05-05 13:21:47 -05:00
John C. Carey
9645c7ab1e Merge master 2019-03-22 18:01:04 -07:00
j6carey
b66b0bf3b6
Support newer versions of hnix... (#44)
...and avoid warnings on base library versions
in which Semigroup is a superclass of Monoid.
2019-02-22 12:43:52 -08:00
Gabriel Gonzalez
e46ed6e284 Build against hnix master
The motivation for this branch is so that `hocker` and `dhall` can both be
used within the same dependency tree.

The context for this is that `dhall` requires `megaparsec-7.0.0` or newer
whereas the latest `hnix` on Hackage only supports up to `megaparsec < 7.0`.
Since `hocker` depends on `hnix` that means that `hocker` is incompatible with
`dhall` if `hocker` depends on an `hnix` from Hackage.

However, the `master` branch of `hnix` on GitHub supports `megaparsec-7.*`, so
this change updates `hocker` to build against that.

Note that this shouldn't be merged until `hnix` pushes out a new release to
Hackage.
2018-12-06 14:25:37 -08:00
Parnell Springmeyer
e57046d678
Make the golden test files Windows-path compliant (#36)
... to appease Hackage.
2018-02-12 11:15:32 -06:00
Parnell Springmeyer
0a631f2ea0
Switch to nix-paths instead of wrapProgram (#30)
* Use nix-paths over wrapProgram

This change switches from using `wrapProgram` to supply paths to the
Nix executables to the Haskell package `nix-paths`.

There are two motivations:

1. `nix-paths` will throw a compile-time error if it cannot find a
   path for any of the primary Nix executables (Nix is a dependency of
   this package inside of nixpkgs too so we don't need to worry about
   it anymore)

2. `wrapProgram` now throws an error if globbed file paths are given
   as input

* Cleanup unused import
2018-01-05 11:09:12 -06:00
Parnell Springmeyer
ad945f89e6 Requalify all Lib.<fn> use-sites with Hocker.Lib. (#17) 2017-10-20 12:57:25 -05:00
Parnell Springmeyer
d47d136fd9 Qualify the Lib module with "Hocker" (#15)
* Update modules and imports with new qualifier

... for the lib module.

Fixes #12

* Expose Hocker.Lib
2017-10-20 12:17:32 -05:00
Parnell Springmeyer
4dd866b15d Qualify the types module with "Hocker" (#14)
* Move Types/ and Types.hs under Hocker/

* Update modules and imports with new qualifier

Fixes #11

* Turn on -Werror and sort build-depends

* Ignore unused-do-bind
2017-10-20 12:12:08 -05:00
Parnell Springmeyer
aab52668e5 Refactoring polish and haddocks documentation refactor (#7)
* Refactoring polish and haddocks documentation refactor

* Remove tested with 7.10.2 until we actually test it

* Remove the TODO header as most of that is done now
2017-06-28 13:20:56 -05:00
Parnell Springmeyer
f6f72e617b Fixing the output of docker2nix (#6)
* Fixing the output of docker2nix

- fetchdocker's function argument set needed to be a recursive set in
  order for inherits to work correctly
- fetchDockerLayers does not take a tag argument, so only inherit the
  registry, repository, and imageName attributes

* Fixing the golden test and updating the README

* Print the resulting nix expression with a trailing newline

Suggested by @Gabriel439
2017-06-12 13:55:09 -05:00
Parnell Springmeyer
c41b14e269 Fixing docker2nix's Nix expression output (#4)
* Making docker2nix's output more idiomatic

* Updating the READMEs
2017-06-11 10:23:15 -05:00
Parnell Springmeyer
f2b37ac697 AllRightsReserved => Apache-2.0 (#1) 2017-05-14 16:08:32 -05:00
Parnell Springmeyer
9b39e78744 Initial public release of hocker 2017-05-14 15:25:57 -05:00