Skip to content

nixos/vivid: init module#345656

Merged
FliegendeWurst merged 1 commit intoNixOS:masterfrom
blackheaven:nixos-vivid/init
Dec 29, 2024
Merged

nixos/vivid: init module#345656
FliegendeWurst merged 1 commit intoNixOS:masterfrom
blackheaven:nixos-vivid/init

Conversation

@blackheaven
Copy link
Copy Markdown
Contributor

I wanted a way to configure vivid (a LS_COLORS manager) 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.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 8.has: changelog This PR adds or changes release notes 8.has: module (update) This PR changes an existing module in `nixos/` labels Oct 1, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Oct 1, 2024
@blackheaven blackheaven force-pushed the nixos-vivid/init branch 2 times, most recently from b9f36f2 to 3501e6f Compare October 1, 2024 12:30
@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Oct 1, 2024
@FliegendeWurst FliegendeWurst requested a review from zowoq October 27, 2024 16:02
@Aleksanaa Aleksanaa added the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 29, 2024
@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Oct 29, 2024
@blackheaven
Copy link
Copy Markdown
Contributor Author

Can you have a look @zowoq please?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should go in 25.05 unless you want to have it backported.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Thanks, fixed.

@FliegendeWurst FliegendeWurst removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 23, 2024
@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Dec 23, 2024
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest a strength of default + 1, otherwise the assertion below doesn't really work (right?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`.

@FliegendeWurst FliegendeWurst merged commit e9d640e into NixOS:master Dec 29, 2024
pbsds added a commit to pbsds/nixpkgs that referenced this pull request Jun 2, 2025
`lib.maintainers.blackheaven` does not exist, but the github id matches `lib.maintainers.gdifolco` which corresponds with the author of NixOS#345656
@pbsds pbsds mentioned this pull request Jun 2, 2025
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants