Forwarded from shakhzod's lab (Schachsod)
notes about nix and nixos (nixos.org)
i want to make it clearer. nix is a package manager. just like apt, pacman, brew and etc. its job is to make sure that when you request nodejs 22 lts, it gets you that. in most package managers its done by fetching compiled binary for your system and architecture. well, nix does the same, but it can also build it from sources or fetch from the official website, unpack it, and copy to the suitable locations, so it feels like you installed it with installation wizard. it achieves this result by writing something like dockerfile or aur pkgbuild config, but in a nix language.
short summary: nix is a package manager, and a language. i mean there is a package manager called nix, and its packages are build noscripts written in a nix language.
the largest nix packages repository is, well, nixpkgs. located in github.com/nixos/nixpkgs. to search from there you have a search.nixos.org website. it contains the very same build noscripts i mentioned above. there is also hydra (hydra.nixos.org) build system which monitors nixpkgs and builds them, so we have a ready-to-fetch pre built binaries, so you don't have to build them and spend an hour or more.
nixos on the other side is a linux distribution which includes nix package manager and some nice features like nixos modules and generations. that's said, you don't need to manually set up your system or use tools like ansible. the downside of this is you cannot use installation bash noscripts like rustup or nvm. practically you can do that, but nixos not meant for that. instead you have nixos modules, which helps you use higher level abstractions, set the domain, login, password and ports.
as a good analogy you can think of a nix project (a package, a module, a development environment) as a regular programming language project: npm or cargo. instead of writing an http server, you describe what should be installed and how it should be configured. you can set dependencies, for example the nixpkgs or some fancy helper library in your github repo, and use it. the output of your nix project would be just files and directories with ready to copy-and-paste into root of your file system (the
in conclusion think about docker, but without any overhead. it is your system and you can write your systems all configurations (or dotfiles) in one place. everything you can do in ubuntu or arch linux can also be done in nixos, but a bit different.
nix as a package manager is available outside of linux, for example macos. i was using nix in macos (project is called nix-darwin, darwin is not about charles darwin the evolution theory one, just macos architecture is called darwin) and liked it. it means you can apply the nix paradigm in other os, or maybe not constrained with os only.
you can start your nix/nixos journey on xinux.uz
wish you luck!
i want to make it clearer. nix is a package manager. just like apt, pacman, brew and etc. its job is to make sure that when you request nodejs 22 lts, it gets you that. in most package managers its done by fetching compiled binary for your system and architecture. well, nix does the same, but it can also build it from sources or fetch from the official website, unpack it, and copy to the suitable locations, so it feels like you installed it with installation wizard. it achieves this result by writing something like dockerfile or aur pkgbuild config, but in a nix language.
short summary: nix is a package manager, and a language. i mean there is a package manager called nix, and its packages are build noscripts written in a nix language.
the largest nix packages repository is, well, nixpkgs. located in github.com/nixos/nixpkgs. to search from there you have a search.nixos.org website. it contains the very same build noscripts i mentioned above. there is also hydra (hydra.nixos.org) build system which monitors nixpkgs and builds them, so we have a ready-to-fetch pre built binaries, so you don't have to build them and spend an hour or more.
nixos on the other side is a linux distribution which includes nix package manager and some nice features like nixos modules and generations. that's said, you don't need to manually set up your system or use tools like ansible. the downside of this is you cannot use installation bash noscripts like rustup or nvm. practically you can do that, but nixos not meant for that. instead you have nixos modules, which helps you use higher level abstractions, set the domain, login, password and ports.
as a good analogy you can think of a nix project (a package, a module, a development environment) as a regular programming language project: npm or cargo. instead of writing an http server, you describe what should be installed and how it should be configured. you can set dependencies, for example the nixpkgs or some fancy helper library in your github repo, and use it. the output of your nix project would be just files and directories with ready to copy-and-paste into root of your file system (the
sudo rm --rf / one)in conclusion think about docker, but without any overhead. it is your system and you can write your systems all configurations (or dotfiles) in one place. everything you can do in ubuntu or arch linux can also be done in nixos, but a bit different.
nix as a package manager is available outside of linux, for example macos. i was using nix in macos (project is called nix-darwin, darwin is not about charles darwin the evolution theory one, just macos architecture is called darwin) and liked it. it means you can apply the nix paradigm in other os, or maybe not constrained with os only.
you can start your nix/nixos journey on xinux.uz
wish you luck!
Forwarded from ㅤㅤㅤㅤㅤ
Livestream NixOS #2 | Improving Flake configuration.mp4
378.4 MB
Orzklv ning NixOS streamlari #1 va #2
(Orzklv ning o'chib ketgan YouTube kanalidan arxiv)
(Orzklv ning o'chib ketgan YouTube kanalidan arxiv)
Nix os o'rnatib flakeni o'rganishni boshlaganimdan so'ng manabu muammoga duch keldim, xullas linux ishga tushib parol kiritganimdan so'ng birdan ushbu oyna chiqib 2minut shu holatda qotib keyin ishga tushayotgan edi, biroz gpt qilgan edim ushbu yechimni berdi. Senda dual video karta qaysi birini avtomatik boshlashni bilmaydi. Uni o'zing qo'lda sozla dedi avval video karta bus id sini aniqlash kerakligini aytdi.
video karta bus id'sini aniqlash
so'nga /etc/configuration.nix faylga ushbu qismni qo'shish kerak
video karta bus id'sini aniqlash
nix --extra-experimental-features "nix-command flakes" shell nixpkgs#pciutils --command lspci | grep -E 'VGA|3D'
so'nga /etc/configuration.nix faylga ushbu qismni qo'shish kerak
hardware.opengl.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
powerManagement.finegrained = false;
open = false; # GTX 1650 Mobile uchun to‘g‘ri
nvidiaSettings = true;
prime = {
offload.enable = true;
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:2:0:0";
};
};
Linuxda SSH Key orqali GitHub-ga bog‘lanish
1️⃣ SSH kalitni tekshirish
2️⃣ Yangi SSH kalit yaratish
Kalit yaratish uchun:
Standart joyda (~/.ssh/id_ed25519) saqlang.
Parol qo‘yish mumkin yoki bo‘sh qoldirish mumkin.
3️⃣ SSH agentni ishga tushirish va kalitni qo‘shish
Kalit muvaffaqiyatli qo‘shilgandan keyin
4️⃣ GitHub-ga public key-ni qo‘shish
Public key-ni ko‘rsatish:
Chiqqan matnni GitHub → Settings → SSH and GPG keys → New SSH key → joylashtiring.
Muvaffaqiyatli bo‘lsa quyidagi xabar chiqadi:
#ssh #github
1️⃣ SSH kalitni tekshirish
ls -l ~/.ssh
2️⃣ Yangi SSH kalit yaratish
Kalit yaratish uchun:
ssh-keygen -t ed25519 -C "youremail@example.com"
Standart joyda (~/.ssh/id_ed25519) saqlang.
Parol qo‘yish mumkin yoki bo‘sh qoldirish mumkin.
3️⃣ SSH agentni ishga tushirish va kalitni qo‘shish
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
# yoki agar o'z nom bilan bo'lsa
ssh-add ~/.ssh/my_ssh_key
Kalit muvaffaqiyatli qo‘shilgandan keyin
ssh-add -l bilan ro‘yxatini tekshirishingiz mumkin.4️⃣ GitHub-ga public key-ni qo‘shish
Public key-ni ko‘rsatish:
cat ~/.ssh/id_ed25519.pub
# yoki
cat ~/.ssh/my_ssh_key.pub
Chiqqan matnni GitHub → Settings → SSH and GPG keys → New SSH key → joylashtiring.
ssh -T git@github.com
Muvaffaqiyatli bo‘lsa quyidagi xabar chiqadi:
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
#ssh #github
Forwarded from Shaxzod Qudratov
Official ma'lumotlar:
NixOS Manual: https://nixos.org/manual/nixos/stable/
Nixpkgs Manual: https://nixos.org/manual/nixpkgs/stable/
Nix dasturlash tili Manual: https://nix.dev/tutorials/first-steps/
Nixpkgs Search: search.nixos.org
Unofficial:
NixOS Wiki: nixos.wiki
NixOS Manual: https://nixos.org/manual/nixos/stable/
Nixpkgs Manual: https://nixos.org/manual/nixpkgs/stable/
Nix dasturlash tili Manual: https://nix.dev/tutorials/first-steps/
Nixpkgs Search: search.nixos.org
Unofficial:
NixOS Wiki: nixos.wiki
Forwarded from Shaxzod Qudratov
Home Manager bu nima?
Ko'pchilik .dotfiles deb avvalasi turli-xil configlarni yig'ib yurishar edi. Uning ichida vim, alacritty, kitty, kde, ... larning turi fayl formatlarda (.toml, .yaml, .json, .cfg, .ini, ...) yozib va har yangi tizim o'rnatganda shu fayllarni ko'chirib yurishar edi.
Xullas, Home Manager huddi shu muammoni Nix dasturlash tili va Nix package manager bilan yechishga yordam beradi.
Home Manager va NixOS Modules/Nix Darwin Modules orasida nima farq?
NixOS Modules va Nix Darwin Modules asosan operatsion tizimni sozlashga moslashgan bo'lib, u aniq bir tizim foydalanuvchisiga (system user) bog'lanmay global ish tutadi. Home Manager esa doim aniq bir foydalanuvchiga bog'langan bo'ladi, va uning sozlamalari boshqa foydalanuvchilarga ta'sir qilmaydi (agar ta'sir qiladigan config yozmasangiz albatta).
GitHub: https://github.com/nix-community/home-manager/
Manual: https://nix-community.github.io/home-manager/
Search: https://home-manager-options.extranix.com/
Ko'pchilik .dotfiles deb avvalasi turli-xil configlarni yig'ib yurishar edi. Uning ichida vim, alacritty, kitty, kde, ... larning turi fayl formatlarda (.toml, .yaml, .json, .cfg, .ini, ...) yozib va har yangi tizim o'rnatganda shu fayllarni ko'chirib yurishar edi.
Xullas, Home Manager huddi shu muammoni Nix dasturlash tili va Nix package manager bilan yechishga yordam beradi.
Home Manager va NixOS Modules/Nix Darwin Modules orasida nima farq?
NixOS Modules va Nix Darwin Modules asosan operatsion tizimni sozlashga moslashgan bo'lib, u aniq bir tizim foydalanuvchisiga (system user) bog'lanmay global ish tutadi. Home Manager esa doim aniq bir foydalanuvchiga bog'langan bo'ladi, va uning sozlamalari boshqa foydalanuvchilarga ta'sir qilmaydi (agar ta'sir qiladigan config yozmasangiz albatta).
GitHub: https://github.com/nix-community/home-manager/
Manual: https://nix-community.github.io/home-manager/
Search: https://home-manager-options.extranix.com/
Forwarded from Rafa
https://github.com/rafanochi/nix/blob/main/config/nixvim/default.nix
qarang mana, nixda config qilasiz, soddagina
qarang mana, nixda config qilasiz, soddagina
GitHub
nix/config/nixvim/default.nix at main · rafanochi/nix
❄️ My ultimate nix setup . Contribute to rafanochi/nix development by creating an account on GitHub.
Savol: Xinuxni 0dan yozib chiqganmisizlar yoki kerneldi ustiga qurilganmi ?
Javob: Xinux ustida quyidagi qatlamlar mavjud:
1. Linux
2. NixOs
3. GNOME DE
4. nix tilida yozilgan sozlamalar. O'zimiz qo'shgan yoki olib tashalagan dasturlar, orqa fon va boshqa.
Xinux shu 4-qadamdan boshlanadi. Qolgan tepadagi loyihalarni shunchaki olib qo'shib qo'yamiz.
Barcha sozlamar shu modules degan repoda turadi. Bularni tushunish uchun nix paket manageri yoki NixOS ishlatish talab etiladi.
Post egasi: asl post manbasi
Javob: Xinux ustida quyidagi qatlamlar mavjud:
1. Linux
2. NixOs
3. GNOME DE
4. nix tilida yozilgan sozlamalar. O'zimiz qo'shgan yoki olib tashalagan dasturlar, orqa fon va boshqa.
Xinux shu 4-qadamdan boshlanadi. Qolgan tepadagi loyihalarni shunchaki olib qo'shib qo'yamiz.
Barcha sozlamar shu modules degan repoda turadi. Bularni tushunish uchun nix paket manageri yoki NixOS ishlatish talab etiladi.
Post egasi: asl post manbasi
GitHub
GitHub - xinux-org/modules: 🎛️ | Ready to use abstractions for project usages [maintainer=@bahrom04]
🎛️ | Ready to use abstractions for project usages [maintainer=@bahrom04] - xinux-org/modules
NixOS ga Gnome DE o'rnatishimda shundan foydalandim, hammasi aniq keltirilgan ekan.
https://wiki.nixos.org/wiki/GNOME
https://wiki.nixos.org/wiki/GNOME
wiki.nixos.org
GNOME - Official NixOS Wiki
GNOME (/(ɡ)noʊm/) is a desktop environment that seeks to be "an independent computing platform for everyone."
This article is an extension of the documentation in the NixOS manual.
This article is an extension of the documentation in the NixOS manual.
Forwarded from Ulug'bek Raxmankulov
Tak, alsautils o'rnatasiz, alsamixer cli bilan mic boost ni 0 qilasiz, keyin keragicha sensitivityni ham pasaytirasiz. Kimdadir 100 holida norm bo'ladi boostni o'chirgach, kimdadir 30-40% norm bo'ladi. Unda ham shum qolsa keyin noisetorch o'rnatasiz. Ishga tushirib mikroni noosetorchga olib qo'yasiz olam guliston.