-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: Provide a devShell
with packages from enabled services
#355
base: main
Are you sure you want to change the base?
Conversation
devShell
with packages from enabled services
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.
LGTM, with these changes.
nix/services/default.nix
Outdated
# Output = [ <cfg1> <cfg2> <cfg3> ] | ||
(lib.foldlAttrs (acc: _: v: (lib.attrValues v) ++ acc) [ ]) | ||
(lib.filter (service: service.enable)) | ||
(map (service: service.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.
This assumes that all services -- and services to be added in future -- have package
option, right?
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.
Yes
nix/services/default.nix
Outdated
# `outputs` is a reserved attribute set and is not the name of a service. | ||
(lib.filterAttrs (n: _: n != "outputs")) | ||
# Flatten services attrset | ||
# | ||
# Example: | ||
# Input = { mysql."m1" = <cfg1>; mysql."m2" = <cfg2>; redis."r1" = <cfg3>; } | ||
# Output = [ <cfg1> <cfg2> <cfg3> ] | ||
(lib.foldlAttrs (acc: _: v: (lib.attrValues v) ++ acc) [ ]) | ||
(lib.filter (service: service.enable)) |
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 can possibly move this to services.outputs.enabledServices
option, thus simplifying the code here.
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 could just be listOf string
, fwiw.
resolves #194