Closed srid closed 2 months ago
I tried to temporarily make this work in a somewhat hacky way since:
But it doesn't work for some reason.
If you have any ideas on a quick work-around it would save me the time of having to go back to flake-utils-plus where I know how to do this. Long term I think I want a flake-parts based config... I think :)
Here's my code:
{
# ...
outputs = inputs@{ self, ... }:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
# ...
flake = {
nixosConfigurations = {
laptop = self.nixos-flake.lib.mkLinuxSystem {
imports = [
self.nixosModules.default
./nixos/gui/wayland.nix
{
# not ideal, see https://github.com/srid/nixos-flake/issues/19
home-manager.users.paretoOptimalDev = [
./home/window-manager/sway.nix
];
}
];
};
};
};
};
}
Well, this should be straightforward to implement, right?
Look for hostname (fallback to $USER), and then use that to set the attribute here ... all done in the bash script:
Ideally we want to have that in this repo, but for quick workaround, you can simply add a writeShellApplication
based flake app that does this.
Alright, checkout #60
With it, you can do nix run . $USER@$HOSTNAME
cc @bketelsen
Basically add hostname, along with username, to the
legacyPackages.homeConfigurations
keys.Then
nix run .#activate -- --home
(see #18) knows which configuration to activate.