Skip to content

Commit 38f27a5

Browse files
committed
net.nix: unify source of default hostname
1 parent 0ca1faa commit 38f27a5

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

nix/net.nix

-8
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,6 @@ in
9191
# Make NixOps's deployment.* options available.
9292
./options.nix
9393
./resource.nix
94-
({ name, ... }: rec{
95-
_file = ./net.nix;
96-
key = _file;
97-
# Provide a default hostname and deployment target equal
98-
# to the attribute name of the machine in the model.
99-
networking.hostName = lib.mkOverride 900 name;
100-
deployment.targetHost = lib.mkOverride 900 name;
101-
})
10294
];
10395
}).type;
10496
};

nix/options.nix

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ config, lib, ... }:
1+
{ name, config, lib, ... }:
22

33
with lib;
44

@@ -167,6 +167,9 @@ in
167167

168168
_type = "machine";
169169

170+
# Provide a default hostname and deployment target equal
171+
# to the attribute name of the machine in the model.
172+
networking.hostName = lib.mkOverride 900 name;
170173
deployment.targetHost = mkDefault config.networking.hostName;
171174
deployment.targetPort = mkDefault (head config.services.openssh.ports);
172175

0 commit comments

Comments
 (0)