Skip to content

Creating nixosConfigurations.<hostname> but <hostname> is a darwin system #48

@m-spitfire

Description

@m-spitfire

Issue

I have a MacBook and a server. I wanted to use denix to manage my nix configurations. But running nix flake check .# as told in the documentation gave me following error

 … while checking flake output 'nixosConfigurations'
   at /nix/store/4nhqfb9a4pmc1xi7bdg7qry4mfas2v34-source/flake.nix:52:7:
     51|       # you can safely remove the corresponding lines below.
     52|       nixosConfigurations = mkConfigurations "nixos";
       |       ^
     53|       homeConfigurations = mkConfigurations "home";

 … while checking the NixOS configuration 'nixosConfigurations.desktop'
   at /nix/store/8qqm1vy9alwailivcy085pzaf11m4fy7-source/lib/configurations/default.nix:253:19:
    252|                 lib.optionalAttrs (!rice.inheritanceOnly or false) {
    253|                   "${lib.optionalString (moduleSystem == "home") "${host.homeManagerUser}@"}${hostName}${
       |                   ^
    254|                     lib.optionalString (riceName != null) "-${riceName}"
error: The option `home-manager.users.muradb.home.homeDirectory' has conflicting definition values:
- In `/nix/store/4nhqfb9a4pmc1xi7bdg7qry4mfas2v34-source/modules/config/home.nix': "/Users/muradb"
- In `/nix/store/mnc7gdgqpmqxi0s4nyqdk6p2n50yvgin-source/nixos/common.nix': "/home/muradb"
Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions.

This is because even though mkConfigurations "nixos" call generates nixosConfigurations.desktop entry even though the system argument in delib.host call is aarch64-darwin. I don't know if this is the intended behavior, but if it is it's very strange to generate nixosConfigurations or darwinConfigurations for every host. I kept the mkConfigurations "nixos" call since I want to add my server configurations which is running nixos.

To reproduce

nix flake init -t github:yunfachi/denix#minimal

And made following edits:

  1. edit hosts/desktop/*.nix
  2. system to "aarch64-darwin"
  3. delete nixos key entirely from hardware.nix
  4. home.home.stateVersion to "25.05"
  5. change values in modules/config/constants.nix to appropriate values
  6. edit flake.nix changing homeManagerUser arg in denix.lib.configurations call to appropriate value

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions