difftreelog
refactor drop long deprecated configs
in: trunk
5 files changed
modules/meta.nixdiffbeforeafterboth--- a/modules/meta.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-{ lib, ... }:
-let
- inherit (lib.modules) mkRemovedOptionModule;
-in
-{
- imports = [
- (mkRemovedOptionModule [ "fleetModules" ] "replaced with imports.")
- ];
-}
modules/module-list.nixdiffbeforeafterboth--- a/modules/module-list.nix
+++ b/modules/module-list.nix
@@ -2,7 +2,6 @@
./assertions.nix
./fleetLib.nix
./hosts.nix
- ./meta.nix
./nixos.nix
./nixpkgs.nix
./secrets.nix
modules/nixos.nixdiffbeforeafterboth1{2 lib,3 fleetLib,4 inputs,5 self,6 config,7 _fleetFlakeRootConfig,8 ...9}:10let11 inherit (lib.attrsets) mapAttrs;12 inherit (lib.options) mkOption;13 inherit (lib.types) deferredModule unspecified;14 inherit (lib.modules) mkRemovedOptionModule;15 inherit (lib.strings) escapeNixIdentifier;16 inherit (fleetLib.options) mkHostsOption;1718 _file = ./nixos.nix;19in20{21 options = {22 nixos = mkOption {23 description = ''24 Shared nixos configuration module for all hosts.25 '';26 type = deferredModule;27 };28 hosts = mkHostsOption (hostArgs: {29 inherit _file;30 options = {31 nixos = mkOption {32 description = ''33 Nixos configuration for the current host.34 '';35 type = deferredModule;36 apply =37 module:38 let39 modulesPath = "${config.nixpkgs.buildUsing}/nixos/modules";40 in41 config.nixpkgs.buildUsing.lib.evalModules {42 class = "nixos";43 prefix = ["fleetConfiguration" "hosts" hostArgs.config._module.args.name "nixos"];44 modules = (import "${modulesPath}/module-list.nix") ++ [45 (module // { key = "attr<host.nixos>"; })46 (config.nixos // { key = "attr<fleet.nixos>"; })47 ];48 specialArgs = {49 inherit fleetLib inputs self modulesPath;50 };51 };52 };53 nixos_unchecked = mkOption {54 type = unspecified;55 };56 };57 config = {58 # imports = [59 # (mkRemovedOptionModule ["nixosModules"] "replaced with hosts.*.nixos.imports.")60 # ];61 nixos = let 62 inherit (hostArgs.config) system;63 in {64 _module.args = {65 nixosHosts = mapAttrs (_: value: value.nixos_unchecked.config) config.hosts;66 hosts = config.hosts;67 host = hostArgs.config;68 fleetConfiguration = config;6970 inputs' = mapAttrs (71 inputName: input:72 builtins.addErrorContext73 "while retrieving system-dependent attributes for input ${escapeNixIdentifierinputName}"74 (75 if input._type or null == "flake" then76 _fleetFlakeRootConfig.perInput system input77 else78 "input is not a flake, perhaps flake = false was added to te input declaration?"79 )80 ) inputs;81 self' = builtins.addErrorContext "while retrieving system-dependent attributes for a flake's own outputs" (82 _fleetFlakeRootConfig.perInput system self83 );84 };85 nixpkgs.hostPlatform = system;86 };87 nixos_unchecked = hostArgs.config.nixos.extendModules {88 modules = [89 {90 _module.check = false;91 }92 ];93 };94 };95 });96 };97 imports = [98 (mkRemovedOptionModule [ "nixosModules" ] "replaced with nixos.imports.")99 ];100 config.nixos.imports = import ./nixos/module-list.nix;101}modules/nixos/meta.nixdiffbeforeafterboth--- a/modules/nixos/meta.nix
+++ b/modules/nixos/meta.nix
@@ -1,17 +1,4 @@
-{ lib, ... }:
-let
- inherit (lib.modules) mkRemovedOptionModule;
-in
{
- imports = [
- (mkRemovedOptionModule [ "tags" ]
- "tags are now defined at the host level, not the nixos system level for fast filtering without evaluating unnecessary hosts."
- )
- (mkRemovedOptionModule [
- "network"
- ] "network is now defined at the host level, not the nixos system level")
- ];
-
# Version of environment (fleet scripts such as rollback) already installed on the host
config = {
environment.etc.FLEET_HOST.text = "1";
modules/nixpkgs.nixdiffbeforeafterboth--- a/modules/nixpkgs.nix
+++ b/modules/nixpkgs.nix
@@ -7,7 +7,6 @@
let
inherit (lib.options) mkOption literalExpression;
inherit (lib.types) path;
- inherit (lib.modules) mkRemovedOptionModule;
inherit (fleetLib.options) mkHostsOption;
inherit (fleetLib.types) listOfOverlay;
@@ -43,18 +42,9 @@
default = config.nixpkgs.buildUsing;
defaultText = literalExpression "config.nixpkgs.buildUsing";
};
- # imports = [
- # (mkRemovedOptionModule ["nixpkgs" "overlays"] "this option needs to be specified at nixosModules level")
- # ];
config.nixos = {
inherit _file;
nixpkgs.overlays = config.nixpkgs.overlays;
- imports = [
- (mkRemovedOptionModule [
- "nixpkgs"
- "buildUsing"
- ] "this option should be specified at the host level, not the nixosModules level")
- ];
};
};
};