Compare commits
3 Commits
attic
...
8b26a990ee
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b26a990ee | |||
| c92c4d37b7 | |||
| f15efb661e |
@@ -49,7 +49,6 @@
|
|||||||
|
|
||||||
deertopia = {
|
deertopia = {
|
||||||
authelia.enable = true;
|
authelia.enable = true;
|
||||||
atticd.enable = true;
|
|
||||||
gitea.enable = true;
|
gitea.enable = true;
|
||||||
quiver.enable = true;
|
quiver.enable = true;
|
||||||
www.enable = true;
|
www.enable = true;
|
||||||
|
|||||||
25
modules/home/users/msyds/sioyek.nix
Normal file
25
modules/home/users/msyds/sioyek.nix
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.sydnix.users.msyds.sioyek;
|
||||||
|
in {
|
||||||
|
options.sydnix.users.msyds.sioyek = {
|
||||||
|
enable = lib.mkEnableOption "Sioyek";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
programs.sioyek = {
|
||||||
|
enable = true;
|
||||||
|
bindings = {
|
||||||
|
"move_down_smooth" = "j";
|
||||||
|
"move_up_smooth" = "k";
|
||||||
|
"screen_down_smooth" = [ "d" "<C-d>" ];
|
||||||
|
"screen_up_smooth" = [ "u" "<C-u>" ];
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
startup_commands = ''
|
||||||
|
toggle_dark_mode
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
let cfg = config.sydnix.deertopia.atticd;
|
|
||||||
in {
|
|
||||||
options.sydnix.deertopia.atticd = {
|
|
||||||
enable = lib.mkEnableOption "Atticd";
|
|
||||||
port = lib.mkOption {
|
|
||||||
default = 8012;
|
|
||||||
type = lib.types.port;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# sudo atticd-atticadm make-token --sub msyds --validity '1 year' --pull 'msyds-*' --push 'msyds-*' --create-cache 'msyds-*' --configure-cache 'msyds-*'
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
sydnix.sops.secrets.atticd-environment-file = {
|
|
||||||
# owner = config.services.atticd.user;
|
|
||||||
# group = config.services.atticd.group;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.atticd = {
|
|
||||||
enable = true;
|
|
||||||
environmentFile =
|
|
||||||
config.sops.secrets.atticd-environment-file.path;
|
|
||||||
settings = {
|
|
||||||
api-endpoint = "https://attic.deertopia.net/";
|
|
||||||
listen = "[::]:${toString cfg.port}";
|
|
||||||
garbage-collection = {
|
|
||||||
default-retention-period = "3 months";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
sydnix.deertopia.nginx.vhosts."attic".vhost = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/".proxyPass =
|
|
||||||
"http://127.0.0.1:${toString cfg.port}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -3,13 +3,51 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.sydnix.gitea-actions-runner;
|
cfg = config.sydnix.gitea-actions-runner;
|
||||||
container-name = "gitea-actions-runner";
|
|
||||||
gitea-actions-runner-uid = 991;
|
|
||||||
gitea-actions-runner-gid = 989;
|
|
||||||
token-file = config.sops.secrets.gitea-actions-runner-token.path;
|
token-file = config.sops.secrets.gitea-actions-runner-token.path;
|
||||||
in {
|
in {
|
||||||
options.sydnix.gitea-actions-runner = {
|
options.sydnix.gitea-actions-runner = {
|
||||||
enable = lib.mkEnableOption "Gitea actions runner";
|
enable = lib.mkEnableOption "Gitea actions runner";
|
||||||
|
instance-name = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = config.networking.hostName;
|
||||||
|
description = ''
|
||||||
|
The name of the runner instance name.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
user.name = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "gitea-actions-runner";
|
||||||
|
description = ''
|
||||||
|
The name of the user gitea-actions-runner should run under.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
user.uid = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 991;
|
||||||
|
description = ''
|
||||||
|
The UID of the user gitea-actions-runner should run under.
|
||||||
|
This must be known at evaluation time so that the same UID can
|
||||||
|
be used both on the host and in the container, allowing the
|
||||||
|
container to access the host's nix-daemon.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
group.name = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "gitea-actions-runner";
|
||||||
|
description = ''
|
||||||
|
The name of the group gitea-actions-runner should run under.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
group.gid = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 989;
|
||||||
|
description = ''
|
||||||
|
The GID of the group gitea-actions-runner should run under.
|
||||||
|
This must be known at evaluation time so that the same GID can
|
||||||
|
be used both on the host and in the container, allowing the
|
||||||
|
container to access the host's nix-daemon.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
@@ -17,7 +55,7 @@ in {
|
|||||||
|
|
||||||
sydnix.impermanence.directories = [ "/var/lib/gitea-actions-runner" ];
|
sydnix.impermanence.directories = [ "/var/lib/gitea-actions-runner" ];
|
||||||
|
|
||||||
containers.${container-name} = {
|
containers."gitea-actions-runner" = {
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
ephemeral = true;
|
ephemeral = true;
|
||||||
|
|
||||||
@@ -35,9 +73,9 @@ in {
|
|||||||
config = { config, lib, pkgs, ... }: {
|
config = { config, lib, pkgs, ... }: {
|
||||||
system.stateVersion = "25.11";
|
system.stateVersion = "25.11";
|
||||||
|
|
||||||
services.gitea-actions-runner.instances.sydpc = {
|
services.gitea-actions-runner.instances.${cfg.instance-name} = {
|
||||||
enable = true;
|
enable = true;
|
||||||
name = "sydpc";
|
name = cfg.instance-name;
|
||||||
url = "https://git.deertopia.net/";
|
url = "https://git.deertopia.net/";
|
||||||
tokenFile = token-file;
|
tokenFile = token-file;
|
||||||
labels = [ "nixos:host" ];
|
labels = [ "nixos:host" ];
|
||||||
@@ -56,23 +94,27 @@ in {
|
|||||||
|
|
||||||
# Disable dynamic user so runner state persists via bind mount
|
# Disable dynamic user so runner state persists via bind mount
|
||||||
assertions = [{
|
assertions = [{
|
||||||
assertion = config.systemd.services.gitea-actions-runner-sydpc.enable;
|
assertion =
|
||||||
|
config.systemd.services.gitea-actions-runner-sydpc.enable;
|
||||||
message = ''
|
message = ''
|
||||||
Expected systemd service 'gitea-actions-runner-sydpc' is not
|
Expected systemd service 'gitea-actions-runner-sydpc' is
|
||||||
enabled — the gitea-actions-runner module may have changed
|
not enabled — the gitea-actions-runner NixOS module may
|
||||||
its naming scheme.
|
have changed its naming scheme.
|
||||||
'';
|
'';
|
||||||
}];
|
}];
|
||||||
|
|
||||||
systemd.services.gitea-actions-runner-sydpc.serviceConfig.DynamicUser
|
systemd.services.gitea-actions-runner-sydpc.serviceConfig.DynamicUser
|
||||||
= lib.mkForce false;
|
= lib.mkForce false;
|
||||||
users.users.gitea-actions-runner = {
|
|
||||||
uid = gitea-actions-runner-uid;
|
users.users.${cfg.user.name} = {
|
||||||
|
uid = cfg.user.uid;
|
||||||
home = "/var/lib/gitea-actions-runner";
|
home = "/var/lib/gitea-actions-runner";
|
||||||
group = "gitea-actions-runner";
|
group = cfg.group.name;
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
createHome = true;
|
createHome = true;
|
||||||
};
|
};
|
||||||
users.groups.gitea-actions-runner.gid = gitea-actions-runner-gid;
|
|
||||||
|
users.groups.gitea-actions-runner.gid = cfg.group.gid;
|
||||||
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
|
||||||
@@ -81,23 +123,27 @@ in {
|
|||||||
nodejs
|
nodejs
|
||||||
jq
|
jq
|
||||||
attic-client
|
attic-client
|
||||||
|
omnix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Needs to be outside of the container because container uses's
|
# Needs to be outside of the container because container uses's
|
||||||
# the host's nix-daemon
|
# the host's nix-daemon
|
||||||
nix.settings.trusted-users = [ "gitea-actions-runner" ];
|
nix.settings.trusted-users = [
|
||||||
|
cfg.user.name
|
||||||
|
];
|
||||||
|
|
||||||
# Matching user on host — the container's gitea-actions-runner UID must be
|
# Matching user on host — the container's gitea-actions-runner UID
|
||||||
# recognized by the host's nix-daemon as trusted (shared UID namespace)
|
# must be recognized by the host's nix-daemon as trusted (shared
|
||||||
users.users.gitea-actions-runner = {
|
# UID namespace)
|
||||||
uid = gitea-actions-runner-uid;
|
users.users.${cfg.user.name} = {
|
||||||
|
uid = cfg.user.uid;
|
||||||
home = "/var/lib/gitea-actions-runner";
|
home = "/var/lib/gitea-actions-runner";
|
||||||
group = "gitea-actions-runner";
|
group = cfg.group.name;
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
createHome = true;
|
createHome = true;
|
||||||
};
|
};
|
||||||
users.groups.gitea-actions-runner.gid = gitea-actions-runner-gid;
|
users.groups.${cfg.group.name}.gid = cfg.group.gid;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,10 +70,6 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
# O_O what the fuck did i write this for.... CONCERNING.
|
# O_O what the fuck did i write this for.... CONCERNING.
|
||||||
#
|
|
||||||
# oh because of these types of errors:
|
|
||||||
# Directory "/var/lib/private" already exists, but has mode 0755
|
|
||||||
# that is too permissive (0700 was requested), refusing.
|
|
||||||
systemd.tmpfiles.settings."10-varlibprivate" = {
|
systemd.tmpfiles.settings."10-varlibprivate" = {
|
||||||
"/var/lib/private" = {
|
"/var/lib/private" = {
|
||||||
z.group = "root";
|
z.group = "root";
|
||||||
@@ -82,13 +78,6 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Workaround for https://github.com/nix-community/impermanence/issues/254.
|
|
||||||
systemd.services."systemd-tmpfiles-resetup" = {
|
|
||||||
serviceConfig = {
|
|
||||||
RemainAfterExit = lib.mkForce false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Permit members of `cfg.persistGroupName` to read, write, and execute
|
# Permit members of `cfg.persistGroupName` to read, write, and execute
|
||||||
# /persist.
|
# /persist.
|
||||||
systemd.tmpfiles.settings."10-persist" = {
|
systemd.tmpfiles.settings."10-persist" = {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -67,6 +67,7 @@
|
|||||||
syncthing.enable = true;
|
syncthing.enable = true;
|
||||||
fonts.enable = true;
|
fonts.enable = true;
|
||||||
dank-material-shell.enable = true;
|
dank-material-shell.enable = true;
|
||||||
|
sioyek.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user