feat: make nh host selection automatic
This commit is contained in:
@@ -11,7 +11,7 @@ nix run .#home-manager -- switch --flake .#<username>@<host>
|
|||||||
`nh` 導入後:
|
`nh` 導入後:
|
||||||
|
|
||||||
```
|
```
|
||||||
nh os switch -H <host>
|
nh os switch
|
||||||
|
|
||||||
nh home switch -c <username>@<host>
|
nh home switch
|
||||||
```
|
```
|
||||||
|
|||||||
+6
-1
@@ -5,6 +5,11 @@ rec {
|
|||||||
x1carbon = import ./x1carbon inputs;
|
x1carbon = import ./x1carbon inputs;
|
||||||
fungus = import ./fungus inputs;
|
fungus = import ./fungus inputs;
|
||||||
};
|
};
|
||||||
nixos = builtins.mapAttrs (_: host: host.nixos) hosts;
|
nixos = builtins.listToAttrs (
|
||||||
|
map (host: {
|
||||||
|
name = host.hostname;
|
||||||
|
value = host.nixos;
|
||||||
|
}) (builtins.attrValues hosts)
|
||||||
|
);
|
||||||
home-manager = builtins.foldl' (a: b: a // b) { } (map (h: h.home-manager) (builtins.attrValues hosts));
|
home-manager = builtins.foldl' (a: b: a // b) { } (map (h: h.home-manager) (builtins.attrValues hosts));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ let
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
inherit hostname;
|
||||||
|
|
||||||
nixos = inputs.nixpkgs.lib.nixosSystem {
|
nixos = inputs.nixpkgs.lib.nixosSystem {
|
||||||
modules =
|
modules =
|
||||||
systemModules
|
systemModules
|
||||||
|
|||||||
Reference in New Issue
Block a user