From 85ea7fe0304febf08a6c765478a3797411caee80 Mon Sep 17 00:00:00 2001 From: Fabian Hauser Date: Tue, 25 Mar 2025 15:34:17 +0200 Subject: [PATCH] Improve nixosModules checks to include all modules by default. --- checks/default.nix | 1 + checks/nixos-modules/default.nix | 4 +++- flake.lock | 6 +++--- private | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/checks/default.nix b/checks/default.nix index b122e7c..19ee99a 100644 --- a/checks/default.nix +++ b/checks/default.nix @@ -12,6 +12,7 @@ formatting = treefmtEval.config.build.check flakeSelf; nixos-modules = pkgs.callPackage ./nixos-modules { + defaultModule = self.nixosModules.default; inherit (self.lib) getSubDirs isFolderWithFile; }; diff --git a/checks/nixos-modules/default.nix b/checks/nixos-modules/default.nix index 74e8a25..aaeae5d 100644 --- a/checks/nixos-modules/default.nix +++ b/checks/nixos-modules/default.nix @@ -4,6 +4,7 @@ getSubDirs, lib, testers, + defaultModule, }: let inherit (lib) @@ -23,6 +24,7 @@ let in testers.runNixOSTest { inherit name; + imports = [ (import (getFilePath "test.nix") { inherit name; @@ -30,7 +32,7 @@ let }) ]; - defaults.imports = [ (getFilePath "default.nix") ]; + defaults.imports = [ defaultModule ]; # Calls a `test(...)` python function in the test's python file with the list of nodes and helper functions. # Helper symbols may be added as function args when needed and can be found in: diff --git a/flake.lock b/flake.lock index 82643ec..69bcc66 100644 --- a/flake.lock +++ b/flake.lock @@ -170,10 +170,10 @@ ] }, "locked": { - "lastModified": 1742903609, - "narHash": "sha256-/RY0aP9QJROQqyaTX2qUy04YQD22l8cTbKqYo3aFzpg=", + "lastModified": 1742910348, + "narHash": "sha256-ChpGvxY5QN7otvTx4JknqIfDnnmWYHfHSVYvYG+ZJg8=", "ref": "refs/heads/main", - "rev": "9e9c48a02ca9ce6514d609c0f4f0607fa7fa8165", + "rev": "f789cff29517e0240525f5a9f2007dbec3ae48e7", "revCount": 13, "type": "git", "url": "file:./private" diff --git a/private b/private index 9e9c48a..f789cff 160000 --- a/private +++ b/private @@ -1 +1 @@ -Subproject commit 9e9c48a02ca9ce6514d609c0f4f0607fa7fa8165 +Subproject commit f789cff29517e0240525f5a9f2007dbec3ae48e7