|
| 1 | +{ config, lib, modulesPath, self, ... }: |
1 | 2 | let
|
2 | 3 | getFqdn = config:
|
3 | 4 | let
|
|
7 | 8 | then "${net.hostName}.${net.domain}"
|
8 | 9 | else net.hostName;
|
9 | 10 | in
|
10 |
| - fqdn; |
11 |
| - |
12 |
| - protoModule = fullHostConfig: { config, lib, modulesPath, suites, self, inputs, ... }@args: { |
| 11 | + fqdn; |
| 12 | +in |
| 13 | + { |
13 | 14 |
|
14 |
| - imports = [ "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix" ]; |
| 15 | + imports = [ "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix" ]; |
15 | 16 |
|
16 |
| - isoImage.isoBaseName = "bootstrap-" + (getFqdn config); |
17 |
| - isoImage.contents = [{ |
18 |
| - source = self; |
19 |
| - target = "/devos/"; |
20 |
| - }]; |
21 |
| - isoImage.storeContents = [ |
22 |
| - self.devShell.${config.nixpkgs.system} |
23 |
| - # include also closures that are "switched off" by the |
24 |
| - # above profile filter on the local config attribute |
25 |
| - fullHostConfig.system.build.toplevel |
26 |
| - ] ++ builtins.attrValues inputs; |
27 |
| - # still pull in tools of deactivated profiles |
28 |
| - environment.systemPackages = fullHostConfig.environment.systemPackages; |
| 17 | + isoImage.isoBaseName = "bootstrap-" + (getFqdn config); |
| 18 | + isoImage.contents = [{ |
| 19 | + source = self; |
| 20 | + target = "/etc/nixos/"; |
| 21 | + }]; |
| 22 | + isoImage.storeContents = [ |
| 23 | + self.devShell.${config.nixpkgs.system} |
| 24 | + # include also closures that are "switched off" by the |
| 25 | + # above profile filter on the local config attribute |
| 26 | + config.system.build.toplevel |
| 27 | + ] ++ builtins.attrValues self.inputs; |
| 28 | + # still pull in tools of deactivated profiles |
29 | 29 |
|
30 |
| - # confilcts with networking.wireless which might be slightly |
31 |
| - # more useful on a stick |
32 |
| - networking.networkmanager.enable = lib.mkForce false; |
33 |
| - # confilcts with networking.wireless |
34 |
| - networking.wireless.iwd.enable = lib.mkForce false; |
| 30 | + # confilcts with networking.wireless which might be slightly |
| 31 | + # more useful on a stick |
| 32 | + networking.networkmanager.enable = lib.mkForce false; |
| 33 | + # confilcts with networking.wireless |
| 34 | + networking.wireless.iwd.enable = lib.mkForce false; |
35 | 35 |
|
36 |
| - # Set up a link-local boostrap network |
37 |
| - # See also: https://github.com/NixOS/nixpkgs/issues/75515#issuecomment-571661659 |
38 |
| - networking.usePredictableInterfaceNames = lib.mkForce true; # so prefix matching works |
39 |
| - networking.useNetworkd = lib.mkForce true; |
40 |
| - networking.useDHCP = lib.mkForce false; |
41 |
| - networking.dhcpcd.enable = lib.mkForce false; |
42 |
| - systemd.network = { |
43 |
| - # https://www.freedesktop.org/software/systemd/man/systemd.network.html |
44 |
| - networks."boostrap-link-local" = { |
45 |
| - matchConfig = { |
46 |
| - Name = "en* wl* ww*"; |
47 |
| - }; |
48 |
| - networkConfig = { |
49 |
| - Description = "Link-local host bootstrap network"; |
50 |
| - MulticastDNS = true; |
51 |
| - LinkLocalAddressing = "ipv6"; |
52 |
| - DHCP = "yes"; |
53 |
| - }; |
54 |
| - address = [ |
55 |
| - # fall back well-known link-local for situations where MulticastDNS is not available |
56 |
| - "fe80::47" # 47: n=14 i=9 x=24; n+i+x |
57 |
| - ]; |
58 |
| - extraConfig = '' |
59 |
| - # Unique, yet stable. Based off the MAC address. |
60 |
| - IPv6LinkLocalAddressGenerationMode = "eui64" |
61 |
| - ''; |
| 36 | + # Set up a link-local boostrap network |
| 37 | + # See also: https://github.com/NixOS/nixpkgs/issues/75515#issuecomment-571661659 |
| 38 | + networking.usePredictableInterfaceNames = lib.mkForce true; # so prefix matching works |
| 39 | + networking.useNetworkd = lib.mkForce true; |
| 40 | + networking.useDHCP = lib.mkForce false; |
| 41 | + networking.dhcpcd.enable = lib.mkForce false; |
| 42 | + systemd.network = { |
| 43 | + # https://www.freedesktop.org/software/systemd/man/systemd.network.html |
| 44 | + networks."boostrap-link-local" = { |
| 45 | + matchConfig = { |
| 46 | + Name = "en* wl* ww*"; |
| 47 | + }; |
| 48 | + networkConfig = { |
| 49 | + Description = "Link-local host bootstrap network"; |
| 50 | + MulticastDNS = true; |
| 51 | + LinkLocalAddressing = "ipv6"; |
| 52 | + DHCP = "yes"; |
62 | 53 | };
|
| 54 | + address = [ |
| 55 | + # fall back well-known link-local for situations where MulticastDNS is not available |
| 56 | + "fe80::47" # 47: n=14 i=9 x=24; n+i+x |
| 57 | + ]; |
| 58 | + extraConfig = '' |
| 59 | + # Unique, yet stable. Based off the MAC address. |
| 60 | + IPv6LinkLocalAddressGenerationMode = "eui64" |
| 61 | + ''; |
63 | 62 | };
|
64 | 63 | };
|
65 |
| -in |
66 |
| -{ config, ... }: |
67 |
| -{ |
68 |
| - system.build = { |
69 |
| - bootstrapIso = (config.lib.digga.mkBuild |
70 |
| - (protoModule config) |
71 |
| - ).config.system.build.isoImage; |
72 |
| - }; |
73 | 64 | }
|
74 |
| - |
0 commit comments