-
Notifications
You must be signed in to change notification settings - Fork 19
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
Expose finalPackages
#68
Conversation
54f67c8
to
5708b2b
Compare
flake-module.nix
Outdated
type = types.raw; | ||
readOnly = true; | ||
internal = true; | ||
default = lib.composeManyExtensions [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The difference is the mkOverride
priority that is assigned to the definition. In case of a readOnly = true
option, it doesn't really matter which one you use, because only one definition is allowed anyway, making override priorities irrelevant.
I think placing definitions in config
is a good habit though, so I'll change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think placing definitions in
config
is a good habit though, so I'll change this.
Cool; it would also minimize the diff in this PR, I imagine, since all config
stuff lives in haskell-project.nix
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To move it back, I'd have to change haskell-project.nix
to a module instead of a function to a config
value. Basically this https://github.com/srid/haskell-flake/pull/63/files#r1100250488
I guess why not
5708b2b
to
c93938e
Compare
runtest.sh
Outdated
nix --option sandbox false \ | ||
build --override-input haskell-flake path:${FLAKE} \ | ||
-L --show-trace \ | ||
github:hercules-ci/flake.parts-website#checks.x86_64-linux.linkcheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd remove -L --show-trace
since they are not used in the commands above (or is there a reason for their inclusion, aside from debugging purposes?). Also, must sandbox be disabled for this build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sandbox was disabled in an earlier command, so I assumed that you run this in a setup where that's necessary. This build works fine in the sandbox, but I've only ever built it in a nice NixOS-based sandbox.
The verbosity is helpful when this runs in CI. You'll only look at it when it fails, and then you want all the info. Module system errors tend to need --show-trace
, at least until we have
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A proper CI solves this problem in the UI, but admittedly consuming an unpinned input like the site here isn't possible yet in Hercules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, I've changed it so that logs only appear when there's a problem. Still not great if the builder hangs, but that's unlikely to be a problem here.
1000 lines should generally be enough to show the whole log. If more, you'll be iterating the problem anyway; it doesn't log that much and extra log lines are proportional to the problems found.
flake-module.nix
Outdated
@@ -71,7 +71,7 @@ in | |||
}; | |||
}; | |||
}; | |||
projectSubmodule = types.submodule (args@{ name, config, lib, ... }: | |||
projectSubmodule = types.submoduleWith { specialArgs = { inherit pkgs self; }; modules = [ ./haskell-project.nix (args@{ name, config, lib, ... }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this happening on a single line is ugly, but I think almost all of the things that would otherwise be reindented below can move to the haskell-project.nix
module later. Doing that here would cause a large diff (again).
Keep all project config in haskell-project.nix
- `-e` is not recognized by macOS's zsh's echo command - Use current system when building the check
|
||
finalPackages = mkOption { | ||
type = types.attrsOf raw; | ||
readOnly = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like readonly
has no effect, because I can still set finalPackages.foo = ./.;
(even finalPackages = ./.;
) in test/flake.nix
?
Or does it just silently ignore user values?
#52
Access to
finalPackages
was useful for some troubleshooting.This also adds the docs to CI and adds a script to preview the docs locally.