Compare commits

...

14 commits

5 changed files with 22 additions and 74 deletions

View file

@ -49,12 +49,16 @@ in
substituters = mkForce [ ]; substituters = mkForce [ ];
hashed-mirrors = null; hashed-mirrors = null;
connect-timeout = 1; connect-timeout = 1;
download-attempts = 1;
extra-experimental-features = "flakes"; extra-experimental-features = "flakes";
}; };
system.extraDependencies = system.extraDependencies =
[ [
inputs.nixops4
inputs.nixops4-nixos
inputs.nixpkgs
sources.flake-parts
sources.nixpkgs sources.nixpkgs
sources.flake-inputs sources.flake-inputs

View file

@ -18,7 +18,6 @@ in
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")
(modulesPath + "/../lib/testing/nixos-test-base.nix") (modulesPath + "/../lib/testing/nixos-test-base.nix")
./sharedOptions.nix ./sharedOptions.nix
../../../infra/common/nixos/users.nix
]; ];
config = mkMerge [ config = mkMerge [
@ -29,12 +28,11 @@ in
system.switch.enable = true; system.switch.enable = true;
nix = { nix = {
# short-cut network time-outs
settings.download-attempts = 1;
## Not used; save a large copy operation ## Not used; save a large copy operation
channel.enable = false; channel.enable = false;
registry = lib.mkForce { }; registry = lib.mkForce { };
settings = {
download-attempts = 1;
};
}; };
services.openssh = { services.openssh = {
@ -42,46 +40,10 @@ in
settings.PermitRootLogin = "yes"; settings.PermitRootLogin = "yes";
}; };
networking = { networking.firewall.allowedTCPPorts = [ 22 ];
firewall.enable = false;
enableIPv6 = false;
};
services.getty.autologinUser = lib.mkForce "root";
## Test VMs don't have a bootloader by default. ## Test VMs don't have a bootloader by default.
# boot.loader = { boot.loader.grub.enable = false;
# # GRUB enabled: installation of GRUB on /dev/disk/by-id/virtio-root failed: No such file or directory
# grub.enable = false;
# # systemd boot enabled: '/boot' is not a mounted partition. Is the path configured correctly?
# systemd-boot.enable = true;
# efi.canTouchEfiVariables = true;
# };
# # same issue as no bootloader
# boot.loader.generic-extlinux-compatible.enable = false;
# builds but won't boot back up
boot.loader.grub.forceInstall = true;
# # builds but won't boot back up
# # to be used with --no-bootloader, which i could only find for flakes
# boot.loader.grub.enable = false;
users.mutableUsers = false;
users.users.root = {
password = "password";
hashedPassword = null;
hashedPasswordFile = null;
openssh.authorizedKeys.keys =
let
keys = import ../../../keys;
in
lib.attrValues keys.contributors
++ [
# allow our panel vm access to the test machines
keys.panel
# allow continuous deployment access
keys.cd
];
};
} }
(mkIf config.enableAcme { (mkIf config.enableAcme {

View file

@ -1,13 +1,11 @@
{ {
inputs, inputs,
# sources,
lib, lib,
config, config,
... ...
}: }:
let let
# inherit (import ./constants.nix) targetMachines pathToRoot pathFromRoot;
eval = eval =
module: module:
(lib.evalModules { (lib.evalModules {

View file

@ -42,7 +42,6 @@ in
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
hello hello
cowsay
automake automake
autoconf autoconf
]; ];
@ -66,14 +65,6 @@ in
' '
let let
args = builtins.fromJSON "${
lib.replaceStrings [ "\"" ] [ "\\\\\"" ] (
lib.strings.toJSON {
inherit sources;
}
)
}";
inherit (args) sources;
configuration = { pkgs, config, ... }: { configuration = { pkgs, config, ... }: {
imports = [ imports = [
${pathToRoot}/deployment/check/common/sharedOptions.nix ${pathToRoot}/deployment/check/common/sharedOptions.nix
@ -90,24 +81,8 @@ in
autoconf autoconf
]; ];
}; };
eval = import "${sources.nixpkgs}/nixos/lib/eval-config.nix" {
system = builtins.currentSystem;
specialArgs = {
inherit sources;
};
modules = [ configuration ];
};
os = {
inherit (eval) pkgs config options;
system = eval.config.system.build.toplevel;
inherit (eval.config.system.build) vm vmWithBootLoader;
};
in in
# import "${pathToRoot}/deployment/nixos.nix" {} import ${pathToRoot}/deployment/nixos.nix { inherit configuration; }
{
drv_path = os.config.system.build.toplevel.drvPath;
out_path = os.config.system.build.toplevel;
}
' '
) )
# instantiate the config in /nix/store # instantiate the config in /nix/store

View file

@ -4,11 +4,20 @@
}: }:
let let
sources = import ../npins; sources = import ../npins;
os = import "${sources.nixpkgs}/nixos" { inherit system configuration; }; eval = import "${sources.nixpkgs}/nixos/lib/eval-config.nix" {
inherit system;
specialArgs = {
inherit sources;
};
modules = [ configuration ];
};
os = {
inherit (eval) pkgs config options;
system = eval.config.system.build.toplevel;
inherit (eval.config.system.build) vm vmWithBootLoader;
};
in in
{ {
substituters = builtins.concatStringsSep " " os.config.nix.settings.substituters;
trusted_public_keys = builtins.concatStringsSep " " os.config.nix.settings.trusted-public-keys;
drv_path = os.config.system.build.toplevel.drvPath; drv_path = os.config.system.build.toplevel.drvPath;
out_path = os.config.system.build.toplevel; out_path = os.config.system.build.toplevel;
} }