Compare commits

...

6 commits

Author SHA1 Message Date
cy
956fae1f04
flake update
Signed-off-by: cy <cy@cy7.sh>
2025-02-13 22:43:56 -05:00
cy
d23e73a4ba
oauth for zipline 2025-02-13 22:40:30 -05:00
cy
0c9823a5aa
fmt 2025-02-13 21:50:19 -05:00
cy
9877335f4b
add zipline 2025-02-13 21:49:52 -05:00
cy
0992f2f308
enable appimage, overlay anki 2025-02-13 21:49:45 -05:00
cy
3684b35d59
nix fmt 2025-02-12 20:04:36 -05:00
11 changed files with 149 additions and 39 deletions

View file

@ -113,3 +113,8 @@ creation_rules:
- age: - age:
- *yt - *yt
- *cy - *cy
- path_regex: secrets/services/zipline.yaml
key_groups:
- age:
- *chunk
- *cy

73
flake.lock generated
View file

@ -1,5 +1,21 @@
{ {
"nodes": { "nodes": {
"anki": {
"locked": {
"lastModified": 1739471491,
"narHash": "sha256-ZCKWgsNqKWkVOAQFaFSmK3EN/uDdamNOcSItzvooWYs=",
"owner": "cything",
"repo": "nixpkgs",
"rev": "1562f5286858b3c1e5ea7e60f4bf6b3578519248",
"type": "github"
},
"original": {
"owner": "cything",
"repo": "nixpkgs",
"rev": "1562f5286858b3c1e5ea7e60f4bf6b3578519248",
"type": "github"
}
},
"attic": { "attic": {
"inputs": { "inputs": {
"crane": "crane", "crane": "crane",
@ -562,11 +578,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739381933, "lastModified": 1739470101,
"narHash": "sha256-4gvobxITgcrNGfwsVG5a46QzQCX89btIYw23p0ilbcc=", "narHash": "sha256-NxNe32VB4XI/xIXrsKmIfrcgtEx5r/5s52pL3CpEcA4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "15b59d4191b993ebdfcb1f61b834fced217882ba", "rev": "5031c6d2978109336637977c165f82aa49fa16a7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -683,11 +699,11 @@
"pre-commit-hooks": "pre-commit-hooks" "pre-commit-hooks": "pre-commit-hooks"
}, },
"locked": { "locked": {
"lastModified": 1739192059, "lastModified": 1739445948,
"narHash": "sha256-r40TUIL6zij0kWBpqKyI7O2brT3Myaa3aAGamkZEvfc=", "narHash": "sha256-mmfFqhYjKP7nke1cs3x+bjP6GOG8A82Zxvrc9IfYwEA=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "3bca42eb0049772d9079f29f25186575f8e5a4ae", "rev": "406f4fed35fe495457a0f6487a7be3b025cab1c4",
"revCount": 17406, "revCount": 17410,
"type": "git", "type": "git",
"url": "https://git.lix.systems/lix-project/lix" "url": "https://git.lix.systems/lix-project/lix"
}, },
@ -763,11 +779,11 @@
"xwayland-satellite-unstable": "xwayland-satellite-unstable" "xwayland-satellite-unstable": "xwayland-satellite-unstable"
}, },
"locked": { "locked": {
"lastModified": 1739339370, "lastModified": 1739496005,
"narHash": "sha256-kvuVhsaVa8j0P9Genf96CLX2cNjForojX5aB1BN+Bwk=", "narHash": "sha256-qr7v18JupLdyjUhC3zczdYzUEC4zzsxGjxsVGgYzwYg=",
"owner": "sodiboo", "owner": "sodiboo",
"repo": "niri-flake", "repo": "niri-flake",
"rev": "498e8bbc149b38fd14d4ff7fbf31c49fdaa23282", "rev": "e072f4a57cad4fb92e656fd69a340c8d372cacac",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -796,11 +812,11 @@
"niri-unstable": { "niri-unstable": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1739336386, "lastModified": 1739432365,
"narHash": "sha256-H9E3lfJibzWwqV9C1pI81uhav1RLWRA8JbH3ADv3X/4=", "narHash": "sha256-uQm3OhhgUQHA5eV+0v/qAFmFHly8yHg2P+BVVy/3DcY=",
"owner": "YaLTeR", "owner": "YaLTeR",
"repo": "niri", "repo": "niri",
"rev": "7e552333a993e83a2dba52392109617e486f5f60", "rev": "4c98b874862c2e6df7f71bdf36df0ba527690fbb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1027,11 +1043,11 @@
}, },
"nixpkgs-stable_4": { "nixpkgs-stable_4": {
"locked": { "locked": {
"lastModified": 1739206421, "lastModified": 1739357830,
"narHash": "sha256-PwQASeL2cGVmrtQYlrBur0U20Xy07uSWVnFup2PHnDs=", "narHash": "sha256-9xim3nJJUFbVbJCz48UP4fGRStVW5nv4VdbimbKxJ3I=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "44534bc021b85c8d78e465021e21f33b856e2540", "rev": "0ff09db9d034a04acd4e8908820ba0b410d7a33a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1091,11 +1107,11 @@
}, },
"nixpkgs_5": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1739346810, "lastModified": 1739478914,
"narHash": "sha256-RNNghMmVysP8+zpmlFK3fMfrFOK5ZUtPCCi5nW7yZS4=", "narHash": "sha256-qljqSeAWOFbd6HNg8Ey28RdZYdVN8bMb6HJK7uqCKZ0=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "696f2000ad7ad6f600159d49647a88bdf0e42f9f", "rev": "6f9b8ea84c04411c48ab5aab4620ab204936d9fc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1128,11 +1144,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739353096, "lastModified": 1739469954,
"narHash": "sha256-w/T2uYCoq4k6K46GX2CMGWsKfMvcqnxC41LIgnvGifE=", "narHash": "sha256-faUXxkM3yYm++fpEw02tbAgPJprVB0xOtrU87BEQkuI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "78b6f8e1e5b37a7789216e17a96ebc117660f0e7", "rev": "7f29e4b2ae34c1ba5fe650d74c8f28b0d1fa21ee",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1265,6 +1281,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"anki": "anki",
"conduwuit": "conduwuit", "conduwuit": "conduwuit",
"crane": "crane_2", "crane": "crane_2",
"disko": "disko", "disko": "disko",
@ -1313,11 +1330,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739327257, "lastModified": 1739500069,
"narHash": "sha256-rlGK8wxz/e50Z+PQRzuP+m03IrGkhcPGmgkBnkEZ9C8=", "narHash": "sha256-eCxWMqMsP2KQkleWWhs9KzFvxgd9v0F0iq7Piw6XDAs=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "e01f2c035b7b8a428c119b183f4cbc55f2eef07c", "rev": "cd3e0a87bf9edadb0f311ba1eb677bbae7a08b81",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1409,11 +1426,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739324903, "lastModified": 1739497746,
"narHash": "sha256-VqtzYG8GK1BBaJx/zdxoLdeHSskETlldfYKZHSt6Ew8=", "narHash": "sha256-Bfok+AZ/iTOmJNndwR7wOZbsuL5/gks3GH2qvWTxpGs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-vscode-extensions", "repo": "nix-vscode-extensions",
"rev": "00d1dbcc3d422c6eabf9285759a4469a5a5a7542", "rev": "6113f471097e12ff293e86b36e74aee21c55204e",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -100,6 +100,9 @@
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
crane.url = "github:ipetkov/crane"; crane.url = "github:ipetkov/crane";
flake-compat.url = "github:edolstra/flake-compat"; flake-compat.url = "github:edolstra/flake-compat";
# unmerged PRs
anki.url = "github:cything/nixpkgs/1562f5286858b3c1e5ea7e60f4bf6b3578519248";
}; };
nixConfig = { nixConfig = {

View file

@ -6,16 +6,20 @@
enableUpdateCheck = false; enableUpdateCheck = false;
enableExtensionUpdateCheck = false; enableExtensionUpdateCheck = false;
mutableExtensionsDir = false; mutableExtensionsDir = false;
extensions = (with pkgs.open-vsx; [ extensions =
vscodevim.vim # if unfree
jnoortheen.nix-ide # (with pkgs.vscode-marketplace; [
editorconfig.editorconfig (
github.github-vscode-theme with pkgs.open-vsx;
rust-lang.rust-analyzer [
]) ++ vscodevim.vim
(with pkgs.vscode-marketplace; [ jnoortheen.nix-ide
github.codespaces editorconfig.editorconfig
]); github.github-vscode-theme
rust-lang.rust-analyzer
shd101wyy.markdown-preview-enhanced
]
);
userSettings = { userSettings = {
"workbench.colorTheme" = "GitHub Dark Default"; "workbench.colorTheme" = "GitHub Dark Default";
"files.autoSave" = "afterDelay"; "files.autoSave" = "afterDelay";

View file

@ -72,6 +72,9 @@
"tailscale/auth" = { "tailscale/auth" = {
sopsFile = ../../secrets/services/tailscale.yaml; sopsFile = ../../secrets/services/tailscale.yaml;
}; };
"zipline/env" = {
sopsFile = ../../secrets/services/zipline.yaml;
};
}; };
boot = { boot = {
@ -207,4 +210,5 @@
environment.enableAllTerminfo = true; environment.enableAllTerminfo = true;
my.roundcube.enable = true; my.roundcube.enable = true;
my.zipline.enable = true;
} }

View file

@ -8,7 +8,7 @@
s3_api = { s3_api = {
s3_region = "earth"; s3_region = "earth";
api_bind_addr = "[::]:3900"; api_bind_addr = "[::]:3900";
root_domain = ".s3.cy7.sh"; root_domain = "s3.cy7.sh";
}; };
s3_web = { s3_web = {
bind_addr = "[::]:3902"; bind_addr = "[::]:3902";

View file

@ -402,4 +402,9 @@
enable = true; enable = true;
enableQt5Integration = true; enableQt5Integration = true;
}; };
programs.appimage = {
enable = true;
binfmt = true;
};
} }

View file

@ -4,5 +4,6 @@
./backup.nix ./backup.nix
./caddy.nix ./caddy.nix
./roundcube.nix ./roundcube.nix
./zipline.nix
]; ];
} }

39
modules/zipline.nix Normal file
View file

@ -0,0 +1,39 @@
{
config,
lib,
...
}:
let
cfg = config.my.zipline;
in
{
options.my.zipline = {
enable = lib.mkEnableOption "zipline";
};
config = lib.mkIf cfg.enable {
services.zipline = {
enable = true;
settings = {
CORE_PORT = 3001;
DATASOURCE_TYPE = "s3";
DATASOURCE_S3_ENDPOINT = "e3e97aac307d106a7becea43cef8fcbd.r2.cloudflarestorage.com";
DATASOURCE_S3_BUCKET = "zipline";
DATASOURCE_S3_REGION = "auto";
DATASOURCE_S3_USE_SSL = "true";
DATASOURCE_S3_FORCE_S3_PATH = "false";
FEATURES_THUMBNAILS = "true";
EXIF_REMOVE_GPS = "true";
CHUNKS_CHUNKS_SIZE = "50mb";
CHUNKS_MAX_SIZE = "95mb";
FEATURES_OAUTH_REGISTRATION = "true";
};
environmentFiles = [ config.sops.secrets."zipline/env".path ];
};
services.caddy.virtualHosts."host.cy7.sh".extraConfig = ''
import common
reverse_proxy 127.0.0.1:3001
'';
};
}

View file

@ -20,6 +20,7 @@ importedOverlays
lldb = pkgFrom stable "lldb"; lldb = pkgFrom stable "lldb";
calibre = pkgFrom stable "calibre"; calibre = pkgFrom stable "calibre";
nil = inputs.nil.packages.${prev.system}.nil; nil = inputs.nil.packages.${prev.system}.nil;
anki = pkgFrom inputs.anki "anki-bin";
} }
) )
] ]

