Skip to content

Conversation

@3nln
Copy link

@3nln 3nln commented Oct 6, 2025

No description provided.

@foxdevuz foxdevuz requested a review from orzklv October 6, 2025 17:32
@foxdevuz
Copy link
Member

foxdevuz commented Oct 6, 2025

@orzklv ko'rib berolasizmi?

@orzklv
Copy link
Member

orzklv commented Oct 6, 2025

Juda juda ko'p ishlov kerak, Hamda deploy qilish uchun modul yo'q.

Misol: https://github.com/xinux-org/telegram/blob/main/module.nix

@3nln 3nln closed this Oct 8, 2025
@foxdevuz foxdevuz mentioned this pull request Oct 8, 2025
@foxdevuz
Copy link
Member

foxdevuz commented Oct 8, 2025

@3nln manashu yerda davom etaylik.

@orzklv review qilib berolasizmi?

@foxdevuz foxdevuz reopened this Oct 8, 2025
Copy link
Member

@orzklv orzklv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iltimos, ushbu o'zgarishlar ko'rib chiqilsin, o'ta muhim!

};

# We only manage it if explicitly enabled.
systemd.tmpfiles.rules = mkIf cfg.nginx.manageWebroot [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qiziq savol: Nimaga o'zilarni o'sha build joyidan ishga tushurish o'rniga aynan webRoot ga ko'chirishga harakat qilayabsizlar? Botga ishga tushganda biron relativ lokatsiyada fayl yaratadimi? Yoki read-only mode da ishlashga sizlarga nima to'sqinlik qilayabdi?

Comment on lines +9 to +91
options.services.php-tg-bot = {
enable = mkEnableOption "PHP Telegram bot service";

user = mkOption {
type = types.str;
default = "php-tg-bot";
};

group = mkOption {
type = types.str;
default = "php-tg-bot";
};

package = mkOption {
type = types.package;
default = pkgs.callPackage ./. {};
};

phpPackage = mkOption {
type = types.package;
default = pkgs.php84;
};

environment = mkOption {
type = with types; attrsOf str;
default = {};
example = { TELEGRAM_BOT_TOKEN = "xxxx"; APP_ENV = "production"; };
};

fpm = {
enable = mkOption {
type = types.bool;
default = false;
};

poolName = mkOption {
type = types.str;
default = "php-tg-bot";
};

settings = mkOption {
type = with types; attrsOf (oneOf [ str int bool ]);
default = {};
example = {
"pm" = "dynamic";
"pm.max_children" = 10;
"listen" = "/run/phpfpm/php-tg-bot.sock";
};
};
};

serviceConfig = mkOption {
type = types.attrs;
default = {};
};

nginx = {
enable = mkOption {
type = types.bool;
default = false;
};

serverName = mkOption {
type = types.str;
default = "php-tg-bot.local";
};

webroot = mkOption {
type = types.path;
default = "/var/www/php-tg-bot";
};

webhookPath = mkOption {
type = types.str;
default = "/";
};

manageWebroot = mkOption {
type = types.bool;
default = true;
};
};
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agar men hozir bu proyektdan manual chiqarsam, bironta option uchun tavsilot bo'lmaydi. Iltimos, description lar erinmasdan tushunarli qilib yozib chiqingizlar.


inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flake.parts ishalting, nixpkgs spamlashdan asraydi: https://flake.parts/

cfg = config.services.php-tg-bot;
in
{
options.services.php-tg-bot = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keling, bir distinctive nom ishlatamiz, masalan: services.phpuzb.telegram.

Bunga asosiy sabab, namespace ham bildirib turish, services dan keyin tekis qo'yish bu nixpkgs dan kelayabdi degan signal beradi, ammo sizlar nixpkgs ga tegishli emassizlar. Hozirgi nom esa shubha uyg'otadi.

};
};

serviceConfig = mkOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ishlatilmagan option'larni tozalab tashlang. Ortiqcha interfeys yangi kelayotgan hisa qo'shuvchilarni adashtiradi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants