-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
nixos/guix: init module #264323
nixos/guix: init module #264323
Conversation
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 hope you don't mind a few comments, even though this PR is marked as draft. This looks neat!
package = mkOption { | ||
type = with types; package; | ||
default = pkgs.guix; | ||
defaultText = literalExpression "pkgs.guix"; | ||
description = mdDoc '' | ||
This option specifies the Guix package to be used in the system. | ||
''; | ||
}; |
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.
package = mkOption { | |
type = with types; package; | |
default = pkgs.guix; | |
defaultText = literalExpression "pkgs.guix"; | |
description = mdDoc '' | |
This option specifies the Guix package to be used in the system. | |
''; | |
}; | |
package = mkPackageOptionMD pkgs "guix" { }; |
}; | ||
|
||
cores = mkOption { | ||
type = with types; int; |
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.
Using with types;
for everything is a bit overkill. Would you mind using types.
when it's a simple type?
type = with types; int; | |
type = types.ints.unsigned; |
}; | ||
|
||
maxJobs = mkOption { | ||
type = with types; int; |
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 = with types; int; | |
type = types.ints.unsigned; |
environment.systemPackages = [cfg.package]; | ||
|
||
systemd.services.guix-daemon = { | ||
path = [cfg.package]; |
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.
Does this program call itself at some point?
}; | ||
|
||
extraArgs = mkOption { | ||
type = with types; listOf (coercedTo anything (x: "${x}") str); |
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.
This type is a bit weird. I see what you're going for with it being easier to write ints and so on, but I think there are better ways to do this. It doesn't make sense to put bools, attrsets and probably not lists either here, unless guix can read nix syntax in its arguments. anything
will also accept types.function
, which errors out on string interpolation.
Also, AFAIK string interpolation just invokes the same logic that is used in toString
, meaning (x: "${x}")
can be replaced with toString
.
Maybe we could just keep it to listOf str
? Alternatively you could look into using lib.cli.toGNUCommandLineShell
.
options = with lib; { | ||
guix = { |
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.
This can probably be flattend down, as I'm assuming you're not planning to make options outside of guix
?
options = with lib; { | |
guix = { | |
options.guix = with lib; { |
Description of changes
Guix was recently merged #246975 . This module would configure the guix-daemon, and add guix to path, similarly to the nix-daemon module.
This is a draft PR and I've added a VM configuration to be deleted, so that changes can be quickly tested.
Todo:
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)