Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to evaluate deployment data #4

Closed
paullotz opened this issue Jun 24, 2024 · 2 comments
Closed

Failed to evaluate deployment data #4

paullotz opened this issue Jun 24, 2024 · 2 comments

Comments

@paullotz
Copy link

paullotz commented Jun 24, 2024

Hello,
I am trying to deploy to two different nodes. Node melon works flawlessly with executing deploy .#melon. "raspberry" is a Raspberry Pi 4 which I am using with remote build set to true so this shouldnt be an issue. When executing deploy .#raspberry I get an error that I cannot resolve:

🚀 ℹ️ [deploy] [INFO] Evaluating flake in ./
warning: Git tree '/home/pl/Code/nixos-configuration' is dirty
error:
        while evaluating attribute 'nodes'
         at «string»:4:25:
            3|                       (deploy // {
            4|                         nodes = {
             |                         ^
            5|                           inherit (deploy.nodes) "raspberry";

       … while evaluating attribute 'raspberry'
         at «string»:5:50:
            4|                         nodes = {
            5|                           inherit (deploy.nodes) "raspberry";
             |                                                  ^
            6|                         };

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'raspberry' missing
       at /nix/store/hq9z5aydb080rilix1m65gb9blgw9ghq-source/flake.nix:94:15:
           93|             path = deploy-rs.lib.x86_64-linux.activate.nixos
           94|               self.nixosConfigurations.raspberry;
             |               ^
           95|           };
🚀 ❌ [deploy] [ERROR] Failed to evaluate deployment data: Evaluation resulted in a bad exit code: Some(1)

My flake.nix:

  outputs = inputs:
    with inputs;
    let
      nixpkgsWithOverlays = with inputs; rec {
        config = { allowUnfree = true; };
        overlays = [
          nur.overlay
          (_final: prev: {
            unstable = import nixpkgs-unstable {
              inherit (prev) system;
              inherit config;
            };
          })
        ];
      };

      configurationDefaults = args: {
        nixpkgs = nixpkgsWithOverlays;
        home-manager.useGlobalPkgs = true;
        home-manager.useUserPackages = true;
        home-manager.backupFileExtension = "hm-backup";
        home-manager.extraSpecialArgs = args;
      };

      argDefaults = {
        inherit inputs self nix-index-database;
        channels = { inherit nixpkgs nixpkgs-unstable; };
      };

      mkNixosConfiguration =
        { system ? "x86_64-linux", hostname, username, args ? { }, modules, }:
        let
          specialArgs = argDefaults // {
            inherit hostname username;
            vars = import ./hosts/vars.nix;
          } // args;
        in nixpkgs.lib.nixosSystem {
          inherit system specialArgs;
          modules = [
            (configurationDefaults specialArgs)
            home-manager.nixosModules.home-manager
          ] ++ modules;
        };
    in {

      deploy.nodes = {
        melon = {
          hostname = "...";
          profiles.system = {
            sshUser = "root";
            user = "root";
            remoteBuild = true;
            skipChecks = true;
            path = deploy-rs.lib.x86_64-linux.activate.nixos
              self.nixosConfigurations.melon;
          };
        };
        raspberry = {
          hostname = "....";
          profiles.system = {
            sshUser = "pl";
            user = "root";
            remoteBuild = true;
            path = deploy-rs.lib.x86_64-linux.activate.nixos
              self.nixosConfigurations.raspberry;
          };
        };
      };

      nixosConfigurations = {
        melon = mkNixosConfiguration {
          hostname = "melon";
          username = "pl";
          modules = [
            disko.nixosModules.disko

       ...
          ];
        };
      };
      
      raspberry = mkNixosConfiguration {
          hostname = "raspberry";
          username = "pl";
          system = "aarch64-linux";
          modules = [
            disko.nixosModules.disko
...
          ];
        }; 
    };
}

Any help is appreciated. thank you :)

@paullotz
Copy link
Author

Found the issue..
nixosConfigurations paraenthesis was not enclosing raspberry.

@IogaMaster
Copy link
Owner

IogaMaster commented Jun 24, 2024

Note, I have just received a Raspberry pi 3 as a gift from a friend. There will be a configuration committed soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants