Compare commits
7 Commits
fa6e092c06
...
8ba08ce982
Author | SHA1 | Date | |
---|---|---|---|
8ba08ce982 | |||
2b50aeba93 | |||
c1aef574b1 | |||
52ed25f1b9 | |||
0446d18712 | |||
d2bbbb827e | |||
6fba594625 |
@ -4,35 +4,45 @@ on: [push]
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
DEBIAN_FRONTEND: noninteractive
|
DEBIAN_FRONTEND: noninteractive
|
||||||
PATH: /run/current-system/sw/bin/:/nix/var/nix/profiles/per-user/gitea-runner/profile/bin
|
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
||||||
|
|
||||||
# defaults:
|
|
||||||
# run:
|
|
||||||
# shell: nix shell nixpkgs#nodejs-18_x
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-flake:
|
check-flake:
|
||||||
runs-on: nixos
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# - run: node --version
|
- name: Install Nix
|
||||||
# - name: Install basic dependencies
|
uses: https://github.com/cachix/install-nix-action@v23
|
||||||
# run: apt-get update && apt-get install -y --no-install-recommends sudo curl ca-certificates xz-utils
|
with:
|
||||||
|
github_access_token: ${{ secrets.__GITHUB_TOKEN }}
|
||||||
# - name: Install Nix
|
extra_nix_config: |
|
||||||
# uses: https://github.com/cachix/install-nix-action@v20
|
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= s0.koi-bebop.ts.net:OjbzD86YjyJZpCp9RWaQKANaflcpKhtzBMNP8I2aPUU=
|
||||||
# with:
|
substituters = https://cache.nixos.org/ http://s0.koi-bebop.ts.net:5000
|
||||||
# github_access_token: ${{ secrets.__GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: nix profile install nixpkgs#nodejs-18_x
|
|
||||||
|
|
||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
# - name: Get ENV var names
|
|
||||||
# run: printenv | cut -d'=' -f1
|
|
||||||
|
|
||||||
- name: Check Flake
|
- name: Check Flake
|
||||||
run: nix flake check --show-trace
|
run: |
|
||||||
|
# Can only build x84_64 for now, so pick out those specifically
|
||||||
|
# nix flake check --show-trace
|
||||||
|
|
||||||
|
nix build .#nixosConfigurations."ray".config.system.build.toplevel
|
||||||
|
nix build .#nixosConfigurations."s0".config.system.build.toplevel
|
||||||
|
nix build .#nixosConfigurations."ponyo".config.system.build.toplevel
|
||||||
|
nix build .#nixosConfigurations."zoidberg".config.system.build.toplevel
|
||||||
|
|
||||||
|
- name: Setup SSH For Pushing to Binary Cache
|
||||||
|
run: |
|
||||||
|
# Set up push key with ssh-agent
|
||||||
|
echo "${{ secrets.BINARY_CACHE_PUSH_SSH_KEY }}" | base64 -d > ./.id_ed25519
|
||||||
|
chmod 600 ./.id_ed25519
|
||||||
|
eval $(ssh-agent -a $SSH_AUTH_SOCK)
|
||||||
|
ssh-add ./.id_ed25519
|
||||||
|
# Add Binary Cache as known host
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "s0.koi-bebop.ts.net ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAwiXcUFtAvZCayhu4+AIcF+Ktrdgv9ee/mXSIhJbp4q" | tee -a ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
- name: Copy all built derivations to remote cache
|
||||||
|
run: nix copy --to ssh://cache-push@s0.koi-bebop.ts.net /nix/store/*
|
@ -10,7 +10,6 @@
|
|||||||
./matrix.nix
|
./matrix.nix
|
||||||
./zerobin.nix
|
./zerobin.nix
|
||||||
./gitea.nix
|
./gitea.nix
|
||||||
./gitea-runner.nix
|
|
||||||
./privatebin/privatebin.nix
|
./privatebin/privatebin.nix
|
||||||
./radio.nix
|
./radio.nix
|
||||||
./samba.nix
|
./samba.nix
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.services.gitea-runner;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.services.gitea-runner = {
|
|
||||||
enable = lib.mkEnableOption "Enables gitea runner";
|
|
||||||
dataDir = lib.mkOption {
|
|
||||||
default = "/var/lib/gitea-runner";
|
|
||||||
type = lib.types.str;
|
|
||||||
description = lib.mdDoc "gitea runner data directory.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
virtualisation.docker.enable = true;
|
|
||||||
|
|
||||||
users.users.gitea-runner = {
|
|
||||||
description = "Gitea Runner Service";
|
|
||||||
home = cfg.dataDir;
|
|
||||||
useDefaultShell = true;
|
|
||||||
group = "gitea-runner";
|
|
||||||
isSystemUser = true;
|
|
||||||
createHome = true;
|
|
||||||
extraGroups = [
|
|
||||||
"docker" # allow creating docker containers
|
|
||||||
];
|
|
||||||
};
|
|
||||||
users.groups.gitea-runner = { };
|
|
||||||
|
|
||||||
systemd.services.gitea-runner = {
|
|
||||||
description = "Gitea Runner";
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
WorkingDirectory = cfg.dataDir;
|
|
||||||
User = "gitea-runner";
|
|
||||||
Group = "gitea-runner";
|
|
||||||
};
|
|
||||||
|
|
||||||
requires = [ "network-online.target" ];
|
|
||||||
after = [ "network.target" "network-online.target" ];
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
|
|
||||||
path = with pkgs; [ gitea-actions-runner ];
|
|
||||||
|
|
||||||
script = ''
|
|
||||||
exec act_runner daemon
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
8
flake.lock
generated
8
flake.lock
generated
@ -185,16 +185,16 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1691888369,
|
"lastModified": 1695825837,
|
||||||
"narHash": "sha256-fBS5YOyiziv7tmR+yCJHr1Tm15Ve4PO1syyJwE9Xnuc=",
|
"narHash": "sha256-4Ne11kNRnQsmSJCRSSNkFRSnHC4Y5gPDBIQGjjPfJiU=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a4d0fe7270cc03eeb1aba4e8b343fe47bfd7c4d5",
|
"rev": "5cfafa12d57374f48bcc36fda3274ada276cf69e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "master",
|
"ref": "nixos-23.05",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/master";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
||||||
|
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
|
@ -6,5 +6,17 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
networking.hostName = "phil";
|
networking.hostName = "phil";
|
||||||
services.gitea-runner.enable = true;
|
|
||||||
|
services.gitea-actions-runner.instances.inst = {
|
||||||
|
enable = true;
|
||||||
|
name = config.networking.hostName;
|
||||||
|
url = "https://git.neet.dev/";
|
||||||
|
tokenFile = "/run/agenix/gitea-actions-runner-token";
|
||||||
|
labels = [
|
||||||
|
"debian-latest:docker://catthehacker/ubuntu:act-latest"
|
||||||
|
"ubuntu-latest:docker://catthehacker/ubuntu:act-latest"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
virtualisation.docker.enable = true;
|
||||||
|
age.secrets.gitea-actions-runner-token.file = ../../secrets/gitea-actions-runner-token.age;
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
systemRoles = [
|
systemRoles = [
|
||||||
"server"
|
"server"
|
||||||
"gitea-runner"
|
|
||||||
"nix-builder"
|
"nix-builder"
|
||||||
|
"gitea-actions-runner"
|
||||||
];
|
];
|
||||||
|
|
||||||
hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBlgRPpuUkZqe8/lHugRPm/m2vcN9psYhh5tENHZt9I2";
|
hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBlgRPpuUkZqe8/lHugRPm/m2vcN9psYhh5tENHZt9I2";
|
||||||
|
@ -9,9 +9,20 @@
|
|||||||
|
|
||||||
# system.autoUpgrade.enable = true;
|
# system.autoUpgrade.enable = true;
|
||||||
|
|
||||||
# gitea runner and allow it to build ARM derivations
|
# gitea runner and allow it to build ARM derivationsFV
|
||||||
services.gitea-runner.enable = true;
|
services.gitea-actions-runner.instances.inst = {
|
||||||
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
enable = true;
|
||||||
|
name = config.networking.hostName;
|
||||||
|
url = "https://git.neet.dev/";
|
||||||
|
tokenFile = "/run/agenix/gitea-actions-runner-token";
|
||||||
|
labels = [
|
||||||
|
"debian-latest:docker://catthehacker/ubuntu:act-latest"
|
||||||
|
"ubuntu-latest:docker://catthehacker/ubuntu:act-latest"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
virtualisation.podman.enable = true;
|
||||||
|
age.secrets.gitea-actions-runner-token.file = ../../../secrets/gitea-actions-runner-token.age;
|
||||||
|
boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; # todo: still needed?
|
||||||
nix.gc.automatic = lib.mkForce false; # allow the nix store to serve as a build cache
|
nix.gc.automatic = lib.mkForce false; # allow the nix store to serve as a build cache
|
||||||
|
|
||||||
# binary cache
|
# binary cache
|
||||||
@ -21,6 +32,13 @@
|
|||||||
secretKeyFile = "/run/agenix/binary-cache-private-key";
|
secretKeyFile = "/run/agenix/binary-cache-private-key";
|
||||||
};
|
};
|
||||||
age.secrets.binary-cache-private-key.file = ../../../secrets/binary-cache-private-key.age;
|
age.secrets.binary-cache-private-key.file = ../../../secrets/binary-cache-private-key.age;
|
||||||
|
users.users.cache-push = {
|
||||||
|
isNormalUser = true;
|
||||||
|
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINpUZFFL9BpBVqeeU63sFPhR9ewuhEZerTCDIGW1NPSB" ];
|
||||||
|
};
|
||||||
|
nix.settings = {
|
||||||
|
trusted-users = [ "cache-push" ];
|
||||||
|
};
|
||||||
|
|
||||||
services.iperf3.enable = true;
|
services.iperf3.enable = true;
|
||||||
services.iperf3.openFirewall = true;
|
services.iperf3.openFirewall = true;
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
"server"
|
"server"
|
||||||
"pia"
|
"pia"
|
||||||
"binary-cache"
|
"binary-cache"
|
||||||
|
"gitea-actions-runner"
|
||||||
];
|
];
|
||||||
|
|
||||||
hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAwiXcUFtAvZCayhu4+AIcF+Ktrdgv9ee/mXSIhJbp4q";
|
hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAwiXcUFtAvZCayhu4+AIcF+Ktrdgv9ee/mXSIhJbp4q";
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
hardware.enableAllFirmware = true;
|
hardware.enableAllFirmware = true;
|
||||||
|
|
||||||
|
# ROCm
|
||||||
hardware.opengl.extraPackages = with pkgs; [
|
hardware.opengl.extraPackages = with pkgs; [
|
||||||
rocm-opencl-icd
|
rocm-opencl-icd
|
||||||
rocm-opencl-runtime
|
rocm-opencl-runtime
|
||||||
@ -40,6 +41,7 @@
|
|||||||
"L+ /opt/rocm/hip - - - - ${pkgs.hip}"
|
"L+ /opt/rocm/hip - - - - ${pkgs.hip}"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# System wide barrier instance
|
||||||
systemd.services.barrier-sddm = {
|
systemd.services.barrier-sddm = {
|
||||||
description = "Barrier mouse/keyboard share";
|
description = "Barrier mouse/keyboard share";
|
||||||
requires = [ "display-manager.service" ];
|
requires = [ "display-manager.service" ];
|
||||||
@ -60,6 +62,9 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Login into X11 plasma so barrier works well
|
||||||
|
services.xserver.displayManager.defaultSession = "Plasma (X11)";
|
||||||
|
|
||||||
users.users.cris = {
|
users.users.cris = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
hashedPassword = "$y$j9T$LMGwHVauFWAcAyWSSmcuS/$BQpDyjDHZZbvj54.ijvNb03tr7IgX9wcjYCuCxjSqf6";
|
hashedPassword = "$y$j9T$LMGwHVauFWAcAyWSSmcuS/$BQpDyjDHZZbvj54.ijvNb03tr7IgX9wcjYCuCxjSqf6";
|
||||||
@ -73,7 +78,20 @@
|
|||||||
# Dr. John A. Zoidberg
|
# Dr. John A. Zoidberg
|
||||||
users.users.john = {
|
users.users.john = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
hashedPassword = "";
|
inherit (config.users.users.googlebot) hashedPassword packages;
|
||||||
uid = 1002;
|
uid = 1002;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Auto login into Plasma in john zoidberg account
|
||||||
|
# services.xserver.displayManager.sddm.settings = {
|
||||||
|
# Autologin = {
|
||||||
|
# Session = "Plasma (X11)";
|
||||||
|
# User = "john";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
jellyfin-media-player
|
||||||
|
config.services.xserver.desktopManager.kodi.package
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
# Fetch key from USB drive
|
# Fetch key from USB drive
|
||||||
keyFileSize = 4096;
|
keyFileSize = 4096;
|
||||||
keyFile = "/dev/disk/by-id/usb-Mass_Storage_Device_121220160204-0:0";
|
keyFile = "/dev/disk/by-id/usb-Mass_Storage_Device_121220160204-0:0-part2";
|
||||||
fallbackToPassword = true;
|
fallbackToPassword = true;
|
||||||
};
|
};
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
@ -35,7 +35,7 @@
|
|||||||
};
|
};
|
||||||
fileSystems."/boot" =
|
fileSystems."/boot" =
|
||||||
{
|
{
|
||||||
device = "/dev/disk/by-uuid/954B-AB3E";
|
device = "/dev/disk/by-uuid/8074-B04D";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
swapDevices =
|
swapDevices =
|
||||||
|
BIN
secrets/binary-cache-push-sshkey.age
Normal file
BIN
secrets/binary-cache-push-sshkey.age
Normal file
Binary file not shown.
11
secrets/gitea-actions-runner-token.age
Normal file
11
secrets/gitea-actions-runner-token.age
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 WBT1Hw ucC+p6pRevUWJIVqG5DfXSO4W0PjR2lUW7tY924FVHA
|
||||||
|
te6rrH/nsn/Pn4mySjQ0mv2M3ZTCOwbglCcnH2ZiUJQ
|
||||||
|
-> ssh-ed25519 hPp1nw 1nmzowG+nzD8ixyqTU+duUxV3g4yWo7RqKJ+dDlf0g8
|
||||||
|
ln3CyhUYuZ71EdyqIPBdeRP98dun4cs9uZnxAGadDG0
|
||||||
|
-> ssh-ed25519 dMQYog pHRtIaJr39QqD7xqX2ovUf8QfUPwDl58TmqHa1xhSDQ
|
||||||
|
dr8tYQ3oFrQehq2326jimOCRDX6Zrsq/epQbVA8+UPw
|
||||||
|
-> I)m(V&-grease i5{
|
||||||
|
lYnHQc5cQahDoah2rPlIlGOLc49nTDp+aHPB
|
||||||
|
--- AdMW2y8Z9XmbxzmvSAP9NKqgj2JGgkimXJqcXIFPdtI
|
||||||
|
]°m]pmòžY.ؽ¢âÞzÀhÑ<68>Sß!fI~Åpô³ˆ]¦KÅ‹Còü\KHgÎí_ÇÌ»§6ÌÑðÜ–Üj”)ü«@á‹[¿
|
@ -22,6 +22,8 @@ with roles;
|
|||||||
# nix binary cache
|
# nix binary cache
|
||||||
# public key: s0.koi-bebop.ts.net:OjbzD86YjyJZpCp9RWaQKANaflcpKhtzBMNP8I2aPUU=
|
# public key: s0.koi-bebop.ts.net:OjbzD86YjyJZpCp9RWaQKANaflcpKhtzBMNP8I2aPUU=
|
||||||
"binary-cache-private-key.age".publicKeys = binary-cache;
|
"binary-cache-private-key.age".publicKeys = binary-cache;
|
||||||
|
# public key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINpUZFFL9BpBVqeeU63sFPhR9ewuhEZerTCDIGW1NPSB
|
||||||
|
"binary-cache-push-sshkey.age".publicKeys = nobody; # this value is directly given to gitea
|
||||||
|
|
||||||
# vpn
|
# vpn
|
||||||
"iodine.age".publicKeys = iodine;
|
"iodine.age".publicKeys = iodine;
|
||||||
@ -43,4 +45,7 @@ with roles;
|
|||||||
# backups
|
# backups
|
||||||
"backblaze-s3-backups.age".publicKeys = personal ++ server;
|
"backblaze-s3-backups.age".publicKeys = personal ++ server;
|
||||||
"restic-password.age".publicKeys = personal ++ server;
|
"restic-password.age".publicKeys = personal ++ server;
|
||||||
|
|
||||||
|
# gitea actions runner
|
||||||
|
"gitea-actions-runner-token.age".publicKeys = gitea-actions-runner;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user