Revert "flake: split up per host"

This reverts commit 9db2dcf124.
This commit is contained in:
zowoq 2023-05-16 06:54:11 +10:00
parent 9db2dcf124
commit c0babce452
10 changed files with 95 additions and 95 deletions

View file

@ -1,4 +1,4 @@
{ inputs, ... }:
{ ... }:
# Boot recovery:
# Activate 64-bit Rescue system in https://robot.your-server.de/server
# ssh root@build01.nix-community.org "mount /dev/md[0-9]* /mnt && /mnt/kexec_bundle"
@ -11,7 +11,6 @@
# nixos-enter
{
imports = [
inputs.srvos.nixosModules.hardware-hetzner-online-amd
../roles/common.nix
../roles/raid.nix
../roles/zfs.nix

View file

@ -1,7 +0,0 @@
{ self, ... }:
{
flake.nixosConfigurations.build01 = self.lib.nixosSystem {
system = "x86_64-linux";
modules = [ ./configuration.nix ];
};
}

View file

@ -1,9 +1,7 @@
{ inputs, ... }:
{ ... }:
{
imports = [
inputs.srvos.nixosModules.mixins-nginx
inputs.srvos.nixosModules.hardware-hetzner-online-amd
./nixpkgs-update.nix
./nixpkgs-update-backup.nix
../roles/common.nix

View file

@ -1,8 +0,0 @@
{ self, ... }:
{
flake.nixosConfigurations.build02 = self.lib.nixosSystem {
system = "x86_64-linux";
modules = [ ./configuration.nix ];
};
}

View file

@ -1,4 +1,4 @@
{ inputs, ... }:
{ ... }:
{
# Boot recovery:
# Activate 64-bit Rescue system in https://robot.your-server.de/server
@ -10,8 +10,6 @@
# $ zpool import -f zroot && mount -t zfs zroot/root/nixos /mnt && mount -t zfs zroot/root/home /mnt/home && mount /dev/md[0-9]* /mnt/boot
# $ nixos-enter
imports = [
inputs.srvos.nixosModules.mixins-nginx
inputs.srvos.nixosModules.hardware-hetzner-online-amd
../roles/common.nix
../roles/hercules-ci
../roles/watch-store.nix

View file

@ -1,7 +0,0 @@
{ self, ... }:
{
flake.nixosConfiguration.build03 = self.lib.nixosSystem {
system = "x86_64-linux";
modules = [ ./configuration.nix ];
};
}

View file

@ -1,7 +1,5 @@
{ inputs, ... }:
{
imports = [
inputs.disko.nixosModules.disko
./hardware-configuration.nix
../roles/common.nix
../roles/hercules-ci

View file

@ -1,7 +0,0 @@
{ self, ... }:
{
flake.nixosConfigurations.build04 = self.lib.nixosSystem {
system = "aarch64-linux";
modules = [ ./configuration.nix ];
};
}

139
flake.nix
View file

@ -42,64 +42,107 @@
};
outputs = inputs @ { flake-parts, self, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
flake-parts.lib.mkFlake
{ inherit inputs; }
{
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
herculesCI = { lib, ... }: {
ciSystems = [ "x86_64-linux" "aarch64-linux" ];
herculesCI = { lib, ... }: {
ciSystems = [ "x86_64-linux" "aarch64-linux" ];
onPush.default.outputs = {
checks = lib.mkForce self.outputs.checks.x86_64-linux;
onPush.default.outputs = {
checks = lib.mkForce self.outputs.checks.x86_64-linux;
};
};
};
hercules-ci.flake-update = {
enable = true;
createPullRequest = true;
autoMergeMethod = "rebase";
when = {
hour = [ 2 ];
dayOfWeek = [ "Mon" "Thu" ];
hercules-ci.flake-update = {
enable = true;
createPullRequest = true;
autoMergeMethod = "rebase";
when = {
hour = [ 2 ];
dayOfWeek = [ "Mon" "Thu" ];
};
};
};
hercules-ci.github-pages.branch = "master";
imports = [
inputs.hercules-ci-effects.flakeModule
inputs.treefmt-nix.flakeModule
./effect.nix
./shell.nix
];
imports = [
inputs.hercules-ci-effects.flakeModule
inputs.treefmt-nix.flakeModule
./effect.nix
./shell.nix
./build01
./build02
./build03
./build04
];
hercules-ci.github-pages.branch = "master";
perSystem = { config, pkgs, ... }: {
treefmt.imports = [ ./treefmt.nix ];
perSystem = { config, pkgs, ... }: {
treefmt.imports = [ ./treefmt.nix ];
packages.pages = pkgs.runCommand "pages"
packages.pages = pkgs.runCommand "pages"
{
buildInputs = [ pkgs.python3.pkgs.mkdocs-material ];
} ''
cp -r ${pkgs.lib.cleanSource ./.}/* .
mkdocs build --strict --site-dir $out
'';
hercules-ci.github-pages.settings.contents = config.packages.pages;
};
flake.nixosConfigurations =
let
inherit (inputs.nixpkgs.lib) nixosSystem;
common = [
{ _module.args.inputs = inputs; }
{ srvos.flake = inputs.self; }
inputs.sops-nix.nixosModules.sops
inputs.srvos.nixosModules.server
inputs.srvos.nixosModules.mixins-telegraf
{ networking.firewall.allowedTCPPorts = [ 9273 ]; }
];
in
{
buildInputs = [ pkgs.python3.pkgs.mkdocs-material ];
} ''
cp -r ${pkgs.lib.cleanSource ./.}/* .
mkdocs build --strict --site-dir $out
'';
build01 = nixosSystem {
system = "x86_64-linux";
modules =
common
++ [
./build01/configuration.nix
inputs.srvos.nixosModules.hardware-hetzner-online-amd
];
};
hercules-ci.github-pages.settings.contents = config.packages.pages;
build02 = nixosSystem {
system = "x86_64-linux";
modules =
common
++ [
./build02/configuration.nix
inputs.srvos.nixosModules.mixins-nginx
inputs.srvos.nixosModules.hardware-hetzner-online-amd
];
};
build03 = nixosSystem {
system = "x86_64-linux";
modules =
common
++ [
./build03/configuration.nix
inputs.srvos.nixosModules.mixins-nginx
inputs.srvos.nixosModules.hardware-hetzner-online-amd
];
};
build04 = nixosSystem {
system = "aarch64-linux";
modules =
common
++ [
./build04/configuration.nix
inputs.disko.nixosModules.disko
];
};
};
};
flake.lib.nixosSystem = args:
inputs.nixpkgs.lib.nixosSystem ({ specialArgs = { inherit inputs; }; } // args);
flake.nixosModules = {
common = ./roles/common.nix;
};
};
}

View file

@ -1,4 +1,4 @@
{ inputs, pkgs, ... }:
{ pkgs, ... }:
{
imports = [
./auto-upgrade.nix
@ -6,15 +6,8 @@
./security.nix
./sops-nix.nix
./users.nix
inputs.sops-nix.nixosModules.sops
inputs.srvos.nixosModules.mixins-telegraf
inputs.srvos.nixosModules.server
];
networking.firewall.allowedTCPPorts = [ 9273 ];
srvos.flake = inputs.self;
zramSwap.enable = true;
# https://github.com/hercules-ci/hercules-ci-agent/issues/514