-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
home-manager: check FQDN for '--flake .' attribute #5462
Conversation
Since nixpkgs commit 993baa587c4b82e791686f6ce711bcd4ee8ef933, `networking.hostName` is not allowed to be a FQDN. Add `hostname --fqdn` to the default flake attribute names that are searched. If netorking.hostname = "hostname"; networking.domain = "example.com"; is set in the system NixOS configuration, this allows defining homeConfigurations."username@hostname.example.com" = ... and still use home-manager switch --flake . instead of having to type out home-manager switch --flake .#$(whoami)@$(hostname --fqdn)
Thanks, looks good! Merged to master now 🙂 |
After this PR (I believe), I'm getting the following error on Mac OS: $ uname -a
Darwin macaw.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:14:38 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6020 arm64 arm Darwin
$ home-manager switch --impure
hostname: illegal option -- -
usage: hostname [-fs] [name-of-host]
Starting Home Manager activation
Activating checkFilesChanged
Activating checkLaunchAgents
Activating checkLinkTargets
Activating writeBoundary
Activating installPackages
nix profile remove /nix/store/b6g3p868a8lkzdq7rnf12nj9njm4szca-home-manager-path
removing 'home-manager-path'
Activating linkGeneration
Cleaning up orphan links from /Users/ilyagr
No change so reusing latest profile generation 98
Creating home file links in /Users/ilyagr
Activating onFilesChange
Activating setupLaunchAgents Update: Don't be too alarmed, the error does not prevent (I am not sure how to find out the exact commit of home-manager I'm using, but I started seeing the error recently, I believe after I updated home-manager today, and this PR looks extremely suspicious) |
Yep, this PR is the likely cause. |
If the hostname is not set in $ hostname -f
hostname: Unknown host This shows up in the hostname -f 2>/dev/null to suppress this inconsequential warning? Thank you! |
Ack, I'll make a PR some time this week. Could you file a separate issue for this and tag me? |
Description
Since nixpkgs commit 993baa587c4b82e791686f6ce711bcd4ee8ef933,
networking.hostName
is not allowed to be a FQDN.Add
hostname --fqdn
to the default flake attribute names that are searched.If
is set in the system NixOS configuration, this allows defining
and still use
instead of having to type out
Checklist
Change is backwards compatible.
homeConfigurations."username@hostname"
andhomeConfigurations."username@hostname.example.com"
.Code formatted with
./format
.Code tested through
nix-shell --pure tests -A run.all
ornix develop --ignore-environment .#all
using Flakes.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Maintainer CC