forked from fediversity/fediversity
Compare commits
2 commits
03a9c9b305
...
fb25554c7b
| Author | SHA1 | Date | |
|---|---|---|---|
| fb25554c7b | |||
| e091b18675 |
9 changed files with 104 additions and 51 deletions
|
|
@ -4,6 +4,7 @@
|
|||
pkgs,
|
||||
config,
|
||||
sources,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
|
|
@ -73,7 +74,8 @@ in
|
|||
## configuration and the store paths needed to build it and
|
||||
## dump them in `system.extraDependencies`.
|
||||
machine =
|
||||
(pkgs.nixos [
|
||||
(pkgs.nixos (
|
||||
[
|
||||
./targetNode.nix
|
||||
../../../infra/common/nixos/repart.nix
|
||||
config.system.extraDependenciesFromModule
|
||||
|
|
@ -83,7 +85,9 @@ in
|
|||
enableAcme = config.enableAcme;
|
||||
acmeNodeIP = config.acmeNodeIP;
|
||||
}
|
||||
]).config;
|
||||
]
|
||||
++ (lib.optional config.useFlake "${modulesPath}/../lib/testing/nixos-test-base.nix")
|
||||
)).config;
|
||||
|
||||
in
|
||||
[
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
config,
|
||||
hostPkgs,
|
||||
sources,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
|
|
@ -67,7 +68,8 @@ in
|
|||
};
|
||||
|
||||
config = {
|
||||
sourceFileset = fileset.unions [
|
||||
sourceFileset = fileset.unions (
|
||||
[
|
||||
# NOTE: not the flake itself; it will be overridden.
|
||||
../../../mkFlake.nix
|
||||
../../../flake.lock
|
||||
|
|
@ -76,7 +78,9 @@ in
|
|||
./sharedOptions.nix
|
||||
./targetNode.nix
|
||||
./targetResource.nix
|
||||
];
|
||||
]
|
||||
++ (lib.optional config.useFlake "${modulesPath}/../lib/testing/nixos-test-base.nix")
|
||||
);
|
||||
|
||||
acmeNodeIP = config.nodes.acme.networking.primaryIPAddress;
|
||||
|
||||
|
|
@ -112,7 +116,9 @@ in
|
|||
};
|
||||
})
|
||||
(genAttrs config.targetMachines (_: {
|
||||
imports = [ ./targetNode.nix ];
|
||||
imports = [
|
||||
./targetNode.nix
|
||||
] ++ (lib.optional config.useFlake (modulesPath + "/../lib/testing/nixos-test-base.nix"));
|
||||
_module.args = { inherit inputs sources; };
|
||||
enableAcme = config.enableAcme;
|
||||
acmeNodeIP = if config.enableAcme then config.nodes.acme.networking.primaryIPAddress else null;
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@ in
|
|||
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
# FIXME needed for non-proxmox tests
|
||||
# (modulesPath + "/../lib/testing/nixos-test-base.nix")
|
||||
./sharedOptions.nix
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
lib,
|
||||
config,
|
||||
sources,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
|
|
@ -39,7 +40,7 @@ in
|
|||
imports = [
|
||||
./targetNode.nix
|
||||
(lib.modules.importJSON (config.pathToCwd + "/${config.nodeName}-network.json"))
|
||||
];
|
||||
] ++ (lib.optional config.useFlake "${modulesPath}/../lib/testing/nixos-test-base.nix");
|
||||
|
||||
_module.args = { inherit inputs sources; };
|
||||
enableAcme = config.enableAcme;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,12 @@ in
|
|||
inputs.nixops4-nixos.modules.nixops4Resource.nixos
|
||||
../common/targetResource.nix
|
||||
];
|
||||
nixos.module = mkNixosConfiguration environment required-resources;
|
||||
nixos.module = {
|
||||
imports = [
|
||||
(mkNixosConfiguration environment required-resources)
|
||||
"${sources.nixpkgs}/nixos/lib/testing/nixos-test-base.nix"
|
||||
];
|
||||
};
|
||||
_module.args = { inherit inputs sources; };
|
||||
inherit nodeName pathToRoot pathFromRoot;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -31,7 +31,12 @@ in
|
|||
}:
|
||||
{
|
||||
ssh-host = {
|
||||
nixos-configuration = mkNixosConfiguration environment required-resources;
|
||||
nixos-configuration = {
|
||||
imports = [
|
||||
(mkNixosConfiguration environment required-resources)
|
||||
"${sources.nixpkgs}/nixos/lib/testing/nixos-test-base.nix"
|
||||
];
|
||||
};
|
||||
system = targetSystem;
|
||||
ssh = {
|
||||
username = "root";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
lib,
|
||||
sources ? import ../../../../npins,
|
||||
...
|
||||
}:
|
||||
|
|
@ -20,4 +21,50 @@
|
|||
users.users.root.openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFZsldWMEsajYysjYsEpNvMOjO4D8L21pTrfQS1T+Hfy"
|
||||
];
|
||||
boot.loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
efiSysMountPoint = "/boot";
|
||||
};
|
||||
grub.enable = false;
|
||||
};
|
||||
fileSystems."/boot" = {
|
||||
fsType = "vfat";
|
||||
device = lib.mkDefault "/dev/sda1";
|
||||
options = [
|
||||
"fmask=0022"
|
||||
"dmask=0022"
|
||||
];
|
||||
};
|
||||
disko.devices.disk.main = {
|
||||
device = "/dev/sda";
|
||||
type = "disk";
|
||||
imageSize = "20G"; # needed for image generation
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
esp = {
|
||||
priority = 1;
|
||||
size = "500M";
|
||||
type = "EF00";
|
||||
label = "boot";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
root = {
|
||||
priority = 2;
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,12 @@ in
|
|||
}:
|
||||
{
|
||||
tf-host = {
|
||||
nixos-configuration = mkNixosConfiguration environment required-resources;
|
||||
nixos-configuration = {
|
||||
imports = [
|
||||
(mkNixosConfiguration environment required-resources)
|
||||
"${sources.nixpkgs}/nixos/lib/testing/nixos-test-base.nix"
|
||||
];
|
||||
};
|
||||
system = targetSystem;
|
||||
ssh = {
|
||||
username = "root";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, ... }:
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
_class = "nixos";
|
||||
|
|
@ -11,14 +11,6 @@
|
|||
# ];
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
efiSysMountPoint = "/boot";
|
||||
};
|
||||
grub.enable = false;
|
||||
};
|
||||
initrd = {
|
||||
availableKernelModules = [
|
||||
"ata_piix"
|
||||
|
|
@ -30,29 +22,19 @@
|
|||
};
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
fsType = "vfat";
|
||||
device = lib.mkDefault "/dev/sda1";
|
||||
options = [
|
||||
"fmask=0022"
|
||||
"dmask=0022"
|
||||
];
|
||||
};
|
||||
|
||||
disko.devices.disk.main = {
|
||||
device = "/dev/sda";
|
||||
type = "disk";
|
||||
imageSize = "20G"; # needed for image generation
|
||||
|
||||
content = {
|
||||
type = "gpt";
|
||||
|
||||
partitions = {
|
||||
# mbr = {
|
||||
# priority = 0;
|
||||
# size = "1M";
|
||||
# type = "EF02";
|
||||
# };
|
||||
mbr = {
|
||||
priority = 0;
|
||||
size = "1M";
|
||||
type = "EF02";
|
||||
};
|
||||
|
||||
esp = {
|
||||
priority = 1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue