system-manager icon indicating copy to clipboard operation
system-manager copied to clipboard

Unable to Build When Using Substituters

Open EliSauder opened this issue 7 months ago • 1 comments

Describe the bug

When a flake is configured with substituters, setup fails due to "unexpected EOF reading a line" error.

When setting up a new substituter, nix requests confirmation from the user.

Logs (with substituters):

$ sudo /nix/var/nix/profiles/default/bin/nix run --extra-experimental-features 'nix-command flakes' 'github:numtide/system-manager' -- switch --flake '/etc/nix-system#my-system-name'

[2025-05-01T18:20:15Z INFO  system_manager::register] Trying flake URI: /etc/nix-system#systemConfigs.HME-LT-0413...
warning: Git tree '/etc/nix-system' is dirty
do you want to allow configuration setting 'substituters' to be set to 'https://hyprland.cachix.org https://nix-community.cachix.org https://nix-gaming.cachix.org https://cache.nixoserror: unexpected EOF reading a line
[2025-05-01T18:20:15Z INFO  system_manager::register] Attribute /etc/nix-system#systemConfigs.HME-LT-0413 not found in flake.
[2025-05-01T18:20:15Z ERROR system_manager] Explicitly provided flake URI does not point to a valid system-manager configuration: /etc/nix-system#HME-LT-0413

My logs without substituters are also failing, but due to a configuration error on my end. Here is the first section up until nix build is called.

$ sudo /nix/var/nix/profiles/default/bin/nix run --extra-experimental-features 'nix-command flakes' 'github:numtide/system-manager' -- switch --flake '/etc/nix-system#my-system-name'

[2025-05-01T18:26:46Z INFO  system_manager::register] Trying flake URI: /etc/nix-system#systemConfigs.HME-LT-0413...
warning: Git tree '/etc/nix-system' is dirty
[2025-05-01T18:26:46Z INFO  system_manager::register] Success, using /etc/nix-system#systemConfigs.HME-LT-0413
[2025-05-01T18:26:46Z INFO  system_manager::register] Building new system-manager generation...
[2025-05-01T18:26:46Z INFO  system_manager::register] Running nix build...
.
.
.

To Reproduce

Steps to reproduce the behavior:

  1. Setup flake.nix that contains a new substituter
  2. Setup system-manager configuration
  3. Attempt to run setup script

Expected behavior

Successful nix prompt to allow substituters, then continued setup with system-manager.

System information

System: Ubuntu 24.04.2 LTS Nix: 2.28.3 System-manager: main branch (commit: 803322102ed51f29c250d4bff2973625adc4a521)

Additional context

My substituters configuration:

  nixConfig = {
    substituters = [
      "https://hyprland.cachix.org"
      "https://nix-community.cachix.org"
      "https://nix-gaming.cachix.org"
      "https://cache.nixos.org"
    ];
    trusted-public-keys = [
      "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
      "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
      "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
      "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
    ];
  };

EliSauder avatar May 01 '25 18:05 EliSauder

Does it also fails if you pass the accept-flake-config nix option with: system-manager switch --nix-option accept-flake-config true --flake ... ?

jfroche avatar Aug 21 '25 00:08 jfroche