-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
easyeffects: add option to import presets #6267
base: master
Are you sure you want to change the base?
Conversation
ef51b15
to
4463220
Compare
modules/services/easyeffects.nix
Outdated
extraInputPresets = presetOptionType; | ||
extraOutputPresets = presetOptionType; |
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.
Maybe this could simply be
extraInputPresets = presetOptionType; | |
extraOutputPresets = presetOptionType; | |
extraPresets = presetOptionType; |
where the "input" or "output" field inside the preset determine whether it is for input or output?
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 is, the type of this option would be something like attrsOf presetType
where presetType
would be the regular JSON type with the additional requirement that it is an object containing either an "input" or "output" field. In practice I think this would look something like
presetType = let baseType = attrsOf jsonFormat.type; in baseType // {
check = v: baseType.check v && elem (attrNames v) == [ ["input"] ["output"] ];
description = "EasyEffects input or output JSON preset";
}
Completely untested so I'm not certain it will work very well.
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.
Thanks for the input, i really appreciate it!
I agree, it makes much more sense to have it in one attribute set, so i've modified it based on your suggestions.
I'm fairly inexperienced with programming in nix, so this feedback helped a lot.
Let me know if there is anything that comes to mind
added options to import presets added tests added hausken as maintainer
4463220
to
f50c5ca
Compare
Description
Checklist
Change is backwards compatible.
Code formatted with
./format
.Code tested through
nix-shell --pure tests -A run.all
ornix develop --ignore-environment .#all
using Flakes.(tested with
nix-shell --pure tests -A run.easyeffects-service
andnix-shell --pure tests -A run.easyeffects-example-preset
)Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Maintainer CC
@fufexan