dustinlyons / nixos-config

General purpose Nix configuration for macOS / NixOS with starter templates + step-by-step guides ✨
BSD 3-Clause "New" or "Revised" License
1.72k stars 109 forks source link

NixOS install `./bin/apply: No such file or directory` #40

Closed adamecooper closed 10 months ago

adamecooper commented 10 months ago

Hi Dustin,

I'm following the README instructions for NixOS, and the install step is erroring out:

$ sudo nix run --extra-experimental-features 'nix-command flakes' github:dustinlyons/nixos-config#install
Running install for x86_64-linux
+ cleanup
+ rm -rf nixos-config-main.zip nixos-config-main nixos-config
+ check_installer
+ '[' -e /etc/NIXOS ']'
+ echo -e '\e[1;32mRunning in the NixOS installer environment.\e[0m'
Running in the NixOS installer environment.
+ download_config
+ curl -LJ0 https://github.com/dustinlyons/nixos-config/archive/main.zip -o nixos-config-main.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 2320k    0 2320k    0     0  4661k      0 --:--:-- --:--:-- --:--:-- 4661k
+ unzip nixos-config-main.zip
Archive:  nixos-config-main.zip
090115311285ad626e1d1b4e3614efbbf695c35e
   creating: nixos-config-main/
   creating: nixos-config-main/.github/
  inflating: nixos-config-main/.github/dependabot.yml  
   creating: nixos-config-main/.github/workflows/
  inflating: nixos-config-main/.github/workflows/build-template.yml  
  inflating: nixos-config-main/.github/workflows/build.yml  
  inflating: nixos-config-main/.github/workflows/lint.yml  
  inflating: nixos-config-main/.github/workflows/update-flake-lock.yml  
 extracting: nixos-config-main/.gitignore  
  inflating: nixos-config-main/LICENSE  
  inflating: nixos-config-main/README.md  
   creating: nixos-config-main/apps/
  inflating: nixos-config-main/apps/README.md  
   creating: nixos-config-main/apps/aarch64-darwin/
  inflating: nixos-config-main/apps/aarch64-darwin/apply  
  inflating: nixos-config-main/apps/aarch64-darwin/build  
  inflating: nixos-config-main/apps/aarch64-darwin/build-switch  
  inflating: nixos-config-main/apps/aarch64-darwin/check-keys  
  inflating: nixos-config-main/apps/aarch64-darwin/copy-keys  
  inflating: nixos-config-main/apps/aarch64-darwin/create-keys  
    linking: nixos-config-main/apps/aarch64-linux  -> x86_64-linux 
   creating: nixos-config-main/apps/x86_64-linux/
  inflating: nixos-config-main/apps/x86_64-linux/apply  
  inflating: nixos-config-main/apps/x86_64-linux/build-switch  
  inflating: nixos-config-main/apps/x86_64-linux/check-keys  
  inflating: nixos-config-main/apps/x86_64-linux/copy-keys  
  inflating: nixos-config-main/apps/x86_64-linux/create-keys  
  inflating: nixos-config-main/apps/x86_64-linux/install  
  inflating: nixos-config-main/apps/x86_64-linux/install-with-secrets  
  inflating: nixos-config-main/flake.lock  
  inflating: nixos-config-main/flake.nix  
   creating: nixos-config-main/hosts/
   creating: nixos-config-main/hosts/darwin/
  inflating: nixos-config-main/hosts/darwin/default.nix  
   creating: nixos-config-main/hosts/nixos/
  inflating: nixos-config-main/hosts/nixos/default.nix  
   creating: nixos-config-main/modules/
   creating: nixos-config-main/modules/darwin/
  inflating: nixos-config-main/modules/darwin/README.md  
  inflating: nixos-config-main/modules/darwin/casks.nix  
   creating: nixos-config-main/modules/darwin/dock/
  inflating: nixos-config-main/modules/darwin/dock/default.nix  
  inflating: nixos-config-main/modules/darwin/files.nix  
  inflating: nixos-config-main/modules/darwin/home-manager.nix  
  inflating: nixos-config-main/modules/darwin/packages.nix  
  inflating: nixos-config-main/modules/darwin/secrets.nix  
   creating: nixos-config-main/modules/nixos/
  inflating: nixos-config-main/modules/nixos/README.md  
   creating: nixos-config-main/modules/nixos/config/
  inflating: nixos-config-main/modules/nixos/config/login-wallpaper.png  
   creating: nixos-config-main/modules/nixos/config/polybar/
  inflating: nixos-config-main/modules/nixos/config/polybar/bars.ini  
  inflating: nixos-config-main/modules/nixos/config/polybar/colors.ini  
  inflating: nixos-config-main/modules/nixos/config/polybar/config.ini  
  inflating: nixos-config-main/modules/nixos/config/polybar/modules.ini  
  inflating: nixos-config-main/modules/nixos/config/polybar/user_modules.ini  
   creating: nixos-config-main/modules/nixos/config/rofi/
  inflating: nixos-config-main/modules/nixos/config/rofi/colors.rasi  
  inflating: nixos-config-main/modules/nixos/config/rofi/confirm.rasi  
  inflating: nixos-config-main/modules/nixos/config/rofi/launcher.rasi  
  inflating: nixos-config-main/modules/nixos/config/rofi/message.rasi  
  inflating: nixos-config-main/modules/nixos/config/rofi/networkmenu.rasi  
  inflating: nixos-config-main/modules/nixos/config/rofi/powermenu.rasi  
  inflating: nixos-config-main/modules/nixos/config/rofi/styles.rasi  
  inflating: nixos-config-main/modules/nixos/disk-config.nix  
  inflating: nixos-config-main/modules/nixos/files.nix  
  inflating: nixos-config-main/modules/nixos/home-manager.nix  
  inflating: nixos-config-main/modules/nixos/packages.nix  
  inflating: nixos-config-main/modules/nixos/secrets.nix  
   creating: nixos-config-main/modules/shared/
  inflating: nixos-config-main/modules/shared/README.md  
   creating: nixos-config-main/modules/shared/cachix/
  inflating: nixos-config-main/modules/shared/cachix/default.nix  
   creating: nixos-config-main/modules/shared/config/
   creating: nixos-config-main/modules/shared/config/emacs/
 extracting: nixos-config-main/modules/shared/config/emacs/.gitignore  
  inflating: nixos-config-main/modules/shared/config/emacs/config.org  
  inflating: nixos-config-main/modules/shared/config/emacs/init.el  
  inflating: nixos-config-main/modules/shared/config/p10k.zsh  
  inflating: nixos-config-main/modules/shared/default.nix  
  inflating: nixos-config-main/modules/shared/files.nix  
  inflating: nixos-config-main/modules/shared/home-manager.nix  
  inflating: nixos-config-main/modules/shared/packages.nix  
   creating: nixos-config-main/overlays/
  inflating: nixos-config-main/overlays/10-feather-font.nix  
  inflating: nixos-config-main/overlays/README.md  
   creating: nixos-config-main/templates/
   creating: nixos-config-main/templates/starter-with-secrets/
   creating: nixos-config-main/templates/starter-with-secrets/apps/
   creating: nixos-config-main/templates/starter-with-secrets/apps/aarch64-darwin/
  inflating: nixos-config-main/templates/starter-with-secrets/apps/aarch64-darwin/apply  
  inflating: nixos-config-main/templates/starter-with-secrets/apps/aarch64-darwin/build  
  inflating: nixos-config-main/templates/starter-with-secrets/apps/aarch64-darwin/build-switch  
  inflating: nixos-config-main/templates/starter-with-secrets/apps/aarch64-darwin/check-keys  
  inflating: nixos-config-main/templates/starter-with-secrets/apps/aarch64-darwin/copy-keys  
  inflating: nixos-config-main/templates/starter-with-secrets/apps/aarch64-darwin/create-keys  
    linking: nixos-config-main/templates/starter-with-secrets/apps/aarch64-linux  -> x86_64-linux 
   creating: nixos-config-main/templates/starter-with-secrets/apps/x86_64-linux/
  inflating: nixos-config-main/templates/starter-with-secrets/apps/x86_64-linux/apply  
  inflating: nixos-config-main/templates/starter-with-secrets/apps/x86_64-linux/build-switch  
  inflating: nixos-config-main/templates/starter-with-secrets/flake.nix  
   creating: nixos-config-main/templates/starter-with-secrets/hosts/
   creating: nixos-config-main/templates/starter-with-secrets/hosts/darwin/
  inflating: nixos-config-main/templates/starter-with-secrets/hosts/darwin/default.nix  
   creating: nixos-config-main/templates/starter-with-secrets/hosts/nixos/
  inflating: nixos-config-main/templates/starter-with-secrets/hosts/nixos/default.nix  
   creating: nixos-config-main/templates/starter-with-secrets/modules/
   creating: nixos-config-main/templates/starter-with-secrets/modules/darwin/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/darwin/README.md  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/darwin/casks.nix  
   creating: nixos-config-main/templates/starter-with-secrets/modules/darwin/dock/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/darwin/dock/default.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/darwin/files.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/darwin/home-manager.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/darwin/packages.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/darwin/secrets.nix  
   creating: nixos-config-main/templates/starter-with-secrets/modules/nixos/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/README.md  
   creating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/login-wallpaper.png  
   creating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/polybar/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/polybar/bars.ini  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/polybar/colors.ini  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/polybar/config.ini  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/polybar/modules.ini  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/polybar/user_modules.ini  
   creating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/colors.rasi  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/confirm.rasi  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/launcher.rasi  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/message.rasi  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/networkmenu.rasi  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/powermenu.rasi  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/config/rofi/styles.rasi  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/disk-config.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/files.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/home-manager.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/packages.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/nixos/secrets.nix  
   creating: nixos-config-main/templates/starter-with-secrets/modules/shared/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/README.md  
   creating: nixos-config-main/templates/starter-with-secrets/modules/shared/cachix/
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/cachix/default.nix  
   creating: nixos-config-main/templates/starter-with-secrets/modules/shared/config/
   creating: nixos-config-main/templates/starter-with-secrets/modules/shared/config/emacs/
 extracting: nixos-config-main/templates/starter-with-secrets/modules/shared/config/emacs/.gitignore  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/config/emacs/config.org  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/config/emacs/init.el  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/config/p10k.zsh  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/default.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/files.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/home-manager.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/modules/shared/packages.nix  
   creating: nixos-config-main/templates/starter-with-secrets/overlays/
  inflating: nixos-config-main/templates/starter-with-secrets/overlays/10-feather-font.nix  
  inflating: nixos-config-main/templates/starter-with-secrets/overlays/README.md  
   creating: nixos-config-main/templates/starter/
   creating: nixos-config-main/templates/starter/apps/
   creating: nixos-config-main/templates/starter/apps/aarch64-darwin/
  inflating: nixos-config-main/templates/starter/apps/aarch64-darwin/apply  
  inflating: nixos-config-main/templates/starter/apps/aarch64-darwin/build  
  inflating: nixos-config-main/templates/starter/apps/aarch64-darwin/build-switch  
    linking: nixos-config-main/templates/starter/apps/aarch64-linux  -> x86_64-linux 
   creating: nixos-config-main/templates/starter/apps/x86_64-linux/
  inflating: nixos-config-main/templates/starter/apps/x86_64-linux/apply  
  inflating: nixos-config-main/templates/starter/apps/x86_64-linux/build-switch  
  inflating: nixos-config-main/templates/starter/flake.nix  
   creating: nixos-config-main/templates/starter/hosts/
   creating: nixos-config-main/templates/starter/hosts/darwin/
  inflating: nixos-config-main/templates/starter/hosts/darwin/default.nix  
   creating: nixos-config-main/templates/starter/hosts/nixos/
  inflating: nixos-config-main/templates/starter/hosts/nixos/default.nix  
   creating: nixos-config-main/templates/starter/modules/
   creating: nixos-config-main/templates/starter/modules/darwin/
  inflating: nixos-config-main/templates/starter/modules/darwin/README.md  
  inflating: nixos-config-main/templates/starter/modules/darwin/casks.nix  
   creating: nixos-config-main/templates/starter/modules/darwin/dock/
  inflating: nixos-config-main/templates/starter/modules/darwin/dock/default.nix  
  inflating: nixos-config-main/templates/starter/modules/darwin/files.nix  
  inflating: nixos-config-main/templates/starter/modules/darwin/home-manager.nix  
  inflating: nixos-config-main/templates/starter/modules/darwin/packages.nix  
   creating: nixos-config-main/templates/starter/modules/nixos/
  inflating: nixos-config-main/templates/starter/modules/nixos/README.md  
   creating: nixos-config-main/templates/starter/modules/nixos/config/
  inflating: nixos-config-main/templates/starter/modules/nixos/config/login-wallpaper.png  
   creating: nixos-config-main/templates/starter/modules/nixos/config/polybar/
  inflating: nixos-config-main/templates/starter/modules/nixos/config/polybar/bars.ini  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/polybar/colors.ini  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/polybar/config.ini  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/polybar/modules.ini  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/polybar/user_modules.ini  
   creating: nixos-config-main/templates/starter/modules/nixos/config/rofi/
  inflating: nixos-config-main/templates/starter/modules/nixos/config/rofi/colors.rasi  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/rofi/confirm.rasi  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/rofi/launcher.rasi  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/rofi/message.rasi  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/rofi/networkmenu.rasi  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/rofi/powermenu.rasi  
  inflating: nixos-config-main/templates/starter/modules/nixos/config/rofi/styles.rasi  
  inflating: nixos-config-main/templates/starter/modules/nixos/disk-config.nix  
  inflating: nixos-config-main/templates/starter/modules/nixos/files.nix  
  inflating: nixos-config-main/templates/starter/modules/nixos/home-manager.nix  
  inflating: nixos-config-main/templates/starter/modules/nixos/packages.nix  
   creating: nixos-config-main/templates/starter/modules/shared/
  inflating: nixos-config-main/templates/starter/modules/shared/README.md  
   creating: nixos-config-main/templates/starter/modules/shared/cachix/
  inflating: nixos-config-main/templates/starter/modules/shared/cachix/default.nix  
   creating: nixos-config-main/templates/starter/modules/shared/config/
   creating: nixos-config-main/templates/starter/modules/shared/config/emacs/
 extracting: nixos-config-main/templates/starter/modules/shared/config/emacs/.gitignore  
  inflating: nixos-config-main/templates/starter/modules/shared/config/emacs/config.org  
  inflating: nixos-config-main/templates/starter/modules/shared/config/emacs/init.el  
  inflating: nixos-config-main/templates/starter/modules/shared/config/p10k.zsh  
  inflating: nixos-config-main/templates/starter/modules/shared/default.nix  
  inflating: nixos-config-main/templates/starter/modules/shared/files.nix  
  inflating: nixos-config-main/templates/starter/modules/shared/home-manager.nix  
  inflating: nixos-config-main/templates/starter/modules/shared/packages.nix  
   creating: nixos-config-main/templates/starter/overlays/
  inflating: nixos-config-main/templates/starter/overlays/10-feather-font.nix  
  inflating: nixos-config-main/templates/starter/overlays/README.md  
