this post was submitted on 18 Feb 2024
127 points (93.8% liked)
Linux
48334 readers
702 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Note that Nix is not a full-blown programming language, it's an expression language. The end result of an expression is always data and side-effects are not possible; you can't do network requests or write to arbitrary files. There is no such thing as a variable in Nix either, only constants. You can think of it like JSON with (pure) functions and an additional data type (~package).
From a user perspective, it's really not very different from any of the other 100s of weird configuration syntaxes you've surely come across in your Linux journey.
My nixos-config is a bit more complex because I like to reap the benefits that abstraction but here's a simpler section that is representative of how a typical NixOS desktop config would look like:
https://github.com/Atemu/nixos-config/blob/ee2d85dc3665ae3cad463a3eb132f806651fe436/modules/desktop/module.nix#L16-L77
(Though note that even this is slightly more complex than what you'd do when starting out; ignore the LADSPA_PATH and tablet conditional for now.)