This commit is contained in:
2025-12-23 15:41:08 +00:00
parent 203a3f9b71
commit 959305c93c
5 changed files with 257 additions and 227 deletions

View File

@@ -7,7 +7,8 @@
in {
sops.age.keyFile = "/Users/${user}/.config/sops/age/keys.txt";
sops.secrets = secrets.mkSyncthingSecrets {
sops.secrets =
secrets.mkSyncthingSecrets {
inherit hostname user;
isDarwin = true;
};

View File

@@ -9,7 +9,8 @@ in {
sops.age.sshKeyPaths = [];
sops.gnupg.sshKeyPaths = [];
sops.secrets = secrets.mkSyncthingSecrets {
sops.secrets =
secrets.mkSyncthingSecrets {
inherit hostname user;
isDarwin = true;
};

View File

@@ -1,4 +1,8 @@
{config, hostname, ...}: {
{
config,
hostname,
...
}: {
networking = {
hostName = hostname;
useDHCP = false;

View File

@@ -10,38 +10,46 @@ in {
options.my.pgbackrest = {
enable = mkEnableOption "pgBackRest PostgreSQL backup";
stanza = mkOption {
stanza =
mkOption {
type = types.str;
default = "main";
description = "Name of the pgBackRest stanza";
};
secretFile = mkOption {
secretFile =
mkOption {
type = types.path;
description = "Path to the environment file containing S3 credentials and cipher passphrase";
};
s3 = mkOption {
type = types.submodule {
s3 =
mkOption {
type =
types.submodule {
options = {
endpoint = mkOption {
endpoint =
mkOption {
type = types.str;
default = "s3.eu-central-003.backblazeb2.com";
description = "S3 endpoint URL";
};
bucket = mkOption {
bucket =
mkOption {
type = types.str;
description = "S3 bucket name";
};
region = mkOption {
region =
mkOption {
type = types.str;
default = "eu-central-003";
description = "S3 region";
};
path = mkOption {
path =
mkOption {
type = types.str;
default = "/backups";
description = "Path within the S3 bucket";
@@ -52,16 +60,20 @@ in {
description = "S3 storage configuration";
};
retention = mkOption {
type = types.submodule {
retention =
mkOption {
type =
types.submodule {
options = {
full = mkOption {
full =
mkOption {
type = types.int;
default = 7;
description = "Number of full backups to retain";
};
diff = mkOption {
diff =
mkOption {
type = types.int;
default = 7;
description = "Number of differential backups to retain";
@@ -72,16 +84,20 @@ in {
description = "Backup retention configuration";
};
compression = mkOption {
type = types.submodule {
compression =
mkOption {
type =
types.submodule {
options = {
type = mkOption {
type =
mkOption {
type = types.str;
default = "zst";
description = "Compression algorithm (none, gz, lz4, zst)";
};
level = mkOption {
level =
mkOption {
type = types.int;
default = 3;
description = "Compression level";
@@ -92,22 +108,27 @@ in {
description = "Compression configuration";
};
processMax = mkOption {
processMax =
mkOption {
type = types.int;
default = 2;
description = "Maximum number of processes for parallel operations";
};
schedule = mkOption {
type = types.submodule {
schedule =
mkOption {
type =
types.submodule {
options = {
full = mkOption {
full =
mkOption {
type = types.str;
default = "daily";
description = "OnCalendar expression for full backups";
};
diff = mkOption {
diff =
mkOption {
type = types.str;
default = "hourly";
description = "OnCalendar expression for differential backups";
@@ -119,8 +140,10 @@ in {
};
};
config = mkIf cfg.enable (let
archivePushScript = pkgs.writeShellScript "pgbackrest-archive-push" ''
config =
mkIf cfg.enable (let
archivePushScript =
pkgs.writeShellScript "pgbackrest-archive-push" ''
set -a
source ${cfg.secretFile}
set +a

View File

@@ -127,7 +127,8 @@
};
};
home.file.".config/opencode/oh-my-opencode.json".text = builtins.toJSON {
home.file.".config/opencode/oh-my-opencode.json".text =
builtins.toJSON {
"$schema" = "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json";
google_auth = false;
agents = {