Está viendo la página Spain versión del sitio.
Le gustaría cambiar a su sitio local?
14 MIN TIEMPO DE LECTURA

NIXOS

Build your own distro with NixOS

“Why, I do declare!” Matt Holder proclaims as he builds his very own operating system, using just an ISO file and declarative text files…

Credit: https://nixos.org

OUR EXPERT

Matt Holder has been a fan of the open source methodology for over two decades and uses Linux and other tools where possible. In his spare time, he enjoys listening to music and reading.

We’re continuing our look at next-gen Linux distro paradigms, moving on from our dive into the Fedora Silverblue (LXF299) immutable system to NixOS, another example of an OS that uses modern techniques to make distros as reliable and secure as possible. This operating system handles things very differently and also uses a lot of the same techniques as the tools that can be used when utilising the infrastructure as code methodology.

NixOS centres around the Nix package manager, which is used to build applications that are installed in a very different way from what we’re used to. Applications can be installed on a per-user basis, or for every user. When installed, each app is stored in its own directory and multiple versions of the same application can be installed. Each directory contains all of the application’s dependencies and, again, multiple versions can be installed across the system. Applications installed or upgraded using this system are atomic, meaning that the rest of the system will not be broken if an upgrade or installation fails. Should a bug be found in a version of software, it can be rolled back, due to the old version not being deleted straight away. Garbage collection is also something that is built into the Nix package manager and old versions can be deleted periodically. Automatic updates are also easy to configure with the system.

The first stage of the NixOS installer.

MANUALLY ADDING AND REMOVING PACKAGES

While the idea of NixOS is to be able to use a declaration file to ensure the configuration of the OS is as expected, it is also possible to manually install and uninstall packages. This can be considered to be incredibly similar to using apt on a Debian or Ubuntu system and dnf on a Fedora system.

To search for a package, either use the website in the Quick Tip (right) or perform a search with nix search

. Packages can be installed on a per user basis. For systemwide installation, the configuration file method should be used.

To install for the current user, use nix-env -i . Uninstalling packages can also be carried out at the command line, and this can be done with nix-env --uninstall . Any packages installed using the commands described in this boxout can be viewed using nix-env --query

--installed . Automatic updates are enabled by default, but can be run using two commands. First of all, update the channel with nix-channel --update and then run the update for the logged-in user with nix-env -u . To update packages for all users, run nixos-rebuild --upgrade switch .

Methods described in this boxout should only be used for testing. If these methods are used, then the benefits of a declarative system are greatly diminished.

Desbloquea este artículo y mucho más con
Puedes disfrutar:
Disfrute de esta edición al completo
Acceso instantáneo a más de 600 títulos
Miles de números atrasados
Sin contrato ni compromiso
Inténtalo €1.09
SUSCRÍBETE AHORA
30 días de acceso, luego sólo €11,99 / mes. Cancelación en cualquier momento. Sólo para nuevos abonados.


Más información
Pocketmags Plus
Pocketmags Plus

Este artículo es de...


View Issues
Linux Format
May 2023
VER EN TIENDA

Otros artículos de este número


