-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
services.nix-daemon: refactor into mkRemoteBuilderDesc #189837
base: master
Are you sure you want to change the base?
Conversation
If you only use the function, you lose the name and type checking of the module system. Effectively you're trying an implementation of RFC 78. To implement it without losing functionality and without duplicating code, you could
(1) and (2) can already be implemented without much decision making and enable you to reuse the function without copy-paste. (3) can be put in Fwiw, |
f69bb91
to
a74cbb7
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.
Something like these suggestions should restore the option docs and add a bit of context to errors.
I like to specify my builders on the go, in my shell. what I do is I export in my shell RUNNER1="xxxx" RUNNER2="yyyyy" which are generated from "mkRemoteBuilderDesc" that I've copy/pasted in my flake. I would like to expose mkRemoteBuilderDesc somehow but not sure how to do so. wip test Update nixos/modules/services/misc/nix-daemon.nix Co-authored-by: Robert Hensing <[email protected]> Update nixos/modules/services/misc/nix-daemon.nix Co-authored-by: Robert Hensing <[email protected]>
…erDesc can't get submodule values
4c1d79b
to
8dd0c23
Compare
@roberth I am almost there, I just can't apply the ".rendered" on a valid machine description, e.g.,
|
buildMachines = lib.mkOption { | ||
|
||
description = lib.mdDoc ''PlaceHolder''; | ||
type = lib.types.submodule (import ../../nixos/modules/services/misc/remote-builder.nix (args // { isNixAtLeastPre24 = 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.
type = lib.types.submodule (import ../../nixos/modules/services/misc/remote-builder.nix (args // { isNixAtLeastPre24 = true; })); | |
type = lib.types.submodule { | |
imports = [ ../../nixos/modules/services/misc/remote-builder.nix ]; | |
nixVersion = config.nix.package.version; | |
}; |
This way you don't have to call the module, and the module system can pass its own config
parameter to the submodule, so that the submodule works.
I think it'd be nicer to a value into a nixVersion
option than isNixAtLeastPre24
because the latter probably won't be sufficient in the future.
I like to specify my builders on the go (for various reasons, there are many factors that decide where I build), in my shell.
what I do is I export in my shell
RUNNER1="xxxx"
RUNNER2="yyyyy"
then I can run any nix command and append a --option buiilders "$RUNNER1" (any combination of the $RUNNER).
which are generated from "mkRemoteBuilderDesc" that I've copy/pasted in my flake.
I would like to expose mkRemoteBuilderDesc somehow but not sure how to
do so. In some file in lib/ ?
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes