Closed multivac61 closed 1 year ago
Another issue is that username dustin
is hardcoded inside darwin/files.nix
and is not changes when calling bin/apply
Calling nix build .#darwinConfigurations.macos.system && ./result/sw/bin/darwin-rebuild switch --flake .#macos
worked after changing dustin
to my own username.
Thanks for letting me know! I think I introduced a recent regression when making changes. I'll fix this in a few hours.
These should all be fixed now. Let me know if that's not the case.
I also updated the commands in the docs for the errors you pointed out. Thanks again, this helps a ton!
Thank you for the update Dustin!
Unfortunately I had to break the experimental flags into two
nix flake --extra-experimental-features nix-command --extra-experimental-features flakes init -t github:dustinlyons/nixos-config#starter
Otherwise I get the following error:
dustinlyons-nixos-config/nixos-config on ξ main
β― nix flake '--extra-experimental-features nix-command flakes' init -t github:dustinlyons/nixos-config#starter
error: unrecognised flag '--extra-experimental-features nix-command flakes'
Try 'nix --help' for more information.
I am not able to build using ./bin/build
dustinlyons-nixos-config/nixos-config on ξ main [?]
β― pwd
/Users/olafur/dev/dustinlyons-nixos-config/nixos-config
dustinlyons-nixos-config/nixos-config on ξ main [?]
β― chmod +x bin/apply && bin/apply
Username: olafur
Email: olafur@genkiinstruments.com
Name: Γlafur Bjarki Bogason
Is this correct? (Y/N):
y
Continuing...
User olafur information applied.
dustinlyons-nixos-config/nixos-config on ξ main [?]
β― [ -f /etc/nix/nix.conf ] && sudo mv /etc/nix/nix.conf /etc/nix/nix.conf.before-nix-darwin
dustinlyons-nixos-config/nixos-config on ξ main [?]
β― ls /etc/nix/
builder_ed25519 netrc nix.conf.before-nix-darwin@ registry.json@
builder_ed25519.pub nix.conf.before-nix-darwi nix.conf.before-nix-darwin2@
dustinlyons-nixos-config/nixos-config on ξ main [?]
β― chmod +x bin/darwin-build && chmod +x bin/build && bin/build
Starting build...
error: getting status of '/nix/store/g6pf2fqf9pwnz0mz94k1qbp51hq30803-source/nixos-config': No such file or directory
Can you try making your nixos-config a git repo, making an initial commit, then trying again?
Worked like a charm! Maybe include the git step in the tutorial too π Thank you again so much for this initiative, truly valuable!
Here is a GitHub repo I derived from your template.
Now however I am running into issues with Alacritty
. For some reason it won't start up and the dock icon is a question mark... any thoughts?
I filed a report and they told me it had something to do with a broken shell config..
Hey! Glad to hear it all worked. I will definitely add the Git step to the instructions.
In re: to the error, my configuration uses Zsh across NixOS and MacOS. I searched for the word 'fish' in my repo and yours, and can't find it. So something locally is conflicting and trying to load the fish shell and failing.
To temporarily get around this, you could try to add fish to the configuration and see if it loads. Then inspect what's in your home directory that could be causing the conflict. I actually don't know much about fish.
To add fish, you can look at shared/home-manager.nix
and add fish.enable = true;
to the top.
Sometimes I see the ? in the dock icon before running alacritty or Emacs for the first time; then the icon is set. So that doesn't necessarily point to something broken; I think Zsh is starting, then fish is trying to start, and since fish can't be found it fails and doesn't start the fish shell.
Hmmm strange. I am able to launch alacritty
just fine from the Terminal. But nothing happens when I click the dock icon.
And if you run it from the shell there, you get the fish
error? Or something else?
In my dock I get alacritty, and doing the 'Show in Finder' option shows the app inside the Nix Store. But it seems not be installed there.
I would try to get it working from the CLI (outside of the dock), maybe by trying to first simplify options in https://github.com/multivac61/dustinlyons-nixos-config/blob/main/shared/home-manager.nix#L195.
The font it uses comes from here: https://github.com/dustinlyons/nixos-config/blob/3fcc6bb4fc56d1b29991c55817f96a20f9e666d4/templates/starterWithSecrets/shared/packages.nix#L58
I recently tested this on a fresh M1 Macbook Air and was able to bootstrap it, and the fish
error is strange given fish
doesn't exist in the configuration. So it makes me feel like something else is going on.
Could also be some of these options: https://github.com/multivac61/dustinlyons-nixos-config/blob/main/shared/home-manager.nix#L10C1-L10C41
Can you try to remove and simplify these options are much as possible? You could even remove powerlevel10k
.
Hmm.. there isn't anything inside the Applications
folder
Okay, interesting. Are you able to launch alacritty from the terminal and it launches, but just the placement of the dock icon is broken? Or are there errors launching alacritty from the terminal?
I am able to launch alacritty for the terminal just fine, no errors. It's just the dock that is broken.
Here is what mine looks like:
Can you grab the latest and try to build everything again? Just want to make sure it happens on multiple builds.
I grabbed the latest and built everything again.. I even restarted the computer just in case!
Even tried one more time from scratch and then I got this..
I am 90% sure this has something to do with how I set up Alacritty
. If I remove the config dir I am able to run Alacritty
from the sidebar... need to investigate further on my end. Closing issue now.
ps thank you again for maintaining this template and continuing to work on it (love the new refactor!). I am learning a ton!
@multivac61 Good to hear! Let me know if you have any questions and I'm happy to try and help.
I'm not sure if it's actually related to this issue or not, but after running bin/build
, I'm also getting error: flake 'git+file:///my/nix/config' does not provide attribute 'packages.aarch64-darwin.default
or 'defaultPackage.aarch64-darwin'`
I see that it did install brew
, but it didn't install any brew packages, and I don't seem to have any nix packages installed either as far as I can tell.
It actually has kind of broken my whole machine, so any advice on how to fix OR rollback would be super appreciated π
Hmmm, very strange. Can you paste your flake.nix
here?
@dustinlyons I just spent like 30 minutes writing up a super detailed report on how I fixed everything, and then accidentally hit "back" and github lost it all π
The short version is:
darwin-rebuild switch
to die on the darwin/defaults
LSQuarantine
directive. $HOME/.cache/.keep
file. More info here. Upgrading to 23.11 fixed it
trap
) would be a welcome addition to the bin/build
script to help newbies know when something didn't go as expected.Last recommendation I'll make is what I think would be the most impactful: encourage some form of initial dry-run for new installs. This could be accomplished by updating the README to explain how to run a build and test it with nix-shell
or nix develop
or whatever, OR it could be built into the custom scripts in bin/
. The main thing is that I didn't realize that running bin/build
the first time would be a destructive operation to my existing development environment. And when that first build
went sideways, it left me with a lot of fires to put out.
I don't want to be a downer! I think this project is a really nice on-ramp, but it does have some pretty sharp edges and some extra guard rails would be welcome π
Oh wow, this is such great feedback! I very much appreciate you taking the time to write this (and your first draft π).
LSQuarantine
directive to true
in the template to avoid installation problems and add some comments around it for others to change if they want. hosts
and modules
dirs instead of nixos
and darwin
at the root), so I may do it as part of that.bin/
scripts over to be Nix apps (still bash
scripts though), and as part of this will flesh out more error handling. Good idea.Dry run is a great idea! I think for NixOS this is easy as I will have an option for a Live ISO soon. For nix-darwin
, I'll have to think through this, as it wants to alter your running system, change directives, update launchd, etc. Maybe something like
build
and switch
steps. So the user can observe the build succeeding, and then decide to switch over their running system. Something likenix run nix-darwin -- build --flake .#macos
first and then
darwin-rebuild switch --flake .#macos
All such good feedback I will incorporate soon. Thanks again @tlindsay!
When calling
bin/build
I get the following error