WELCOME
In with the old!
We’re in no position to talk about getting
REGULARS AT A GLANCE
Ubuntu 23.04: Lunar Lobster latest
Exciting things are happening: a new installer, hardened app security and a revamped desktop environment.
Linux on Apple Mx hardware
The Linux kernel now officially supports M-series Macs. But before you get too excited, full integration is a long way off.
It’s a flat future
Flathub to go independent and accept app payments.
END OF LIFE
Donnie Berkholz is senior vice president product at
RELIABLY SECURE
Keith Edmunds is MD of Tiger Computing, which
Fractional scaling is still coming…
Gnome to support protocol.
Half-Life 1 gets ray tracing
Old game given makeover.
Plasma 6 is in development
Version 6 uses Qt6.
Distro watch
What’s behind the free software sofa?
HANDS UP!
Moshi Turner is a software engineer at Collabora.
Kernel watch
Jon Masters keeps up with all the latest happenings in the Linux kernel, so you don’t have to.
THE ITANIC
Jon Masters is a kernel hacker who’s been
Answers
Got a burning question about open source or the kernel? Whatever your level, email it to answers@linuxformat.com
MAILSERVER
WRITE TO US Do you have a burning
BACK ISSUES MISSED ONE?
ISSUE 300 April 2023 Product code: LXFDB0300 In
Time Switch
Version : 2023.01.28 Web : https:// github.com/fsobolev/timeswitch
ChatGPT
Version: 0.11.0 Web : https://app.nofwl.com O penAI’s
Tokodon
Version: 23.01.0 Web: https://apps.kde.org/tokodon Another online service
CopyQ
Version : 6.4.0 Web : https://hluk.github.io/CopyQ The
HSTR
Version : 2.6.0 Web : https://github.com/dvorka/hstr Like
Katalog
Version : 1.16 Web: https://sourceforge . net/projects/katalogg
Stellarium
Version: 1.2 Web: https://stellarium.org S tellarium
iQPuzzle
Version: 1.2.9 Web: https://elth0r0 . github.io/iqpuzzle
Veloren
Version: 0.14.0 Web: https://veloren.net V eloren
Eiciel
Version: 0.10.0 Web: https://rofi . roger-ferrer.org/eiciel
Forgetpass
Version: 1.0.12 Web: https://github . com/alexkdeveloper/forgetpass Virtually
REVIEWS
Sabrent Rocket 2230 SSD
Shane Downing test-drives the perfect Steam Deck drive upgrade.
Intel Core i5 13400F
Being skinflint northern types around here, it’s high praise for Jacob Ridley to say this is the best budget processor right now!
Brave Browser 1.48.171
Nate Drake climbs on his soap box and explains why Brave is the last word in private browsing.
Endless OS 5.0.1
Nate Drake has hours of endless fun with the colourful and simple-to-use Endless OS without once needing to go online.
Vanilla OS 22.10 R7
With his first taste of the ultra-secure Vanilla OS, Nate Drake finds that plain doesn’t by any means equal boring.
Tor Browser 12.0.3
Nate Drake nosedives into the dark net with the Tor Browser and is blown away by its new censorship-resistant features.
Rogue Legacy 2
Workers with endless descendants happy to repeat their work over and over? Anne-Marie Coyle has never seen The Management so happy…
ROUNDUP
Lightweight desktops
In search of extra speed and efficient use of resources checks out the best lightweight desktop environments
SAVE YOUR OLD PC!
Give your old hardware some extra longevity and beat the fiscal blues. shows you how Windows fails and Linux Mint prevails
Pi USER
New Raspberry Pi camera launched
The £50 camera eliminates rolling shutter artefacts, the bane of digital photography!
RetroFlag GPi CASE 2W
Going back to the future is Les Pounder’s go-to retro phrase – let’s hope this case isn’t as long in the tooth.
Biqu Hurakan
Forever cleaning surfaces with isopropyl alcohol, Denise Bertacchi wonders whether this is the printer for her?
Using the GPIO with MicroBlocks
Les Pounder scratches an itch and builds code for his Raspberry Pi Pico using drag-and-drop coding blocks.
Building a web-based robot control interface
In part five of his series, Les Pounder shows us how to build a custom web interface for controlling your DIY robot.
TOP OF THE FOSS!
TRACK YOUR FITNESS
Michael Reed looks at an open source Android app that can track your fitness.
TUTORIALS
Fast and easy image processing
Shashank Sharma dreams of achieving a leaner version of himself. Until then, he’ll settle for an ImageMagick derivative that’s skinnier, yet useful.
Host your own music streaming server
Nick Peers discovers how to make your personal music collection available from anywhere with this simple, but effective, music server.
Relive classic FOCAL days on your PDP-11
It’s probably not one of your favourite languages, but Mike Bedford says if you want to learn about programming’s heritage, don’t ignore FOCAL.
Enhance GIMP with must-have plugins
For many years, plugins have extended the basic functions of GIMP. Karsten Günther pick the ones he thinks you shouldn’t be without.
ChatGPT troubleshoots your Linux problems
Nick Peers investigates the different ways in which ChatGPT might help you maintain and fix problems with your PC.
IN DEPTH
MIND YOUR LANGUAGE!
Interested in learning a new language? Or just curious about current hot technologies? Darien Graham-Smith explores the language leaderboard.
CODING ACADEMY
Become a C++ chess master
Tiring of retro gaming rewrites, Andrew Smith turns his grandmaster mind to more classical games in a 3D style.
Observability of the kernel and containers
Barely able to contain himself, Mihalis Tsoukalos explains how to use eBPF to monitor applications, the Linux kernel and containers
Chat
X
Soporte Pocketmags