-
Notifications
You must be signed in to change notification settings - Fork 6
wrapper: propagate additional check hooks to mnw derivation #10
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
base: master
Are you sure you want to change the base?
Conversation
51cc164
to
c485d8b
Compare
c485d8b
to
8a89f2e
Compare
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.
Format with nixfmt
stdenvNoCC.mkDerivation { | ||
pname = "mnw"; | ||
version = lib.getVersion neovim; | ||
|
||
buildInputs = | ||
let | ||
mkExtraCheckHook = |
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.
Why is this a separate function
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 was planning to re-use it and get some more arguments from mnw wrapper. Don't think in-lining this is the way to go here.
} hook | ||
) { }; | ||
in | ||
map (x: mkExtraCheckHook (lib.getExe (writeShellScriptBin "mnw-check-hook" x))) extraCheckHooks; |
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.
Use writeShellScript
no getExe
let | ||
mkExtraCheckHook = | ||
hook: | ||
callPackage ( |
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.
Probably don't need to callPackage this, especially because it's a list and not easy at all to override
@@ -420,5 +419,17 @@ in | |||
}; | |||
}; | |||
}; | |||
|
|||
extraCheckHooks = lib.mkOption { | |||
type = with types; listOf lines; |
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.
Remove the with
heretic
This should also possibly be a attribute set for override purposes
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.
You stink.
I was planning to convert this to an attribute set with dependencies (propagated to the setup hook builder), text and maybe an enable
? Is that too much?
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.
That's probably fine, then you can mapAttrsToList
it using the name for the writeShellScript
's name
Basic mechanism to propagate user scripts into mnw builder as setup hooks.
I would like to perform more checking on the user inputs, but couldn't think of an appropriate mechanism, and the nixfmt formatting is constantly tripping me up. You're bald.