Compare commits
8 Commits
nrec-forge
...
8c909837ab
| Author | SHA1 | Date | |
|---|---|---|---|
|
8c909837ab
|
|||
|
93aa91f307
|
|||
|
00f46af628
|
|||
| 97ad5f6a35 | |||
|
a27e2ec213
|
|||
|
01906e81f9
|
|||
|
09ec4f9e8c
|
|||
| fc53681b2a |
14
.github/workflows/flake-check.yaml
vendored
14
.github/workflows/flake-check.yaml
vendored
@@ -1,14 +0,0 @@
|
|||||||
name: Run nix flake check
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
flake-check:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: ghcr.io/catthehacker/ubuntu:runner-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: cachix/install-nix-action@v27
|
|
||||||
- run: nix flake check
|
|
||||||
27
.github/workflows/flake-update.yaml
vendored
27
.github/workflows/flake-update.yaml
vendored
@@ -1,27 +0,0 @@
|
|||||||
---
|
|
||||||
name: Periodic flake update
|
|
||||||
on: # yamllint disable-line rule:truthy
|
|
||||||
schedule:
|
|
||||||
- cron: "0 0 * * *"
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
flake-update:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: ghcr.io/catthehacker/ubuntu:runner-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
ref: master
|
|
||||||
- uses: cachix/install-nix-action@v27
|
|
||||||
- name: configure git
|
|
||||||
run: |
|
|
||||||
git config --global user.name 'torjus-bot'
|
|
||||||
git config --global user.email 'torjus-bot@git.t-juice.club'
|
|
||||||
- name: flake update
|
|
||||||
run: nix flake update --commit-lock-file
|
|
||||||
- name: push
|
|
||||||
run: git push
|
|
||||||
@@ -227,6 +227,15 @@
|
|||||||
./hosts/nrec-nixos01
|
./hosts/nrec-nixos01
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
nrec-nixos02 = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs self;
|
||||||
|
};
|
||||||
|
modules = commonModules ++ [
|
||||||
|
./hosts/nrec-nixos02
|
||||||
|
];
|
||||||
|
};
|
||||||
openstack-template = nixpkgs.lib.nixosSystem {
|
openstack-template = nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
services.caddy = {
|
services.caddy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
virtualHosts."nrec-nixos01.t-juice.club" = {
|
virtualHosts."code.t-juice.club" = {
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
reverse_proxy 127.0.0.1:3000
|
reverse_proxy 127.0.0.1:3000
|
||||||
'';
|
'';
|
||||||
|
|||||||
85
hosts/nrec-nixos02/configuration.nix
Normal file
85
hosts/nrec-nixos02/configuration.nix
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
{ lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
PermitRootLogin = lib.mkForce "no";
|
||||||
|
PasswordAuthentication = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.nixos = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
shell = pkgs.zsh;
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAwfb2jpKrBnCw28aevnH8HbE5YbcMXpdaVv2KmueDu6 torjus@gunter"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
|
homelab.dns.enable = false;
|
||||||
|
homelab.monitoring.enable = false;
|
||||||
|
homelab.host.labels.ansible = "false";
|
||||||
|
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-label/nixos";
|
||||||
|
fsType = "ext4";
|
||||||
|
autoResize = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.loader.grub.enable = true;
|
||||||
|
boot.loader.grub.device = "/dev/vda";
|
||||||
|
networking.hostName = "nrec-nixos02";
|
||||||
|
networking.useNetworkd = true;
|
||||||
|
networking.useDHCP = false;
|
||||||
|
services.resolved.enable = true;
|
||||||
|
|
||||||
|
systemd.network.enable = true;
|
||||||
|
systemd.network.networks."ens3" = {
|
||||||
|
matchConfig.Name = "ens3";
|
||||||
|
networkConfig.DHCP = "ipv4";
|
||||||
|
linkConfig.RequiredForOnline = "routable";
|
||||||
|
};
|
||||||
|
time.timeZone = "Europe/Oslo";
|
||||||
|
|
||||||
|
networking.firewall.enable = true;
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
22
|
||||||
|
80
|
||||||
|
443
|
||||||
|
];
|
||||||
|
|
||||||
|
nix.settings.substituters = [
|
||||||
|
"https://cache.nixos.org"
|
||||||
|
];
|
||||||
|
nix.settings.trusted-public-keys = [
|
||||||
|
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||||
|
];
|
||||||
|
|
||||||
|
services.pocket-id = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
APP_URL = "https://oidc.t-juice.club";
|
||||||
|
TRUST_PROXY = true;
|
||||||
|
ANALYTICS_DISABLED = true;
|
||||||
|
VERSION_CHECK_DISABLED = true;
|
||||||
|
HOST = "127.0.0.1";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.caddy = {
|
||||||
|
enable = true;
|
||||||
|
virtualHosts."oidc.t-juice.club" = {
|
||||||
|
extraConfig = ''
|
||||||
|
reverse_proxy 127.0.0.1:1411
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
zramSwap.enable = true;
|
||||||
|
|
||||||
|
system.stateVersion = "25.11";
|
||||||
|
}
|
||||||
9
hosts/nrec-nixos02/default.nix
Normal file
9
hosts/nrec-nixos02/default.nix
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{ modulesPath, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./configuration.nix
|
||||||
|
../../system/packages.nix
|
||||||
|
../../services/actions-runner
|
||||||
|
(modulesPath + "/profiles/qemu-guest.nix")
|
||||||
|
];
|
||||||
|
}
|
||||||
32
services/actions-runner/default.nix
Normal file
32
services/actions-runner/default.nix
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
virtualisation.podman = {
|
||||||
|
enable = true;
|
||||||
|
dockerCompat = true;
|
||||||
|
dockerSocket.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.gitea-actions-runner = {
|
||||||
|
package = pkgs.forgejo-runner;
|
||||||
|
|
||||||
|
instances.actions1 = {
|
||||||
|
enable = true;
|
||||||
|
name = config.networking.hostName;
|
||||||
|
url = "https://code.t-juice.club";
|
||||||
|
tokenFile = "/var/lib/forgejo-runner/token";
|
||||||
|
labels = [
|
||||||
|
"nix:docker://nixos/nix:latest"
|
||||||
|
"node-bookworm:docker://node:lts-bookworm-slim"
|
||||||
|
"alpine:docker://alpine:latest"
|
||||||
|
];
|
||||||
|
settings = {
|
||||||
|
runner.capacity = 2;
|
||||||
|
cache = {
|
||||||
|
enabled = true;
|
||||||
|
dir = "/var/cache/forgejo-runner";
|
||||||
|
};
|
||||||
|
container.privileged = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -3,14 +3,16 @@
|
|||||||
services.forgejo = {
|
services.forgejo = {
|
||||||
enable = true;
|
enable = true;
|
||||||
database.type = "sqlite3";
|
database.type = "sqlite3";
|
||||||
|
lfs.enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
server = {
|
server = {
|
||||||
DOMAIN = "nrec-nixos01.t-juice.club";
|
DOMAIN = "code.t-juice.club";
|
||||||
ROOT_URL = "https://nrec-nixos01.t-juice.club/";
|
ROOT_URL = "https://code.t-juice.club/";
|
||||||
HTTP_ADDR = "127.0.0.1";
|
HTTP_ADDR = "127.0.0.1";
|
||||||
HTTP_PORT = 3000;
|
HTTP_PORT = 3000;
|
||||||
};
|
};
|
||||||
service.DISABLE_REGISTRATION = true;
|
service.DISABLE_REGISTRATION = true;
|
||||||
|
"service.explore".REQUIRE_SIGNIN_VIEW = true;
|
||||||
session.COOKIE_SECURE = true;
|
session.COOKIE_SECURE = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user