Skip to content

stack-to-nix: Allow custom output filenames #29

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

Merged
merged 3 commits into from
Feb 14, 2019

Conversation

rvl
Copy link
Contributor

@rvl rvl commented Feb 12, 2019

  • This brings the usage of stack-to-nix closer to stack2nix, and makes it easier to use.
  • Since there are multiple output files, writing one of them to stdout doesn't make much sense, so this is changed.
  • It also generates a template default.nix.
  • I split up Main.hs into multiple files so that it's slightly easier to follow.

TODO:

  • Generate default.nix with hnix
  • Use a pinned revision of haskell.nix in the generated code.
  • stack2nix produces a single file on stdout. It should be possible to provide such an output mode for stack-to-nix.

rvl added 3 commits February 12, 2019 11:40
Roughly dividing up the code into modules. No attempts are made to
clean anything up.
@rvl rvl added enhancement New feature or request Stack2Nix wip labels Feb 12, 2019
return $ fromString pkg $= mkPath False nix

cacheFile :: FilePath
cacheFile = ".stack-to-nix.cache"
defaultNixContents :: String
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No hnix usage to generate the ast? Should we just have a tmpl data folder, and copy the default template from there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think hnix will be the best way to generate it. String is just for the draft version.

@rvl rvl changed the title wip: Allow custom output filenames wip: stack-to-nix: Allow custom output filenames Feb 12, 2019
@rvl rvl removed the wip label Feb 14, 2019
@rvl
Copy link
Contributor Author

rvl commented Feb 14, 2019

Happy to merge this as is (for the refactoring), and do the TODO next week.

@rvl rvl changed the title wip: stack-to-nix: Allow custom output filenames stack-to-nix: Allow custom output filenames Feb 14, 2019
@angerman angerman merged commit b036b8c into master Feb 14, 2019
@rvl rvl deleted the rvl/stack-to-nix-out-dir branch February 14, 2019 23:53
rvl added a commit to input-output-hk/haskell.nix that referenced this pull request Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stack2Nix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants