Open montchr opened 2 years ago
are you trying to deploy NixOS systems from darwin, or what is the usecase here? Unfortunately we still don't have great nix-darwin support in general since we don't have any MacOS users on the core team.
The particular implementation is towards the end of: https://github.com/divnix/bud/blob/26ba27616647dcd08dac2ee818721bc748c4ac61/module.nix#L75-L88
We internally need to work with reverse DNS of the fqdn to "reliably" match hosts's to the host raking contract: nested folders are raked as reverse DNS, like so:
com
example
host1
host2
net
example
host1
host2
(sorry for that bash sequence)
are you trying to deploy NixOS systems from darwin, or what is the usecase here?
@nrdxp use case is working with a flake providing an output matching my current darwin host's hostname. The flake provides a set of configurations for nix-darwin and home-manager. Essentially just dotfiles. But I'd like to reuse these profiles on NixOS systems as I build them out (via VMs or Linodes). So at least on darwin, I'd only be using the commands that aren't NixOS-specific (e.g. bud repl
or bud switch
if it could be used with darwin-rebuild
)
@blaggacao Thanks, that points me in the right direction. I'm going to assume I'm doing something kind of wrong in the process of setting up this darwin host, as I don't think I should have ended up hitting that call to hostname
at all.
@montchr It should alwasy hit hostname
unless you'd be running already from within the host that you (still) want to build.
That is: in the devshell, it should always try to figure out your current host via hostname
.
Could you think of a BSD compatible implementation?
I think that hostname -f
works on both BSD (at least on Darwin) and Linux. Wouldn't that work?
Moved from https://github.com/divnix/devos/issues/375 because this happens with every
bud
command I've tried.Expected Behavior
On macOS/darwin systems,
bud
should detect my system's hostname.Current Behavior
Running
bud
commands on macOS 11.6 results in an error caused by callinghostname
with invalid options.bud up --help
The output of
bud up --help
also indicatesbud
was not able to get a hostname, as the name is not included in the path mentioned in the usage section:bud --help
bud repl
bud get
(via devos)DevOS' quick start guide suggests running the following command:
This also results in a similar error:
Steps to Reproduce
On macOS, run any of the commands mentioned above.
Your Environment
I'm guessing Darwin's
hostname
utility behaves differently than it would on NixOS or another Linux system.This might also apply to other systems using the BSD utilities?