Creating a NixOS live CD/ru: Difference between revisions

Unabomberlive (talk | contribs)
Replaced content with "== Мотивация =="
FuzzyBot (talk | contribs)
Updating to match new version of source page
 
Line 46: Line 46:
   inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
   inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
   outputs = { self, nixpkgs }: {
   outputs = { self, nixpkgs }: {
    packages.x86_64-linux.default = self.nixosConfigurations.exampleIso.config.system.build.isoImage;
     nixosConfigurations = {
     nixosConfigurations = {
       exampleIso = nixpkgs.lib.nixosSystem {
       exampleIso = nixpkgs.lib.nixosSystem {
Line 64: Line 65:


<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
# git init
 
# git add flake.nix
# nix build path:$PWD
# nix build .#nixosConfigurations.exampleIso.config.system.build.isoImage
</syntaxhighlight>
</syntaxhighlight>


Line 123: Line 123:
Статический IP-адрес может бвть установлен в образе. Это может быть полехно для установки на VPS.
Статический IP-адрес может бвть установлен в образе. Это может быть полехно для установки на VPS.


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix" line="1">
{
{
   ...
   ...
   networking = {
   networking = {
     usePredictableInterfaceNames = false;
     usePredictableInterfaceNames = false;
     interfaces.eth0.ip4 = [{
     interfaces.eth0.ipv4.addresses = [{
       address = "64.137.201.46";
       address = "64.137.201.46";
       prefixLength = 24;
       prefixLength = 24;