feat: a bunch of things, also hcloud removal

This commit is contained in:
Kat Inskip 2024-10-25 12:55:56 -04:00
parent e59be4137b
commit 899e37094f
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
8 changed files with 40 additions and 32 deletions

View file

@ -26,6 +26,7 @@
channels = { channels = {
nixfiles.path = ../.; nixfiles.path = ../.;
std.path = "${channels.nixfiles.inputs.std}";
nixpkgs.path = "${channels.nixfiles.inputs.nixpkgs}"; nixpkgs.path = "${channels.nixfiles.inputs.nixpkgs}";
}; };

View file

@ -1,9 +1,25 @@
{ {
lib, lib,
config, config,
channels,
pkgs,
... ...
}: }:
with lib; { with lib; let
inherit (channels.std) string list set;
enabledNixosSystems = filterAttrs (_: system: system.config.ci.enable && system.config.type == "NixOS") channels.nixfiles.systems;
exportsSystems = let
warnSystems = set.filter (_: system: system.ci.allowFailure) enabledNixosSystems;
toSystems = systems: string.concatMapSep " " string.escapeShellArg (set.keys systems);
in ''
NF_NIX_SYSTEMS=(${toSystems nixosSystems})
NF_NIX_SYSTEMS_WARN=(${toSystems warnSystems})
'';
buildAllSystems = pkgs.writeShellScriptBin "build-systems" ''
${exportsSystems}
nix run .#nf-actions-test";
'';
in {
imports = [./common.nix]; imports = [./common.nix];
config = { config = {
name = "flake-update"; name = "flake-update";
@ -37,7 +53,7 @@ with lib; {
step.flake-update = { step.flake-update = {
name = "flake update build"; name = "flake update build";
order = 500; order = 500;
run = "nix run .#nf-update"; run = "${buildAllSystems}/bin/build-systems";
env = { env = {
CACHIX_SIGNING_KEY = "\${{ secrets.CACHIX_SIGNING_KEY }}"; CACHIX_SIGNING_KEY = "\${{ secrets.CACHIX_SIGNING_KEY }}";
DISCORD_WEBHOOK_LINK = "\${{ secrets.DISCORD_WEBHOOK_LINK }}"; DISCORD_WEBHOOK_LINK = "\${{ secrets.DISCORD_WEBHOOK_LINK }}";

View file

@ -9,6 +9,7 @@ in {
alejandra alejandra
deadnix deadnix
statix statix
cachix
ssh-to-age ssh-to-age
]; ];
}; };

View file

@ -4,9 +4,10 @@ in {
networking = { networking = {
networkmanager.dns = mkForce "none"; networkmanager.dns = mkForce "none";
nameservers = [ nameservers = [
"1.1.1.1#cloudflare-dns.com" "172.20.0.1"
/*"1.1.1.1#cloudflare-dns.com"
"1.0.0.1#cloudflare-dns.com" "1.0.0.1#cloudflare-dns.com"
"8.8.8.8#dns.google" "8.8.8.8#dns.google"*/
]; ];
}; };
services.resolved = { services.resolved = {

View file

@ -1,24 +1,13 @@
{ {
writeShellScriptBin, wrapShellScriptBin,
pkgs, pkgs,
inputs }:
makeBinPath wrapShellScriptBin "nf-actions-test" ./actions-test.sh {
}: let depsRuntimePath = with pkgs; [
inherit (inputs.std) string list set; git
exports = '' cachix
export NF_CONFIG_ROOT=''${NF_CONFIG_ROOT-${toString ../.}} jq
''; nix
exportsSystems = let curl
inherit (inputs.self) systems; ];
nixosSystems = set.filter (_: system: system.ci.enable) systems; }
warnSystems = set.filter (_: system: system.ci.allowFailure) nixosSystems;
toSystems = systems: string.concatMapSep " " string.escapeShellArg (set.keys systems);
in ''
NF_NIX_SYSTEMS=(${toSystems nixosSystems})
NF_NIX_SYSTEMS_WARN=(${toSystems warnSystems})
'';
in pkgs.writeShellScriptBin "nf-actions-test" ''
${exports}
${exportsSystems}
source ${./actions-test.sh}
''

View file

@ -1,4 +1,4 @@
resource "hcloud_network" "network" { /*resource "hcloud_network" "network" {
name = "network-17a07f9" name = "network-17a07f9"
ip_range = "10.0.0.0/16" ip_range = "10.0.0.0/16"
} }
@ -8,4 +8,4 @@ resource "hcloud_network_subnet" "subnet" {
type = "cloud" type = "cloud"
network_zone = "us-west" network_zone = "us-west"
ip_range = "10.0.1.0/24" ip_range = "10.0.1.0/24"
} }*/

View file

@ -1,7 +1,7 @@
variable "hcloud_token" { /*variable "hcloud_token" {
sensitive = true sensitive = true
} }
provider "hcloud" { provider "hcloud" {
token = var.hcloud_token token = var.hcloud_token
} }*/

View file

@ -1,4 +1,4 @@
resource "hcloud_primary_ip" "ipv4" { /*resource "hcloud_primary_ip" "ipv4" {
auto_delete = false auto_delete = false
name = "yukari-v4-aef50a7" name = "yukari-v4-aef50a7"
datacenter = "hil-dc1" datacenter = "hil-dc1"
@ -47,4 +47,4 @@ resource "hcloud_rdns" "yukari-v6" {
server_id = hcloud_server.yukari.id server_id = hcloud_server.yukari.id
ip_address = hcloud_server.yukari.ipv6_address ip_address = hcloud_server.yukari.ipv6_address
dns_ptr = "yukari.gensokyo.zone" dns_ptr = "yukari.gensokyo.zone"
} }*/