Skip to content

den duplicating config value on import #40

@vic

Description

@vic

I put a minimal example up here: https://github.com/Cybolic/nix-den-double-import-demo

Awesome!, @Cybolic thank you so much, I managed to reduce it even further:

I removed your routes.nix, and here is the complete hosts.nix:

let
  once.nixos = { pkgs, ... }: {
    users.users.test-user.packages = [ pkgs.hello ];
  };
in
{
  den.hosts.x86_64-linux.test-host.users.test-user = { };
  den.default.includes = [ once ];
}

Here's the output:

vic@nargun ~/h/nix-den-double-import-demo> nix repl
Nix 2.31.2
Type :? for help.
nix-repl> :lf . 
warning: Git tree is dirty
Added 23 variables.

nix-repl> outputs.nixosConfigurations.test-host.config.users.users.test-user.packages
[
  «derivation /nix/store/dzgpbp0vp7lj7lgj26rjgmnjicq2wf4k-hello-2.12.2.drv»
  «repeated»
  «repeated»
]

This correctly reproduces the bug (even worse, in my reduced example, we have THREE packages, when there should be only one). The problem was not submodules (attrs) but arrays, den is duplicating values and they are evident at arrays.

Thanks to both of you for helping find the bug. I will open an issue!

Originally posted by @vic in #35 (reply in thread)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions