Starship: No such file or directory

Sometimes after using home-manager switch --flake . and then using sudo nixos-rebuild switch --upgrade --flake .#supercoolflakename sometime later, the rebuild switch doesn’t complete and it throws the following error and won’t let me cancel out:

 bash: /home/guttermonk/.nix-profile/bin/starship: No such file or directory

I usually have to close the terminal and try the rebuild switch again. Never had any problem on the second try, which is odd. Wonder if it’s a timing issue. Anyone else run into this?

Here’s my home-manager starship config:

{ config, lib, ... }: {
  programs.starship = {
    enable = true;
    settings = {
      add_newline = true;
      format = lib.concatStrings [
        "$directory"
        "$git_branch"
        "$git_state"
        "$git_status"
        "nodejs"
        "rust"
        "golang"
        "php"
        "time"
        "$character"
      ];
      directory = { 
        style = "#${config.theme.colors.border1}"; 
        format = "[ $path ]($style)";
        truncation_length = 3;
        truncation_symbol = "…/";
      };
      directory.substitutions = {
        "Documents" = "󰈙 ";
        "Downloads" = " ";
        "Music" = " ";
        "Pictures" = " ";
      };
      character = {
        success_symbol = "[ 󰤇](#${config.theme.colors.color15})[ ❯](#${config.theme.colors.color2})";
        error_symbol = "[ 󰈸](#${config.theme.colors.color9})[ ❯](#${config.theme.colors.color1})";
        vimcmd_symbol = "[❮](cyan)";
      };
      git_branch = {
        format = "[$branch]($style)";
        style = "#${config.theme.colors.color8}";
      };
      git_status = {
        format =
          "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](#${config.theme.colors.color19}) ($ahead_behind$stashed)]($style)";
        style = "#${config.theme.colors.color6}";
        conflicted = "";
        renamed = "";
        deleted = "";
        stashed = "≡";
      };
      git_state = {
        format = "([$state( $progress_current/$progress_total)]($style))";
        style = "#${config.theme.colors.color8}";
      };
      nodejs = {
        symbol = "";
        style = "bg:#${config.theme.colors.color16}";
        format = "[[ $symbol ($version) ](fg:#${config.theme.colors.border1} bg:#${config.theme.colors.color0})]($style)";
      };
      rust = {
        symbol = "";
        style = "bg:#${config.theme.colors.color16}";
        format = "[[ $symbol ($version) ](fg:#${config.theme.colors.border1} bg:#${config.theme.colors.color0})]($style)";
      };
      golang = {
        symbol = "";
        style = "bg:#${config.theme.colors.color16}";
        format = "[[ $symbol ($version) ](fg:#${config.theme.colors.border1} bg:#${config.theme.colors.color0})]($style)";
      };
      php = {
        symbol = "";
        style = "bg:#${config.theme.colors.color16}";
        format = "[[ $symbol ($version) ](fg:#${config.theme.colors.border1} bg:#${config.theme.colors.color0})]($style)";
      };
      time = {
        disabled = false;
        time_format = "%R";
        style = "bg:#${config.theme.colors.bg1}";
        format = "[[  $time ](fg:#${config.theme.colors.color23} bg:#${config.theme.colors.bg1})]($style)";
      };
    };
  };
}

--upgrade does nothing with flakes, so you can drop that flag. Use nix flake update as a separate command when needed.

I have a feeling you have something weird with your config, like you mixed the hm-as-nixos-module with hm-standalone. Hard to tell without seeing your overall config.

You nailed it, Waffles! Thank you for the suggestion. Amazing intuition. :exploding_head: :rocket:

Normally nixos config wouldn’t touch user-specific config, unless you use something like hm. So if there’s errors activating the system profile after the hm profile or vice versa, that mixing is often the cause. Glad it’s resolved :slight_smile:

1 Like

@guttermonk could you share more specifically how you fixed your configuration? I’m having the same problem as you and having a hard time figuring out the weirdness in my config.

If you did this, fix this.
Those are completely different configs.