In previous versions of my configuration I used simple commands like darwin-rebuild and home-manager switch, and in flake.nix I had darwinConfigurations and homeConfigurations. But in this case, there is no homeConfigurations.
I didn’t change the configuration core, I just changed the user, tools and configs for them which I use.
I tried to use darwin-rebuild switch --flake . for it and all configuration is setup anf brew apps is installed, but home-manager isn’t working, for example, zsh not installed, or another configs from home-manager not setup
This the output of darwin-rebuild switch --flake . --verbose
qmpwwsd@qmpwwsd:~/dotfiles/ > nix build .#darwinConfigurations.qmpwwsd.system
warning: Git tree '/Users/qmpwwsd/dotfiles' is dirty
qmpwwsd@qmpwwsd:~/dotfiles/ > darwin-rebuild switch --flake . --verbose
building the system configuration...
warning: Git tree '/Users/qmpwwsd/dotfiles' is dirty
setting up Homebrew (/opt/homebrew)...
setting up Homebrew (/usr/local)...
user defaults...
restarting Dock...
setting up user launchd services...
Homebrew bundle...
Using mas
Using imagemagick
Using 1password
Using nordpass
Using discord
Using telegram
Using microsoft-teams
Using docker
Using figma
Using utm
Using miro
Using godot
Using firefox
Using google-chrome
Using obsidian
Using notion
Using raycast
Using deepl
Using aldente
Using appcleaner
Using shottr
Using keka
Using cursorcerer
Using transmission
Using plover
Using spotify
Using binance
Using meetingbar
Using eul
Using wireshark
Using keycastr
Using sf-symbols
Homebrew Bundle complete! 32 Brewfile dependencies now installed.
Error: Refusing to untap homebrew/cask because it contains the following installed formulae or casks:
1password
aldente
appcleaner
binance
cursorcerer
deepl
discord
docker
eul
figma
firefox
godot
google-chrome
keka
keycastr
meetingbar
microsoft-teams
miro
nordpass
notion
obsidian
plover
raycast
sf-symbols
shottr
spotify
telegram
transmission
utm
wireshark
setting up groups...
setting up users...
setting up /Applications/Nix Apps...
warning: /Applications/Nix Apps is not owned by nix-darwin, skipping App linking...
setting up pam...
applying patches...
setting up /etc...
system defaults...
2024-11-13 14:41:46.440 defaults[12389:356930] Could not parse: <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<string>qmpwwsd <code></string>
</plist>. Try single-quoting it
It looks like the home manager is working, because I can use some tools that are configured in the home manager configuration, but their configurations don’t work. I don’t know, maybe there is some problem with the paths. I spend all day for it but can’t find it.
I don’t think that’s likely to be an issue. Nix commands that deal with flakes generally don’t care about where the files are stored. You can even switch to a strictly remote flake with a command like darwin-rebuild switch --flake github:linnnus/nix-monorepo#muhammed!
That’s curious. When I run an equivalent command on my own configuration, I get a lot more output:
linus@muhammed$ darwin-rebuild switch --flake .#muhammed
building the system configuration...
user defaults...
setting up user launchd services...
setting up /Applications/Nix Apps...
setting up pam...
applying patches...
setting up /etc...
system defaults...
setting up launchd services...
configuring networking...
setting nvram variables...
Activating home-manager configuration for linus
Starting Home Manager activation
Activating checkFilesChanged
Activating checkLaunchAgents
Activating checkLinkTargets
Activating writeBoundary
Activating installPackages
replacing old 'home-manager-path'
installing 'home-manager-path'
Activating linkGeneration
Cleaning up orphan links from /Users/linus
No change so reusing latest profile generation 716
Creating home file links in /Users/linus
Activating onFilesChange
Activating setupLaunchAgents
As you can see, there are a lot of steps after the system defaults... step. It seems like darwin-rebuild fails at the system defaults... step when you run it. This makes sense, as the XML it complains about is invalid (the <code> tag is never closed).
I’ll take a closer looks at your configuration tomorrow. I can see from the logs you posted that the dotfiles repo is dirty. Let me know if you have made substantial local changes (i.e changes that aren’t pushed to GitHub).
Hm, this is weird. I can use your configuration just fine:
Running darwin-rebuild on my machine
linus@muhammed$ darwin-rebuild activate --flake .#qmpwwsd
warning: Git tree '/Users/linus/Source/art1es23-nixos-config' is dirty
user defaults...
setting up user launchd services...
setting up /Applications/Nix Apps...
setting up pam...
applying patches...
setting up /etc...
system defaults...
setting up launchd services...
configuring networking...
setting nvram variables...
Activating home-manager configuration for linus
Starting Home Manager activation
Activating checkFilesChanged
Activating checkLaunchAgents
Activating checkLinkTargets
Activating writeBoundary
Activating installPackages
replacing old 'home-manager-path'
installing 'home-manager-path'
Activating linkGeneration
Cleaning up orphan links from /Users/linus
No change so reusing latest profile generation 716
Creating home file links in /Users/linus
Activating onFilesChange
Activating setupLaunchAgents
Looking at the nix-darwin source. It appears that the system defaults... step is implemented here. It seems pretty straight forward, but I can’t find anywhere in your configuration which actually sets any defaults with the string qmpwwsd (though maybe it’s happening indirectly through some other option).
I’d like to see exactly what the systems defaults... step is doing. Could you give me the output of running the following commands?
My bad, that was a bit of a digression. The relevant setup code was in result/activate, not result/activate-user. Either way, I could’ve just looked it up myself.
Anyways, here’s the offending code on line 1411 of result/activate:
It seems that Home-Manager isn’t properly escaping the text, so "qmpwwsd <code>" is included verbatim in the XML passed to defaults write. It is obviously invalid XML, as the <code> tag is never closed.
Try replacing the text with something else that doesn’t clash with the XML, like "qmpwwsd (code)". If you try to switch after making that change, does that solve your issue?
I removed the property with it. Could you check now?
I forgot copy log after rebuild but it’s the second run:
qmpwwsd@qmpwwsd:~/nixos/ > nix build .#darwinConfigurations.qmpwwsd.system
qmpwwsd@qmpwwsd:~/nixos/ > darwin-rebuild switch --flake .
building the system configuration...
setting up Homebrew (/opt/homebrew)...
setting up Homebrew (/usr/local)...
user defaults...
restarting Dock...
setting up user launchd services...
Homebrew bundle...
Using mas
Using imagemagick
Using 1password
Using nordpass
Using discord
Using telegram
Using microsoft-teams
Using docker
Using figma
Using utm
Using miro
Using godot
Using firefox
Using google-chrome
Using obsidian
Using notion
Using raycast
Using deepl
Using aldente
Using appcleaner
Using shottr
Using keka
Using cursorcerer
Using transmission
Using plover
Using spotify
Using binance
Using meetingbar
Using eul
Using wireshark
Using keycastr
Using sf-symbols
Homebrew Bundle complete! 32 Brewfile dependencies now installed.
Error: Refusing to untap homebrew/cask because it contains the following installed formulae or casks:
1password
aldente
appcleaner
binance
cursorcerer
deepl
discord
docker
eul
figma
firefox
godot
google-chrome
keka
keycastr
meetingbar
microsoft-teams
miro
nordpass
notion
obsidian
plover
sf-symbols
shottr
spotify
telegram
transmission
utm
wireshark
setting up groups...
setting up users...
setting up /Applications/Nix Apps...
warning: /Applications/Nix Apps is not owned by nix-darwin, skipping App linking...
setting up pam...
applying patches...
setting up /etc...
system defaults...
setting up launchd services...
reloading nix-daemon...
waiting for nix-daemon
configuring networking...
configuring power...
setting up /Library/Fonts/Nix Fonts...
setting nvram variables...
Activating home-manager configuration for qmpwwsd
Starting Home Manager activation
Activating checkFilesChanged
Activating checkLaunchAgents
Activating checkLinkTargets
Activating writeBoundary
Activating installPackages
Activating linkGeneration
Cleaning up orphan links from /Users/qmpwwsd
No change so reusing latest profile generation 121
Creating home file links in /Users/qmpwwsd
Activating onFilesChange
Activating setupLaunchAgents
It looks that the symlinks was created (because I see them in .config) but don’t used
Well it definitely seems to work now! It makes it all the way to Activating setupLaunchAgents which is the last step when darwin-rebuild is switching to a new generation. Since we have solved the issue you posted about originally, I suggest you mark this thread as solved :^)
With regards to the changes you have made, they were probably a bit heavy-handed. You didn’t have to remove that much. You could just change the 3 lines to something like this:
I hope it’s the last problem which I would have
My friend, you helped me a lot with this problem, if it wasn’t for you I think I would never have guessed what it was
Will be great if you can help me with the last thing with this symlinks errors