Compare commits
1 commit
fc4d569886
...
c2783867b6
Author | SHA1 | Date | |
---|---|---|---|
c2783867b6 |
4 changed files with 11 additions and 7 deletions
|
@ -4,7 +4,7 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
deployPkgs,
|
deployPkgs,
|
||||||
...
|
...
|
||||||
}@inputs:
|
}:
|
||||||
{
|
{
|
||||||
${system} = {
|
${system} = {
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ let
|
||||||
in
|
in
|
||||||
pipe modulesBaseDir [
|
pipe modulesBaseDir [
|
||||||
getSubDirs
|
getSubDirs
|
||||||
(filter (isFolderWithFile "test.nix"))
|
(filter (isFolderWithFile "test.nix" modulesBaseDir))
|
||||||
(map mkTest)
|
(map mkTest)
|
||||||
(linkFarmFromDrvs "nixos-modules")
|
(linkFarmFromDrvs "nixos-modules")
|
||||||
]
|
]
|
||||||
|
|
|
@ -7,16 +7,20 @@ let
|
||||||
pathExists
|
pathExists
|
||||||
path
|
path
|
||||||
;
|
;
|
||||||
|
# Get a list of all subdirectories of a directory.
|
||||||
|
getSubDirs = base: attrNames (filterAttrs (n: t: t == "directory") (builtins.readDir base));
|
||||||
|
# Check if a folder with a base path and folder name contains a file with a specific name
|
||||||
isFolderWithFile =
|
isFolderWithFile =
|
||||||
fileName: basePath: folderName:
|
fileName: basePath: folderName:
|
||||||
(pathExists (path.append basePath "./${folderName}/${fileName}.nix"));
|
(pathExists (path.append basePath "./${folderName}/${fileName}"));
|
||||||
getSubDirs = base: attrNames (filterAttrs (n: t: t == "directory") (builtins.readDir base));
|
# Get a list of subfolders that contain a default.nix file.
|
||||||
foldersWithNix = base: filter (isFolderWithFile "default.nix") (getSubDirs base);
|
foldersWithNix = base: filter (isFolderWithFile "default.nix" base) (getSubDirs base);
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit isFolderWithFile foldersWithNix;
|
inherit getSubDirs isFolderWithFile foldersWithNix;
|
||||||
|
|
||||||
|
# Get a list of default.nix files that are nix submodules of the current folder.
|
||||||
loadSubmodulesFrom =
|
loadSubmodulesFrom =
|
||||||
basePath: map (folder: path.append basePath "./${folder}/default.nix") (foldersWithNix basePath);
|
basePath: map (folder: path.append basePath "./${folder}/default.nix") (foldersWithNix basePath);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ def test(subtest, webserver):
|
||||||
expect_http_content(webserver, indexContent,
|
expect_http_content(webserver, indexContent,
|
||||||
"http://localhost/index.html")
|
"http://localhost/index.html")
|
||||||
|
|
||||||
with subtest("example.com is a hosts alias and redirects to localhost"):
|
with subtest("example.com is a hosts alias and redirect"):
|
||||||
webserver.succeed("grep example.com /etc/hosts")
|
webserver.succeed("grep example.com /etc/hosts")
|
||||||
|
|
||||||
url = "http://example.com/index.html"
|
url = "http://example.com/index.html"
|
||||||
|
|
Loading…
Add table
Reference in a new issue