Giter VIP home page Giter VIP logo

Comments (25)

multivac61 avatar multivac61 commented on May 2, 2024 1

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.

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024 1

Thanks for letting me know! I think I introduced a recent regression when making changes. I'll fix this in a few hours.

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024 1

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!

from nixos-config.

multivac61 avatar multivac61 commented on May 2, 2024 1

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.

from nixos-config.

multivac61 avatar multivac61 commented on May 2, 2024

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: [email protected]
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

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024

Can you try making your nixos-config a git repo, making an initial commit, then trying again?

from nixos-config.

multivac61 avatar multivac61 commented on May 2, 2024

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..

CleanShot 2023-11-12 at 16 14 30@2x

CleanShot 2023-11-12 at 16 15 17@2x

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024

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.

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024

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.

from nixos-config.

multivac61 avatar multivac61 commented on May 2, 2024

Hmmm strange. I am able to launch alacritty just fine from the Terminal. But nothing happens when I click the dock icon.

from nixos-config.

multivac61 avatar multivac61 commented on May 2, 2024

CleanShot 2023-11-14 at 12 22 46

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024

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.

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024

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:

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.

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024

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.

from nixos-config.

multivac61 avatar multivac61 commented on May 2, 2024

Hmm.. there isn't anything inside the Applications folder

CleanShot 2023-11-16 at 15 32 54

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024

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?

from nixos-config.

multivac61 avatar multivac61 commented on May 2, 2024

I am able to launch alacritty for the terminal just fine, no errors. It's just the dock that is broken.

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024

Here is what mine looks like:

Screenshot 2023-11-16 at 11 16 07β€―AM

Can you grab the latest and try to build everything again? Just want to make sure it happens on multiple builds.

from nixos-config.

multivac61 avatar multivac61 commented on May 2, 2024

I grabbed the latest and built everything again.. I even restarted the computer just in case!

CleanShot 2023-11-20 at 17 16 23

CleanShot 2023-11-20 at 17 15 54

Even tried one more time from scratch and then I got this..

CleanShot 2023-11-20 at 17 41 29

CleanShot 2023-11-20 at 17 46 51

from nixos-config.

multivac61 avatar multivac61 commented on May 2, 2024

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!

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024

@multivac61 Good to hear! Let me know if you have any questions and I'm happy to try and help.

from nixos-config.

tlindsay avatar tlindsay commented on May 2, 2024

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 πŸ˜…

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024

Hmmm, very strange. Can you paste your flake.nix here?

from nixos-config.

tlindsay avatar tlindsay commented on May 2, 2024

@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:

  • I'm a total nix noob and don't know what to watch for in build outputs
  • Managed device profile caused darwin-rebuild switch to die on the darwin/defaults LSQuarantine directive.
  • Old Home Manager version (21.11) was hitting an error when trying to apply settings because of an empty $HOME/.cache/.keep file. More info here. Upgrading to 23.11 fixed it
    • This was exacerbated a bit by the fact that the Home Manager Manual says "The state version is required and should stay at the version you originally installed.", so I was hesitant to try upgrading.
  • Improved error reporting (maybe from something like a 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 πŸ˜„

from nixos-config.

dustinlyons avatar dustinlyons commented on May 2, 2024

Oh wow, this is such great feedback! I very much appreciate you taking the time to write this (and your first draft πŸ˜†).

  • I still feel like a Nix noob, don't worry.
  • Based on your feedback, I'm going to flip the LSQuarantine directive to true in the template to avoid installation problems and add some comments around it for others to change if they want.
  • Hmm... looks like I'll need to update Home Manager as well. I'm doing a decent refactor into more idiomatic Nix (hosts and modules dirs instead of nixos and darwin at the root), so I may do it as part of that.
  • I'm in the process of porting all the 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

  • Communicate to the user everything that is happening before it does
  • Break out the build and switch steps. So the user can observe the build succeeding, and then decide to switch over their running system. Something like

nix 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!

from nixos-config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.