Compare commits

...

2 Commits

Author SHA1 Message Date
959305c93c format 2025-12-23 15:41:12 +00:00
203a3f9b71 fix depreciation again 2025-12-23 15:41:12 +00:00
6 changed files with 259 additions and 228 deletions

View File

@@ -102,7 +102,7 @@
flake.colmena = flake.colmena =
{ {
meta = { meta = {
nixpkgs = import inputs.nixpkgs {system = "x86_64-linux";}; nixpkgs = import inputs.nixpkgs {localSystem = "x86_64-linux";};
specialArgs = {inherit inputs user constants;}; specialArgs = {inherit inputs user constants;};
}; };
} }
@@ -115,6 +115,7 @@
imports = [ imports = [
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
{ {
nixpkgs.hostPlatform = "x86_64-linux";
nixpkgs.overlays = overlays; nixpkgs.overlays = overlays;
_module.args.hostname = hostname; _module.args.hostname = hostname;
} }

View File

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

View File

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

View File

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

View File

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