Make a NixOps4 deployment for action runners

This commit is contained in:
Nicolas Jeannerod 2024-11-17 01:02:23 +01:00
parent 8a53b5242b
commit 40ec7e9c8c
Signed by untrusted user: Niols
GPG key ID: 35DB9EC8886E1CB8
4 changed files with 48 additions and 35 deletions

View file

@ -25,6 +25,7 @@
inputs.nixops4-nixos.modules.flake.default inputs.nixops4-nixos.modules.flake.default
./deployment/flake-part.nix ./deployment/flake-part.nix
./infra/flake-part.nix
./services/flake-part.nix ./services/flake-part.nix
]; ];

47
infra/flake-part.nix Normal file
View file

@ -0,0 +1,47 @@
{ inputs, self, ... }:
{
nixops4Deployments.actions-runners =
{ providers, ... }:
{
providers.local = inputs.nixops4-nixos.modules.nixops4Provider.local;
resources = {
vm02179 = {
type = providers.local.exec;
imports = [ inputs.nixops4-nixos.modules.nixops4Resource.nixos ];
ssh = {
host = "185.206.232.179";
opts = "";
hostPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPAsOCOsJ0vNL9fGj0XC25ir8B+k2NlVJzsiVUx+0eWM";
};
nixpkgs = inputs.nixpkgs;
nixos.module = {
imports = [
./vm02179/configuration.nix
./vm02186/hardware-configuration.nix
./vm02179/gitea-runner.nix
];
};
};
vm02186 = {
type = providers.local.exec;
imports = [ inputs.nixops4-nixos.modules.nixops4Resource.nixos ];
ssh = {
host = "185.206.232.186";
opts = "";
hostPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII6mnBgEeyYE4tzHeFNHVNBV6KR+hAqh3PYSqlh0QViW";
};
nixpkgs = inputs.nixpkgs;
nixos.module = {
imports = [
./vm02186/procolix-configuration.nix
./vm02186/hardware-configuration.nix
./vm02186/gitea-runner.nix
];
};
};
};
};
}

View file

@ -6,12 +6,6 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports =
[ # Include the results of the hardware scan.
./gitea-runner.nix
./hardware-configuration.nix
];
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
@ -193,11 +187,6 @@
# Enable the OpenSSH daemon. # Enable the OpenSSH daemon.
services.openssh.enable = true; services.openssh.enable = true;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
system.copySystemConfiguration = true;
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions # settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave # on your system were taken. Its perfectly fine and recommended to leave

View file

@ -1,24 +0,0 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
snf.url = "git+https://git.fediversity.eu/fediversity/simple-nixos-fediverse.git";
};
outputs = { self, nixpkgs, snf }:
let
vmName = "vm02186";
in {
nixosConfigurations.${vmName} = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./procolix-configuration.nix
./hardware-configuration.nix
./gitea-runner.nix
];
};
isoInstallers.${vmName} = snf.mkInstaller nixpkgs self.nixosConfigurations.${vmName};
};
}