-
-
Couldn't load subscription status.
- Fork 1
chore: nix enviroment added #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@orzklv ko'rib berolasizmi? |
|
Juda juda ko'p ishlov kerak, Hamda deploy qilish uchun modul yo'q. Misol: https://github.com/xinux-org/telegram/blob/main/module.nix |
There was a problem hiding this 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 [ |
There was a problem hiding this comment.
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?
| 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; | ||
| }; | ||
| }; | ||
| }; |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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 = { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
No description provided.