finishing deferred symbolic links:
  nixos-config-main/apps/aarch64-linux -> x86_64-linux
  nixos-config-main/templates/starter-with-secrets/apps/aarch64-linux -> x86_64-linux
  nixos-config-main/templates/starter/apps/aarch64-linux -> x86_64-linux
+ mv nixos-config-main/templates/starter nixos-config
+ cd nixos-config
+ run_apply
+ ./bin/apply
/nix/store/9vi19cpxijbhf6h0kcr07wl40d53qbzv-source/apps/x86_64-linux/install: line 25: ./bin/apply: No such file or directory

Do you know how to resolve this? Thanks for making this repository public by the way; it's been a very helpful learning resource.

adamecooper commented 10 months ago

The apply script is available in the nix store:

ls -l /nix/store/9vi19cpxijbhf6h0kcr07wl40d53qbzv-source/apps/x86_64-linux/       
total 32
-r-xr-xr-x 1 root root 4144 Dec 31  1969 apply
-r-xr-xr-x 1 root root  580 Dec 31  1969 build-switch
-r-xr-xr-x 1 root root 1019 Dec 31  1969 check-keys
-r-xr-xr-x 1 root root 1807 Dec 31  1969 copy-keys
-r-xr-xr-x 1 root root  688 Dec 31  1969 create-keys
-r-xr-xr-x 1 root root 1722 Dec 31  1969 install
-r-xr-xr-x 1 root root 2592 Dec 31  1969 install-with-secrets

