error: 'apps.nixinate' is not an attribute set #44

Closed
opened 2023-06-29 20:36:27 +00:00 by mrVanDalo · 3 comments
mrVanDalo commented 2023-06-29 20:36:27 +00:00 (Migrated from github.com)

I get the error when I run nix flake show with the (adjusted) Example from the README.
I'm using nix version : nix (Nix) 2.15.1

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
    nixinate.url = "github:matthewcroughan/nixinate";
  };
  outputs = { self, nixpkgs, nixinate }: {
    apps = nixinate.nixinate.x86_64-linux self;
    nixosConfigurations = {
      myMachine = nixpkgs.lib.nixosSystem {
        modules = [
          {
            _module.args.nixinate = {
              host = "itchy.scratchy.com";
              sshUser = "root";
              buildOn = "remote"; # valid args are "local" or "remote"
              substituteOnTarget = true; # if buildOn is "local" then it will substitute on the target, "-s"
              hermetic = false;
            };
          }
        ];
      };
    };
  };
}

The error is :

git+file:///home/palo/dev/nixos/nixos-config?dir=nixinate
├───apps
│   └───nixinate
error: 'apps.nixinate' is not an attribute set
I get the error when I run `nix flake show` with the (adjusted) Example from the README. I'm using nix version : `nix (Nix) 2.15.1` ``` { inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; nixinate.url = "github:matthewcroughan/nixinate"; }; outputs = { self, nixpkgs, nixinate }: { apps = nixinate.nixinate.x86_64-linux self; nixosConfigurations = { myMachine = nixpkgs.lib.nixosSystem { modules = [ { _module.args.nixinate = { host = "itchy.scratchy.com"; sshUser = "root"; buildOn = "remote"; # valid args are "local" or "remote" substituteOnTarget = true; # if buildOn is "local" then it will substitute on the target, "-s" hermetic = false; }; } ]; }; }; }; } ``` The error is : ``` git+file:///home/palo/dev/nixos/nixos-config?dir=nixinate ├───apps │ └───nixinate error: 'apps.nixinate' is not an attribute set ```
CRTified commented 2023-06-29 21:46:06 +00:00 (Migrated from github.com)

The one thing missing is the system for the nixpkgs.lib.nixosSystem call. While your flake gives the error you show, this here works fine:

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
    nixinate.url = "github:matthewcroughan/nixinate";
  };
  outputs = { self, nixpkgs, nixinate }: {
    apps = nixinate.nixinate.x86_64-linux self;
    nixosConfigurations = {
      myMachine = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          {
            _module.args.nixinate = {
              host = "itchy.scratchy.com";
              sshUser = "root";
              buildOn = "remote"; # valid args are "local" or "remote"
              substituteOnTarget = true; # if buildOn is "local" then it will substitute on the target, "-s"
              hermetic = false;
            };
          }
        ];
      };
    };
  };
}

With this change, I get:

git+file:///tmp/test
├───apps
│   └───nixinate
│       ├───myMachine: app
│       └───myMachine-dry-run: app
└───nixosConfigurations
    └───myMachine: NixOS configuration
The one thing missing is the `system` for the `nixpkgs.lib.nixosSystem` call. While your flake gives the error you show, this here works fine: ```nix { inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; nixinate.url = "github:matthewcroughan/nixinate"; }; outputs = { self, nixpkgs, nixinate }: { apps = nixinate.nixinate.x86_64-linux self; nixosConfigurations = { myMachine = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ { _module.args.nixinate = { host = "itchy.scratchy.com"; sshUser = "root"; buildOn = "remote"; # valid args are "local" or "remote" substituteOnTarget = true; # if buildOn is "local" then it will substitute on the target, "-s" hermetic = false; }; } ]; }; }; }; } ``` With this change, I get: ``` git+file:///tmp/test ├───apps │ └───nixinate │ ├───myMachine: app │ └───myMachine-dry-run: app └───nixosConfigurations └───myMachine: NixOS configuration ```
mrVanDalo commented 2023-06-29 21:52:20 +00:00 (Migrated from github.com)

That works, ... thank you.

That works, ... thank you.

Closed due to fork migration, feel free to reopen.

Closed due to fork migration, feel free to reopen.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tristan/nixinate#44
No description provided.