View file

@ -0,0 +1,31 @@
zipline:
env: ENC[AES256_GCM,data:lsR/+bET/C7ssik0xv5IBITT+KEnoyqNjSZ9jvkkb7lmNAQzow6dCm1nprfimiJC0EF2LyiEPm0wchdtrLTNEtUkJWkworEJXeWGrGGbHgZW0/HC1BSERqlLmZTPyLWkhsl3rObvuhRoTKlUN5EMwtK8x06aOX6PcxLdwVjps7UxkBXej712IcKPvHVSJIQMvVHP2lqSppJc+sEMt4u3Vnf1ZYGsQS3bWnI7w40sOdGR8LGBadfmWwIj0/3XTaG7S7Lhi4AOFGZtpdyOmxxIH3Vd5qesfiqPHm0nTmu/JxPftYm+F/hDnbJHrbg7cNVlJahDFtQp8QdlVvdMU3ccNptpRXGWIwFOz3JtuzDo7pxkYRqO2dKqYbKhOknrMW0PYuB48XEKj3e4Q+T8tUhFTsOHfqT0J8ati26dQaUO5wvw22o=,iv:QeR8fU9bRVO5OuqjbEeiC1vihbLxrNgnR0k0K/mRmSw=,tag:6x2XELOlJ9JWeOuVBBHNpg==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1eg6sxflw6l44fp20sl068sampwd95fm0mnh4ssegrhtktgm50ptqcuspyn
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBDUDFDSnFEM1NZK0lSMnUx
YkI3MWlpY1VjYXdaKzBCOFc5NWp5NXdBbkdVCmI0Z2tuSXBOSFN2NXJTUWxKQXNu
SGhhTTYzUDFSOFFXdU5aVHlmYnJNa1UKLS0tIGlrUTErQkVRdFBYYWxUcklHaUVY
UkQ3eVlDR2lMOEZGNXRjU3J3RXpwZkUKNJL/dvPsGu0AJiXryR8uSM0jE//cQi0b
AeYUjXLRcouUq5zWL6AsKDOUAo9t//AAFZqv3DGUboR8UzdymYRYMw==
-----END AGE ENCRYPTED FILE-----
- recipient: age10h6pg5qdpc4t0rpmksfv788a57f04n83zgqaezkjjn65nkhv547s0vxfdn
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB0Wk9ZYkExU3k0ZWpOZEhF
TkswRGxTd1hpcGJaa1pmcUJFQnZMcGV6L0ZFCnp3K05YdU56WUl1TktVSFNQWWZH
bG5COXVuSjFCUWpEYXQweVFPaDAzcTQKLS0tIFgralQ1TWUzajVOM3RyS3RDcnRx
WHZSeVJIaGRldmhmcWZvT3YzL3hPbFEKVUtCU1l/RhFOlwdjE0ejW/Ym+cMVNxIW
AdvVcWoilMGTsDJIIlLu7fPbhmGotPvqGjxMC2yEpEgJUt/rsz2vPA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-02-14T03:37:09Z"
mac: ENC[AES256_GCM,data:KViPAUWWpE5UTZOp55f3QeXhHkXBvyl9Np/Tlj5bY7t3qt1U370OLq1yL87WWbvRWa/K/ZYN2gjN16dgfp5o834VniSJM6dnw+vC76QNaXjCfE2HKozRx6NlHFMflzzV8TXvqzJvuPa43E8DRaBctY2a7aIbJ4DJki1dfmrrO3Y=,iv:vPeMWOWQNZX3t4BoYzpuI74tZJ3rCXwbxmqcRAW5ZXY=,tag:i4ZjIXg0JOj2U2jMwurChw==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.4