Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6775a88ca8 | |||
| a83500e382 | |||
| ecf8b5974a | |||
| 6a2fb0970c |
+8
-8
@@ -7,7 +7,7 @@
|
|||||||
./desktop.nix
|
./desktop.nix
|
||||||
./nvidia.nix
|
./nvidia.nix
|
||||||
./shell.nix
|
./shell.nix
|
||||||
# ./yami-dev-stack.nix # uncomment to enable Yami dev stack, then set services.yami-dev-stack below
|
./yami-dev-stack.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
@@ -77,16 +77,10 @@
|
|||||||
users.users.chexit = {
|
users.users.chexit = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "chexit";
|
description = "chexit";
|
||||||
shell = pkgs.fish;
|
shell = pkgs.zsh;
|
||||||
extraGroups = [ "networkmanager" "wheel" "docker" ];
|
extraGroups = [ "networkmanager" "wheel" "docker" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
programs._1password.enable = true;
|
|
||||||
programs._1password-gui = {
|
|
||||||
enable = true;
|
|
||||||
polkitPolicyOwners = [ "chexit" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.throne = {
|
programs.throne = {
|
||||||
enable = true;
|
enable = true;
|
||||||
tunMode.enable = true;
|
tunMode.enable = true;
|
||||||
@@ -104,5 +98,11 @@
|
|||||||
# Docker is now managed by yami-dev-stack.nix when that module is enabled.
|
# Docker is now managed by yami-dev-stack.nix when that module is enabled.
|
||||||
# services.yami-dev-stack = { enable = true; user = "chexit"; };
|
# services.yami-dev-stack = { enable = true; user = "chexit"; };
|
||||||
|
|
||||||
|
services.yami-dev-stack = {
|
||||||
|
enable = true;
|
||||||
|
user = "chexit";
|
||||||
|
dataDir = "/mnt/ssd_110/yami";
|
||||||
|
};
|
||||||
|
|
||||||
system.stateVersion = "25.11";
|
system.stateVersion = "25.11";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,22 @@
|
|||||||
{ ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
home.username = "chexit";
|
home.username = "chexit";
|
||||||
home.homeDirectory = "/home/chexit";
|
home.homeDirectory = "/home/chexit";
|
||||||
home.stateVersion = "25.11";
|
home.stateVersion = "25.11";
|
||||||
|
|
||||||
programs.fish = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
enableCompletion = true;
|
||||||
|
autosuggestion.enable = true;
|
||||||
|
syntaxHighlighting.enable = true;
|
||||||
|
initContent = ''
|
||||||
|
source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme
|
||||||
|
'';
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
rebuild = "sudo nixos-rebuild switch --flake ~/nixos-config#chexit";
|
rebuild = "sudo nixos-rebuild switch --flake ~/nixos-config#chexit";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.starship = {
|
|
||||||
enable = true;
|
|
||||||
enableFishIntegration = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{ ... }:
|
{ ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.fish.enable = true;
|
programs.zsh.enable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
+55
-6
@@ -13,9 +13,20 @@ in
|
|||||||
type = types.str;
|
type = types.str;
|
||||||
description = "User that will own runner token and be added to docker group";
|
description = "User that will own runner token and be added to docker group";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dataDir = mkOption {
|
||||||
|
type = types.nullOr types.path;
|
||||||
|
default = null;
|
||||||
|
example = "/mnt/ssd_110/yami";
|
||||||
|
description = ''
|
||||||
|
If set, bind-mounts /var/lib/{gitea,postgresql,gitea-runner} under this
|
||||||
|
path so all stack data lives on a separate disk. Directories are created
|
||||||
|
automatically; existing data must be rsync'd manually before enabling.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable (mkMerge [ {
|
||||||
|
|
||||||
# ── Systemd target ─────────────────────────────────────────────────────────
|
# ── Systemd target ─────────────────────────────────────────────────────────
|
||||||
# Manual-only: nothing in wantedBy, so it never starts on boot.
|
# Manual-only: nothing in wantedBy, so it never starts on boot.
|
||||||
@@ -48,6 +59,10 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
appName = "Yami Git";
|
appName = "Yami Git";
|
||||||
|
|
||||||
|
# LFS enabled via the NixOS helper so the module manages LFS_JWT_SECRET
|
||||||
|
# (writing it to app.ini, which is read-only by design).
|
||||||
|
lfs.enable = true;
|
||||||
|
|
||||||
database = {
|
database = {
|
||||||
type = "postgres";
|
type = "postgres";
|
||||||
socket = "/run/postgresql";
|
socket = "/run/postgresql";
|
||||||
@@ -63,7 +78,6 @@ in
|
|||||||
HTTP_PORT = 3000;
|
HTTP_PORT = 3000;
|
||||||
SSH_PORT = 2222;
|
SSH_PORT = 2222;
|
||||||
START_SSH_SERVER = true;
|
START_SSH_SERVER = true;
|
||||||
LFS_START_SERVER = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
service = {
|
service = {
|
||||||
@@ -125,7 +139,11 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
name = "home-runner";
|
name = "home-runner";
|
||||||
url = "http://localhost:3000";
|
url = "http://localhost:3000";
|
||||||
tokenFile = "/var/lib/gitea-runner/token";
|
# NOT under /var/lib/gitea-runner — that path is systemd-managed for the
|
||||||
|
# service (DynamicUser + StateDirectory means it becomes a symlink to
|
||||||
|
# /var/lib/private/gitea-runner). Pre-creating it ourselves breaks the
|
||||||
|
# service with "Failed to set up special execution directory: File exists".
|
||||||
|
tokenFile = "/var/lib/gitea-runner-secret/token";
|
||||||
labels = [
|
labels = [
|
||||||
"ubuntu-latest:docker://node:20"
|
"ubuntu-latest:docker://node:20"
|
||||||
"native:host"
|
"native:host"
|
||||||
@@ -139,9 +157,14 @@ in
|
|||||||
requires = [ "gitea.service" "docker.service" ];
|
requires = [ "gitea.service" "docker.service" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Directory for the runner token file; owner matches the runner service user.
|
# Runner uses DynamicUser, so there's no static gitea-runner user/group.
|
||||||
|
# Token lives in a sibling dir (not /var/lib/gitea-runner — that's systemd's
|
||||||
|
# StateDirectory and pre-creating it breaks DynamicUser bind setup).
|
||||||
|
# The file MUST be in env-file format, not a raw token:
|
||||||
|
# TOKEN=<paste-registration-token-from-gitea-ui>
|
||||||
|
# Get the token from Site Administration → Actions → Runners → Create new Runner.
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d /var/lib/gitea-runner 0700 gitea-runner gitea-runner -"
|
"d /var/lib/gitea-runner-secret 0700 root root -"
|
||||||
];
|
];
|
||||||
|
|
||||||
# ── Shell aliases ──────────────────────────────────────────────────────────
|
# ── Shell aliases ──────────────────────────────────────────────────────────
|
||||||
@@ -155,5 +178,31 @@ in
|
|||||||
# ── Firewall ───────────────────────────────────────────────────────────────
|
# ── Firewall ───────────────────────────────────────────────────────────────
|
||||||
# Merged with existing rules (Steam etc.); does not overwrite them.
|
# Merged with existing rules (Steam etc.); does not overwrite them.
|
||||||
networking.firewall.allowedTCPPorts = [ 3000 2222 ];
|
networking.firewall.allowedTCPPorts = [ 3000 2222 ];
|
||||||
};
|
}
|
||||||
|
|
||||||
|
# ── Optional: move all stack data to a separate disk via bind-mounts ─────────
|
||||||
|
(mkIf (cfg.dataDir != null) (
|
||||||
|
let
|
||||||
|
# gitea-runner intentionally NOT bind-mounted: its service uses
|
||||||
|
# DynamicUser + StateDirectory, which refuses to adopt an existing
|
||||||
|
# mount point ("Failed to set up special execution directory: File exists").
|
||||||
|
# Its data is tiny (token + .runner state) so it stays on the system disk.
|
||||||
|
subs = [ "gitea" "postgresql" ];
|
||||||
|
mkBind = name: {
|
||||||
|
name = "/var/lib/${name}";
|
||||||
|
value = {
|
||||||
|
device = "${cfg.dataDir}/${name}";
|
||||||
|
fsType = "none";
|
||||||
|
options = [ "bind" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
# Ensure target dirs exist on the data disk before mounts happen.
|
||||||
|
systemd.tmpfiles.rules = map (n: "d ${cfg.dataDir}/${n} 0755 root root -") subs
|
||||||
|
++ [ "d ${cfg.dataDir} 0755 root root -" ];
|
||||||
|
|
||||||
|
fileSystems = listToAttrs (map mkBind subs);
|
||||||
|
}
|
||||||
|
))
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user