difftreelog
refactor consistent module naming
in: trunk
4 files changed
README.adocdiffbeforeafterboth60 # treat the contents of this file as implementation detail60 # treat the contents of this file as implementation detail61 data = import ./fleet.nix;61 data = import ./fleet.nix;62 62 63 # globalModules section of fleet config declares modules, which are used for all configured nixos hosts.63 # nixosModules section of fleet config declares modules, which are used for all configured nixos hosts.64 globalModules = [64 nixosModules = [65 lanzaboote.nixosModules.lanzaboote65 lanzaboote.nixosModules.lanzaboote66 ({66 ({67 config,67 config,81 # Is I.e wiring up the mesh VPN, or deploying kubernetes, or other things.81 # Is I.e wiring up the mesh VPN, or deploying kubernetes, or other things.82 #82 #83 # Modules use the same semantics as standard nixos module system, they are just configuring all the hosts at once.83 # Modules use the same semantics as standard nixos module system, they are just configuring all the hosts at once.84 modules = [84 fleetModules = [85 ./wireguard85 ./wireguard86 # Multi-instancible modules example86 # Multi-instancible modules example87 (import ./kubernetes {hosts = ["a" "b"];})87 (import ./kubernetes {hosts = ["a" "b"];})93 # Every host has some system, for which the system configuration needs to be built93 # Every host has some system, for which the system configuration needs to be built94 system = "x86_64-linux";94 system = "x86_64-linux";95 # And nixos modules95 # And nixos modules96 modules = [96 nixosModules = [97 ./controlplane-1/hardware-configuration.nix97 ./controlplane-1/hardware-configuration.nix98 ./controlplane-1/configuration.nix98 ./controlplane-1/configuration.nix99 # Configuration may also be specified inline, as in any nixos config.99 # Configuration may also be specified inline, as in any nixos config.lib/default.nixdiffbeforeafterboth--- a/lib/default.nix
+++ b/lib/default.nix
@@ -8,8 +8,8 @@
nixpkgs,
overlays ? [],
hosts,
- modules,
- globalModules ? [],
+ fleetModules,
+ nixosModules ? [],
extraFleetLib ? {},
}: let
hostNames = nixpkgs.lib.attrNames hosts;
@@ -25,10 +25,10 @@
++ [
data
({...}: {
- inherit globalModules hosts overlays;
+ inherit nixosModules hosts overlays;
})
]
- ++ modules;
+ ++ fleetModules;
specialArgs = {
inherit nixpkgs fleetLib;
};
modules/fleet/meta.nixdiffbeforeafterboth--- a/modules/fleet/meta.nix
+++ b/modules/fleet/meta.nix
@@ -12,12 +12,12 @@
hostName = hostConfig.config._module.args.name;
in {
options = {
- modules = mkOption {
+ nixosModules = mkOption {
type = listOf (mkOptionType {
name = "submodule";
inherit (submodule {}) check;
merge = lib.options.mergeOneOption;
- description = "Nixos modules";
+ description = "Nixos module";
});
description = "List of nixos modules";
default = [];
@@ -42,13 +42,14 @@
};
config = {
nixosSystem = hostConfig.config.nixpkgs.lib.nixosSystem {
- inherit (hostConfig.config) system modules;
+ inherit (hostConfig.config) system;
+ modules = hostConfig.config.nixosModules;
specialArgs = {
inherit fleetLib;
fleet = hostsToAttrs (host: config.hosts.${host}.nixosSystem.config);
};
};
- modules = [
+ nixosModules = [
({...}: {
networking.hostName = mkFleetGeneratorDefault hostName;
})
@@ -68,7 +69,7 @@
default = {};
description = "Configurations of individual hosts";
};
- globalModules = mkOption {
+ nixosModules = mkOption {
type = listOf (mkOptionType {
name = "submodule";
inherit (submodule {}) check;
@@ -85,14 +86,14 @@
};
config = {
hosts = hostsToAttrs (host: {
- modules =
- config.globalModules
+ nixosModules =
+ config.nixosModules
++ [
({...}: {
nixpkgs.overlays = config.overlays;
})
];
});
- globalModules = import ../../nixos/modules/module-list.nix;
+ nixosModules = import ../../nixos/modules/module-list.nix;
};
}
modules/fleet/secrets.nixdiffbeforeafterboth--- a/modules/fleet/secrets.nix
+++ b/modules/fleet/secrets.nix
@@ -133,7 +133,7 @@
})
config.sharedSecrets;
hosts = hostsToAttrs (host: {
- modules = let
+ nixosModules = let
cleanupSecret = secretName: v: {
inherit (v) public secret;
shared = true;