I think the issue may be caused by using the relative path (./bin/apply) to call apply.

dustinlyons commented 10 months ago

Hi @adamecooper, thanks for bringing this to my attention. I recently refactored a bunch and it looks like I introduced a regression. Let me take a look and see if I can run through the x86_64-linux install.

./bin/apply was the old directory path.

dustinlyons commented 10 months ago

I made a fix to the incorrect ./bin/apply path. Can you try again?

adamecooper commented 10 months ago

Hi @dustinlyons, I just ran the install command again, and got a new error this time :)

...
+ run_disko
+ sudo nix run --extra-experimental-features nix-command --extra-experimental-features flakes github:nix-community/disko -- --mode zap_create_mount ./nixos/disk-config.nix
aborted: disko config must be an existing file or flake must be set
dustinlyons commented 10 months ago

@adamecooper Oops, I missed that path too. Thanks for being the tester today :)

I just fixed that path.

Apologies, I don't have much time today to test the install end-to-end but this should work now.

adamecooper commented 10 months ago

@dustinlyons no worries, thank you so much for making these fixes! The installation appears to be proceeding successfully now. Will report back once it completes.

adamecooper commented 10 months ago

@dustinlyons, confirming that the installation was successful :tada: Time to start customizing. Thanks again for the help, and happy new year!

dustinlyons commented 10 months ago

Awesome, great to hear. Thanks for finding some bugs! Happy new year and feel free to reach out if you have any Nix questions.