nixos/vivid: init module#345656
Conversation
b9f36f2 to
3501e6f
Compare
|
Can you have a look @zowoq please? |
There was a problem hiding this comment.
Should go in 25.05 unless you want to have it backported.
There was a problem hiding this comment.
Nice catch! Thanks, fixed.
3501e6f to
e7d968b
Compare
nixos/modules/programs/vivid.nix
Outdated
There was a problem hiding this comment.
I would suggest a strength of default + 1, otherwise the assertion below doesn't really work (right?)
There was a problem hiding this comment.
I would suggest a strength of default + 1,
I've used mkOverride 999, which is mkDefault - 1 (so, a higher priority), is it correct or is there a more idiomatic way to do it?
otherwise the assertion below doesn't really work (right?)
Let me come up with a simple case.
There was a problem hiding this comment.
is it correct or is there a more idiomatic way to do it?
It seems like the best option to me. You essentially want to replace the default value with another default. There are 3 other uses of the pattern I can find.
There was a problem hiding this comment.
Assertions are working:
-- sandbox.nix
{ config, pkgs, ... }:
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
programs = {
vivid.enable = true;
bash.enableLsColors = true;
zsh.enableLsColors = false;
};
system.stateVersion = "25.05";
}
gives:
$ nix-build './nixos' -A vm -I nixos-config=./sandbox.nix
error:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:34:12:
33|
34| strict = derivationStrict drvAttrs;
| ^
35|
… while evaluating derivation 'nixos-vm'
whose name attribute is located at /home/black/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:375:7
… while evaluating attribute 'buildCommand' of derivation 'nixos-vm'
at /home/black/nixpkgs/pkgs/build-support/trivial-builders/default.nix:59:17:
58| enableParallelBuilding = true;
59| inherit buildCommand name;
| ^
60| passAsFile = [ "buildCommand" ]
… while evaluating the option `virtualisation.vmVariant.system.build.toplevel':
… while evaluating definitions from `/home/black/nixpkgs/nixos/modules/system/activation/top-level.nix':
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error:
Failed assertions:
- `programs.vivid.enable` is incompatible with `programs.bash.enableLsColors`.
e7d968b to
dc24d11
Compare
dc24d11 to
4e57e46
Compare
`lib.maintainers.blackheaven` does not exist, but the github id matches `lib.maintainers.gdifolco` which corresponds with the author of NixOS#345656
I wanted a way to configure
vivid(aLS_COLORSmanager) simply, but it requires disable default flags from other moducle, so it seems more foolproof to have a dedicated module for this.Things done
Created a module
programs.vivid.nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.