add rustypaste module

This commit is contained in:
ulic-youthlic 2025-02-04 16:17:25 +08:00
parent 1a6d282046
commit eb3d5353a2
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
8 changed files with 301 additions and 2 deletions

View file

@ -1,6 +1,7 @@
{ ... }:
{
imports = [
./rustypaste-cli.nix
./atuin.nix
./firefox.nix
./shell

View file

@ -0,0 +1,40 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.youthlic.programs.rustypaste-cli;
in
{
options = {
youthlic.programs.rustypaste-cli = {
enable = lib.mkEnableOption "rustypaste-cli";
};
};
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.rustypaste-cli ];
sops = {
secrets = {
"rustypaste/auth" = { };
"rustypaste/delete" = { };
};
templates."rustypaste-config.toml" = {
path = "${config.xdg.configHome}/rustypaste/config.toml";
content = ''
[server]
address = "https://paste.youthlic.fun"
auth_token = "${config.sops.placeholder."rustypaste/auth"}"
delete_token = "${config.sops.placeholder."rustypaste/delete"}"
[paste]
oneshot = false
[style]
prettify = true
'';
};
};
};
}