├── .gitignore ├── src ├── modules.md ├── nixshell.md ├── buildingpackages.md ├── derivations.md ├── packages.md ├── containerschapter.md ├── chromium.png ├── vitetris.png ├── containers.md ├── overriding.md ├── tipsandtricks.md ├── overlays.md ├── about.md ├── services.md ├── fonts.md ├── SUMMARY.md ├── advancednix.md ├── envvars.md ├── intro.md ├── gettingstarted.md ├── fhs.md ├── garbage.md ├── nixsandboxes.md ├── packageoptions.md ├── unsafe.md ├── installingprogs.md ├── options.md ├── channels.md └── nixexpressions.md ├── tasks.md ├── README.md ├── docs ├── .nojekyll ├── favicon.png ├── chromium.png ├── vitetris.png ├── FontAwesome │ └── fonts │ │ ├── FontAwesome.ttf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 ├── css │ ├── print.css │ ├── general.css │ ├── variables.css │ └── chrome.css ├── ayu-highlight.css ├── highlight.css ├── tomorrow-night.css ├── clipboard.min.js ├── modules.html ├── nixshell.html ├── packages.html ├── buildingpackages.html ├── derivations.html ├── containerschapter.html ├── containers.html ├── overriding.html ├── tipsandtricks.html ├── overlays.html └── about.html ├── theme └── favicon.png ├── book.toml └── .github └── ISSUE_TEMPLATE ├── topic-request.md └── correction.md /.gitignore: -------------------------------------------------------------------------------- 1 | book 2 | -------------------------------------------------------------------------------- /src/modules.md: -------------------------------------------------------------------------------- 1 | # Modules 2 | -------------------------------------------------------------------------------- /src/nixshell.md: -------------------------------------------------------------------------------- 1 | # Nix Shell 2 | 3 | -------------------------------------------------------------------------------- /src/buildingpackages.md: -------------------------------------------------------------------------------- 1 | # Building packages 2 | -------------------------------------------------------------------------------- /src/derivations.md: -------------------------------------------------------------------------------- 1 | # Making Nix packages 2 | -------------------------------------------------------------------------------- /src/packages.md: -------------------------------------------------------------------------------- 1 | # Managing Nix Packages 2 | -------------------------------------------------------------------------------- /src/containerschapter.md: -------------------------------------------------------------------------------- 1 | # Sandboxes & Containers 2 | 3 | -------------------------------------------------------------------------------- /tasks.md: -------------------------------------------------------------------------------- 1 | Something about .etc."fileName" 2 | Systemd services -.- 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NixOS4Noobs 2 | The ultimate guide to using NixOS, for new users 3 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | This file makes sure that Github Pages doesn't process mdBook's output. -------------------------------------------------------------------------------- /docs/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorelAli/NixOS4Noobs/HEAD/docs/favicon.png -------------------------------------------------------------------------------- /src/chromium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorelAli/NixOS4Noobs/HEAD/src/chromium.png -------------------------------------------------------------------------------- /src/vitetris.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorelAli/NixOS4Noobs/HEAD/src/vitetris.png -------------------------------------------------------------------------------- /docs/chromium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorelAli/NixOS4Noobs/HEAD/docs/chromium.png -------------------------------------------------------------------------------- /docs/vitetris.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorelAli/NixOS4Noobs/HEAD/docs/vitetris.png -------------------------------------------------------------------------------- /theme/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorelAli/NixOS4Noobs/HEAD/theme/favicon.png -------------------------------------------------------------------------------- /docs/FontAwesome/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorelAli/NixOS4Noobs/HEAD/docs/FontAwesome/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /docs/FontAwesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorelAli/NixOS4Noobs/HEAD/docs/FontAwesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/FontAwesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorelAli/NixOS4Noobs/HEAD/docs/FontAwesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/FontAwesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorelAli/NixOS4Noobs/HEAD/docs/FontAwesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/FontAwesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorelAli/NixOS4Noobs/HEAD/docs/FontAwesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /book.toml: -------------------------------------------------------------------------------- 1 | [book] 2 | authors = ["Jorel Ali"] 3 | multilingual = false 4 | src = "src" 5 | title = "NixOS4Noobs" 6 | 7 | [build] 8 | build-dir = "docs" -------------------------------------------------------------------------------- /src/containers.md: -------------------------------------------------------------------------------- 1 | # Containers 2 | 3 | Coming soon: 4 | 5 | - Creating declarative contains with NixOS 6 | - Accessing them 7 | - Using them via SSH (and X11 openssh forwarding) 8 | - Networking? -------------------------------------------------------------------------------- /src/overriding.md: -------------------------------------------------------------------------------- 1 | # Overriding attributes 2 | 3 | Coming soon: 4 | 5 | - How to override attributes using `nixpkgs.config.packageOverrides` 6 | - Using `overrideAttrs` (and probably mentioning that the variable name `old` can literally be anything -.-) -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/topic-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Topic request 3 | about: Suggestion for a new topic or chapter 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Potential chapter name 11 | [name goes here] 12 | 13 | ## Topics to cover 14 | * List 15 | * of 16 | * topics 17 | * here 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/correction.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Correction 3 | about: Fixes for a typo or something 4 | title: '' 5 | labels: documentation 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Chapter name 11 | [Chapter name goes here] 12 | 13 | ## Current text 14 | [What NixOS4Noobs currently says] 15 | 16 | ## Proposed change 17 | [What it should say] 18 | -------------------------------------------------------------------------------- /src/tipsandtricks.md: -------------------------------------------------------------------------------- 1 | # Tips & Tricks 2 | 3 | Coming soon: 4 | 5 | - Creating bash scripts using Nix (`writeShellScriptBin`) 6 | - Writing to `/etc` and using environment linking to handle `.config` files (And why I prefer this to home manager) 7 | - System-wide program synced configurations (e.g. a system-wide color scheme that is controlled using a simple Nix file) -------------------------------------------------------------------------------- /src/overlays.md: -------------------------------------------------------------------------------- 1 | # Overlays 2 | 3 | Coming soon: 4 | 5 | - Explaining how `self: super: { /* Code here */ }` works 6 | - Using `super.callPackage` 7 | - Using a `default.nix` file as an overlay for a folder 8 | - Probably worth mentioning the difference between `super.callPackage blah {};` and `import blah;` and how `callPackage` works. (Probably including an example of `import blah with pkgs; {blah1, blah2, blah3, blah...}` and why `super.callPackage blah {}` is so much better). -------------------------------------------------------------------------------- /src/about.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | ## About the author 4 | 5 | I'm just a NixOS user that is tired of seeing people struggle to figure out NixOS on the [NixOS subreddit](https://www.reddit.com/r/NixOS/). 6 | 7 | ## Suggestions or fixes 8 | 9 | To suggest new content or topics that you deem suitable for NixOS4Noobs to cover, please feel free to [make a pull request](https://github.com/JorelAli/NixOS4Noobs/pulls) or [open an issue](https://github.com/JorelAli/NixOS4Noobs/issues/new/choose) -------------------------------------------------------------------------------- /src/services.md: -------------------------------------------------------------------------------- 1 | # Setting up services 2 | 3 | The NixOS configuration also allows you to manage services that run in the background, in addition to programs. 4 | 5 | ## Installing NixOS services 6 | 7 | Services can be found using the [NixOS options search website](https://nixos.org/nixos/options.html#services.) to find services that have been defined by the NixOS community. Services start with the prefix `services.` and can be enabled and configured in your `configuration.nix` file. 8 | 9 | For example, to enable the `mpd` (Music Player Daemon) service, you can add it to your `configuration.nix` as follows: 10 | 11 | ```nix 12 | services = { 13 | mpd.enable = true; 14 | }; 15 | ``` 16 | -------------------------------------------------------------------------------- /docs/css/print.css: -------------------------------------------------------------------------------- 1 | 2 | #sidebar, 3 | #menu-bar, 4 | .nav-chapters, 5 | .mobile-nav-chapters { 6 | display: none; 7 | } 8 | 9 | #page-wrapper.page-wrapper { 10 | transform: none; 11 | margin-left: 0px; 12 | overflow-y: initial; 13 | } 14 | 15 | #content { 16 | max-width: none; 17 | margin: 0; 18 | padding: 0; 19 | } 20 | 21 | .page { 22 | overflow-y: initial; 23 | } 24 | 25 | code { 26 | background-color: #666666; 27 | border-radius: 5px; 28 | 29 | /* Force background to be printed in Chrome */ 30 | -webkit-print-color-adjust: exact; 31 | } 32 | 33 | pre > .buttons { 34 | z-index: 2; 35 | } 36 | 37 | a, a:visited, a:active, a:hover { 38 | color: #4183c4; 39 | text-decoration: none; 40 | } 41 | 42 | h1, h2, h3, h4, h5, h6 { 43 | page-break-inside: avoid; 44 | page-break-after: avoid; 45 | } 46 | 47 | pre, code { 48 | page-break-inside: avoid; 49 | white-space: pre-wrap; 50 | } 51 | 52 | .fa { 53 | display: none !important; 54 | } 55 | -------------------------------------------------------------------------------- /src/fonts.md: -------------------------------------------------------------------------------- 1 | # Installing fonts 2 | 3 | Installing fonts is slightly different compared to installing regular system packages - **fonts must be installed under the fonts attribute**. 4 | 5 | The general structure is as follows: 6 | 7 | ```nix 8 | fonts.fonts = with pkgs; [ 9 | # Fonts go here 10 | ]; 11 | ``` 12 | 13 | Unfortunately, searching for font packages is _incredibly unintuitive_. Font packages look just like regular packages and adding them to the system packages _does not install them properly_. The 100% best safest way to find fonts is as follows: 14 | 15 | 1. Search for the font you're looking for on the [NixOS packages search website](https://nixos.org/nixos/packages.html#font) 16 | 2. Click on the package on the website (this shows a quick description of the package, along with various other information) 17 | 3. Make sure that the package's _Nix expression_ starts with `pkgs/data/fonts` 18 | 19 | Then, as similar to installing system packages, add the **Attribute name** to the fonts section: 20 | 21 | ```nix 22 | fonts.fonts = with pkgs; [ 23 | comic-relief 24 | font-awesome_4 25 | ]; 26 | ``` 27 | -------------------------------------------------------------------------------- /docs/ayu-highlight.css: -------------------------------------------------------------------------------- 1 | /* 2 | Based off of the Ayu theme 3 | Original by Dempfi (https://github.com/dempfi/ayu) 4 | */ 5 | 6 | .hljs { 7 | display: block; 8 | overflow-x: auto; 9 | background: #191f26; 10 | color: #e6e1cf; 11 | padding: 0.5em; 12 | } 13 | 14 | .hljs-comment, 15 | .hljs-quote, 16 | .hljs-meta { 17 | color: #5c6773; 18 | font-style: italic; 19 | } 20 | 21 | .hljs-variable, 22 | .hljs-template-variable, 23 | .hljs-attribute, 24 | .hljs-attr, 25 | .hljs-regexp, 26 | .hljs-link, 27 | .hljs-selector-id, 28 | .hljs-selector-class { 29 | color: #ff7733; 30 | } 31 | 32 | .hljs-number, 33 | .hljs-builtin-name, 34 | .hljs-literal, 35 | .hljs-type, 36 | .hljs-params { 37 | color: #ffee99; 38 | } 39 | 40 | .hljs-string, 41 | .hljs-bullet { 42 | color: #b8cc52; 43 | } 44 | 45 | .hljs-title, 46 | .hljs-built_in, 47 | .hljs-section { 48 | color: #ffb454; 49 | } 50 | 51 | .hljs-keyword, 52 | .hljs-selector-tag, 53 | .hljs-symbol { 54 | color: #ff7733; 55 | } 56 | 57 | .hljs-name { 58 | color: #36a3d9; 59 | } 60 | 61 | .hljs-tag { 62 | color: #00568d; 63 | } 64 | 65 | .hljs-emphasis { 66 | font-style: italic; 67 | } 68 | 69 | .hljs-strong { 70 | font-weight: bold; 71 | } 72 | -------------------------------------------------------------------------------- /src/SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | [Introduction](./intro.md) 4 | 5 | [About](./about.md) 6 | 7 | - [Getting Started](./gettingstarted.md) 8 | - [Installing programs](./installingprogs.md) 9 | - [Setting up services](./services.md) 10 | - [Setting environment variables](./envvars.md) 11 | - [Installing fonts](./fonts.md) 12 | - [NixOS configuration options](./options.md) 13 | - [Managing Nix Packages](./packages.md) 14 | - [Nix channels](./channels.md) 15 | - [Nix garbage collection](./garbage.md) 16 | - [Setting package options](./packageoptions.md) 17 | - [Overriding attributes [WIP]](./overriding.md) 18 | - [Sandboxes & Containers [WIP]](./containerschapter.md) 19 | - [Nix shell sandboxes](./nixsandboxes.md) 20 | - [Containers [WIP]](./containers.md) 21 | - [Making Nix packages [WIP]](./derivations.md) 22 | - [Building packages [WIP]](./buildingpackages.md) 23 | - [Nix Expressions](./nixexpressions.md) 24 | - [Advanced Nix](./advancednix.md) 25 | - [Modules [WIP]](./modules.md) 26 | - [Overlays [WIP]](./overlays.md) 27 | - [Nix Shell [WIP]](./nixshell.md) 28 | - [Tips & Tricks [WIP]](./tipsandtricks.md) 29 | - [Filesystem Hierarchy Standard](./fhs.md) 30 | - [Unsafe NixOS](./unsafe.md) -------------------------------------------------------------------------------- /src/advancednix.md: -------------------------------------------------------------------------------- 1 | # Advanced Nix 2 | 3 | So far, we've covered some very simple things that you can do with NixOS. For example: 4 | 5 | - Using the `configuration.nix` file to configure the system 6 | - Using the `nix-shell` command to create small shell sandboxes 7 | - Using NixOS in general (clearing the garbage, managing channels etc.) 8 | - Creating derivations 9 | 10 | This chapter will cover the much more advanced topics of NixOS, in particular: 11 | 12 | - Using _Modules_ to extend the `configuration.nix` file. Have you ever wanted to know where all of these options such as `xserver.displayManager.sddm.enable` came from? We will explain how to create your own custom configuration options that can be used in your `configuration.nix` file. 13 | - Overriding packages by using _Overlays_. Spoiler alert: This basically lets you add custom packages into your configuration. These are one of the most complicated concepts to grasp, but once you get it, it's the most rewarding thing. Luckily, this is NixOS4Noobs and it's explained in such a way that anyone can understand it first time. 14 | - Using the Nix Shell to its full potential by utilizing the `shell.nix` file. This lets us create Nix environments wherever to compile projects and run local programs. -------------------------------------------------------------------------------- /docs/highlight.css: -------------------------------------------------------------------------------- 1 | /* Base16 Atelier Dune Light - Theme */ 2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune) */ 3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ 4 | 5 | /* Atelier-Dune Comment */ 6 | .hljs-comment, 7 | .hljs-quote { 8 | color: #AAA; 9 | } 10 | 11 | /* Atelier-Dune Red */ 12 | .hljs-variable, 13 | .hljs-template-variable, 14 | .hljs-attribute, 15 | .hljs-tag, 16 | .hljs-name, 17 | .hljs-regexp, 18 | .hljs-link, 19 | .hljs-name, 20 | .hljs-selector-id, 21 | .hljs-selector-class { 22 | color: #d73737; 23 | } 24 | 25 | /* Atelier-Dune Orange */ 26 | .hljs-number, 27 | .hljs-meta, 28 | .hljs-built_in, 29 | .hljs-builtin-name, 30 | .hljs-literal, 31 | .hljs-type, 32 | .hljs-params { 33 | color: #b65611; 34 | } 35 | 36 | /* Atelier-Dune Green */ 37 | .hljs-string, 38 | .hljs-symbol, 39 | .hljs-bullet { 40 | color: #60ac39; 41 | } 42 | 43 | /* Atelier-Dune Blue */ 44 | .hljs-title, 45 | .hljs-section { 46 | color: #6684e1; 47 | } 48 | 49 | /* Atelier-Dune Purple */ 50 | .hljs-keyword, 51 | .hljs-selector-tag { 52 | color: #b854d4; 53 | } 54 | 55 | .hljs { 56 | display: block; 57 | overflow-x: auto; 58 | background: #f1f1f1; 59 | color: #6e6b5e; 60 | padding: 0.5em; 61 | } 62 | 63 | .hljs-emphasis { 64 | font-style: italic; 65 | } 66 | 67 | .hljs-strong { 68 | font-weight: bold; 69 | } 70 | -------------------------------------------------------------------------------- /src/envvars.md: -------------------------------------------------------------------------------- 1 | # Setting environment variables 2 | 3 | Environment variables can also be set using your `configuration.nix` file. This is done using the `environment.variables` setting: 4 | 5 | ```nix 6 | environment.variables = { 7 | # Environment variables go here 8 | }; 9 | ``` 10 | 11 | ## Single value environment variables 12 | 13 | Environment variables with a single value can be defined using a simple assignment of the environment variable name and its corresponding value: 14 | 15 | ```nix 16 | environment.variables = { 17 | XDG_CONFIG_HOME = "$HOME/.config"; 18 | }; 19 | ``` 20 | 21 | ## Multi value environment variables 22 | 23 | Environment variables that use a list of values (e.g. `$PATH`, `$XCURSOR_PATH`) can be declared using a Nix Expression list type as shown: 24 | 25 | ```nix 26 | environment.variables = { 27 | XCURSOR_PATH = [ 28 | "$HOME/.icons" 29 | "$HOME/.nix-profile/share/icons" 30 | ]; 31 | }; 32 | ``` 33 | 34 | ## Using the system path 35 | 36 | To use the current system path which will be generated when building the NixOS configuration, you can use the Nix Expression string with enclosed Nix expressions: 37 | 38 | ```nix 39 | environment.variables = { 40 | XCURSOR_PATH = [ 41 | "${config.system.path}/share/icons" 42 | ]; 43 | }; 44 | ``` 45 | 46 | This will map `${config.system.path}` to the directory `/run/current-system/sw/` when the system is built. 47 | -------------------------------------------------------------------------------- /src/intro.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | NixOS4Noobs is a tutorial which teaches you how to use NixOS. However, this isn't like most tutorials which teaches you _everything_, it instead just tries to teach a few things which you're very likely to encounter. 4 | 5 | ## Who this tutorial is for 6 | 7 | Due to the large scale of NixOS and how it can be configured and set up, NixOS4Noobs will _only_ focus on **a configuration-based system**. This is where your entire operating system is controlled using the `configuration.nix` file and nothing else. 8 | 9 | This tutorial targets the following users: 10 | 11 | * Users of a device which only they will access _(not a device for multiple users)_ 12 | * Users that want to control NixOS using _just_ the configuration file 13 | * Users that want everything installed system-wide 14 | 15 | This tutorial **is not** for the following users: 16 | 17 | * Those who use a device with a need for multiple users _(e.g. a family)_ 18 | * Users that want a clear separation between system-wide and local programs and services 19 | 20 | ## Why use a configuration-based system? 21 | 22 | Having a configuration based system has various advantages, namely: 23 | 24 | * It's easy to configure - everything is in one location 25 | * If something goes wrong, it's easy to pinpoint where the problem is _(e.g. some dodgy installation)_ 26 | * It's a reproducible setup _(If you want to replicate a system on another device, just copy the configuration and it'll set it all up exactly as you want it to)_ -------------------------------------------------------------------------------- /src/gettingstarted.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ## Editing the system configuration 4 | 5 | As of NixOS 19.03 (Koi), you can open the system configuration in the default system editor with the following command: 6 | 7 | ``` 8 | $ sudo nixos-rebuild edit 9 | ``` 10 | 11 | Alternatively, you can edit the file located at `/etc/nixos/configuration.nix` 12 | 13 | 14 | ## Building the system configuration 15 | 16 | In order to apply any changes to the `configuration.nix` file, the NixOS configuration needs to be _rebuilt_. 17 | 18 | The `nixos-rebuild` command is used to rebuild the system configuration. In general, there are two commands you may want to run in order to properly build the system: 19 | 20 | ### Rebuild + Switch 21 | 22 | ``` 23 | $ sudo nixos-rebuild switch 24 | ``` 25 | 26 | Running this command performs the following: 27 | - Rebuilds the current `configuration.nix` file 28 | - Downloads any new packages 29 | - Adds a new entry to the boot menu 30 | - Applies the changes of the configuration right away (whilst you're still using the system. It's basically seamless!) 31 | 32 | Any new packages can be used right away, any new services will be started right away, however _environmental variables will not be activated until the next reboot_. 33 | 34 | ### Rebuild (No switch) 35 | 36 | ``` 37 | $ sudo nixos-rebuild boot 38 | ``` 39 | 40 | This basically does everything that `sudo nixos-rebuild switch` does, except it does not apply the changes of the configuration right away. When the system is rebooted, the newly built configuration will be used. 41 | -------------------------------------------------------------------------------- /src/fhs.md: -------------------------------------------------------------------------------- 1 | # Filesystem Hierarchy Standard 2 | 3 | Sometimes, things _just don't work_ on NixOS. For example, say a developer has written a program that uses the an executable in the directory `/usr/bin/someExecutable`. Unfortunately, say this developer also hardcoded this directory path in their code. This means that we cannot change it, or patch it using normal means (such as creating a wrapper for it). 4 | 5 | In order to bypass this, we can create a sandbox in NixOS that uses the Unix "Filesystem Hierarchy Standard" (FHS[^1]). 6 | 7 | There are two methods of using the FHS: 8 | 9 | ## Declaring a FHS environment in the configuration 10 | 11 | You can declare a FHS environment in your `configuration.nix` file. This allows you to enter this sandboxed environment using a command in any directory. This is done by using the `pkgs.buildFHSUserEnv` function to create a sandbox derivation. 12 | 13 | ### Example: A C++ execution environment for LLVM 14 | 15 | In this example, we use `pkgs.buildFHSUserEnv` to create a sandbox to aid in C++ development for other Linux systems. We include various debugging tools, such as `gdb` and `valgrind`, as well as the required libraries that we'll need, such as `llvm`. 16 | 17 | ```nix 18 | environment.systemPackages = with pkgs; [ 19 | (pkgs.buildFHSUserEnv { 20 | name = "cppfhs"; 21 | runScript = "bash"; 22 | targetPkgs = pkgs: with pkgs; [ 23 | clang_8 gdb llvm_8 valgrind 24 | ]; 25 | }) 26 | ]; 27 | ``` 28 | 29 | We name this derivation `cppfhs`, which allows us to use the following command in any shell to quickly enter this environment: 30 | 31 | ``` 32 | $ cppfhs 33 | ``` 34 | 35 | ## Declaring a FHS environment for use in the Nix shell [WIP] 36 | 37 | ----- 38 | 39 | [^1]: The Filesystem Hierarchy Standard specifies directories such as `/usr/bin`, `/usr/lib` and `/bin`. On NixOS, these directories exist, but aren't in use as you'd expect with regular Unix systems. -------------------------------------------------------------------------------- /docs/tomorrow-night.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Night Theme */ 2 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 3 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 4 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 5 | 6 | /* Tomorrow Comment */ 7 | .hljs-comment { 8 | color: #969896; 9 | } 10 | 11 | /* Tomorrow Red */ 12 | .hljs-variable, 13 | .hljs-attribute, 14 | .hljs-tag, 15 | .hljs-regexp, 16 | .ruby .hljs-constant, 17 | .xml .hljs-tag .hljs-title, 18 | .xml .hljs-pi, 19 | .xml .hljs-doctype, 20 | .html .hljs-doctype, 21 | .css .hljs-id, 22 | .css .hljs-class, 23 | .css .hljs-pseudo { 24 | color: #cc6666; 25 | } 26 | 27 | /* Tomorrow Orange */ 28 | .hljs-number, 29 | .hljs-preprocessor, 30 | .hljs-pragma, 31 | .hljs-built_in, 32 | .hljs-literal, 33 | .hljs-params, 34 | .hljs-constant { 35 | color: #de935f; 36 | } 37 | 38 | /* Tomorrow Yellow */ 39 | .ruby .hljs-class .hljs-title, 40 | .css .hljs-rule .hljs-attribute { 41 | color: #f0c674; 42 | } 43 | 44 | /* Tomorrow Green */ 45 | .hljs-string, 46 | .hljs-value, 47 | .hljs-inheritance, 48 | .hljs-header, 49 | .hljs-name, 50 | .ruby .hljs-symbol, 51 | .xml .hljs-cdata { 52 | color: #b5bd68; 53 | } 54 | 55 | /* Tomorrow Aqua */ 56 | .hljs-title, 57 | .css .hljs-hexcolor { 58 | color: #8abeb7; 59 | } 60 | 61 | /* Tomorrow Blue */ 62 | .hljs-function, 63 | .python .hljs-decorator, 64 | .python .hljs-title, 65 | .ruby .hljs-function .hljs-title, 66 | .ruby .hljs-title .hljs-keyword, 67 | .perl .hljs-sub, 68 | .javascript .hljs-title, 69 | .coffeescript .hljs-title { 70 | color: #81a2be; 71 | } 72 | 73 | /* Tomorrow Purple */ 74 | .hljs-keyword, 75 | .javascript .hljs-function { 76 | color: #b294bb; 77 | } 78 | 79 | .hljs { 80 | display: block; 81 | overflow-x: auto; 82 | background: #1d1f21; 83 | color: #c5c8c6; 84 | padding: 0.5em; 85 | -webkit-text-size-adjust: none; 86 | } 87 | 88 | .coffeescript .javascript, 89 | .javascript .xml, 90 | .tex .hljs-formula, 91 | .xml .javascript, 92 | .xml .vbscript, 93 | .xml .css, 94 | .xml .hljs-cdata { 95 | opacity: 0.5; 96 | } 97 | -------------------------------------------------------------------------------- /src/garbage.md: -------------------------------------------------------------------------------- 1 | # Nix garbage collection 2 | 3 | With NixOS, it's important to clear the garbage now and then. Clearing the garbage removes the following things from your system: 4 | 5 | - Old boot entries 6 | - Unused derivations 7 | - `/nix/store/trash` 8 | - Stale symlinks 9 | 10 | Clearing the garbage means that certain packages which were downloaded on the fly will be removed _(For example, packages downloaded using `nix-shell -p`)_, and will have to be re-fetched in order to use them again. 11 | 12 | ## Clearing all of the garbage 13 | 14 | > **Warning** 15 | > 16 | > Clearing old boot entries makes rolling back to a previous configuration impossible. Only do this if you are certain that your current system is stable. **This action cannot be undone.** 17 | 18 | Using the `nix-collect-garbage` command is used to manage all of your garbage cleaning needs. To remove everything from the Nix store that is not used by the current system (so, this includes old derivations, files, symlinks and boot entries), run the following command: 19 | 20 | ``` 21 | sudo nix-collect-garbage -d 22 | sudo nixos-rebuild switch 23 | ``` 24 | 25 | Rebuilding the system at the end is required to update the set of boot entries. 26 | 27 | ## Clearing some of the garbage 28 | 29 | Instead of clearing absolutely everything, it's often better to just clear the majority of the garbage. This doesn't clear the boot entries and ensures that previous generations are kept safe, so you are able to rollback if needed: 30 | 31 | ``` 32 | sudo nix-collect-garbage 33 | ``` 34 | 35 | ## Automatically clearing garbage 36 | 37 | NixOS provides a configuration option that allows it to automatically collect the garbage at certain time intervals. This is done using the `nix.gc` option: 38 | 39 | ```nix 40 | nix.gc = { 41 | automatic = true; # Enable the automatic garbage collector 42 | dates = "03:15"; # When to run the garbage collector 43 | options = "-d"; # Arguments to pass to nix-collect-garbage 44 | }; 45 | ``` 46 | 47 | The format for the `dates` attribute can be found at the [systemd.time man page](https://www.freedesktop.org/software/systemd/man/systemd.time.html). 48 | -------------------------------------------------------------------------------- /src/nixsandboxes.md: -------------------------------------------------------------------------------- 1 | # Nix shell sandboxes 2 | 3 | Say you want to test out a program, but don't want to go through all of the effort of adding it to your system configuration and rebuilding it. This is where the Nix shell comes in. 4 | 5 | ## Temporarily using programs 6 | 7 | To temporarily bring a Nix package into the scope of your current terminal, you can use the `nix-shell -p` command. This lets you specify Nix packages which will be included in the "nix shell" environment, _**as well as your current packages**_. 8 | 9 | ``` 10 | $ nix-shell -p hello 11 | 12 | [nix-shell:~]$ hello 13 | Hello, world! 14 | ``` 15 | 16 | You are still able to modify the environment around you (e.g. create folders, edit files, open programs that are currently installed on your system). When you exit the nix shell (Using the `exit` command), that package is not present on your current system. For example, if I use `nix-shell -p hello`, the `hello` command is _only_ present in the nix shell even if it wasn't installed with my main configuration. 17 | 18 | To add multiple packages, include their names (as if you were adding it to your `configuration.nix` file) with a space between each one: 19 | 20 | ``` 21 | $ nix-shell -p hello gnome3.gnome-mahjongg vitetris 22 | ``` 23 | 24 | ## Pure Nix shell environments 25 | 26 | By adding the `--pure` tag to the `nix-shell` command, you are able to create an environment which contains **none** of the packages installed on your current system. 27 | 28 | For example, if you have the following in your `configuration.nix` file: 29 | 30 | ```nix 31 | environment.systemPackages = with pkgs; [ 32 | hello 33 | ]; 34 | ``` 35 | 36 | Running the `hello` command in a pure nix shell that doesn't have the _hello_ package will produce the following result: 37 | 38 | ``` 39 | $ nix-shell --pure -p 40 | 41 | [nix-shell:~]$ hello 42 | The program 'hello' is currently not installed. It is provided by several packages. You can install it by typing one of the following: 43 | nix-env -iA nixos.hello 44 | nix-env -iA nixos.mbedtls 45 | nix-env -iA nixos.perkeep 46 | ``` 47 | 48 | ## Garbage collection of Nix shells 49 | 50 | When a package is downloaded temporarily for use in the Nix shell, it is stored in the Nix store (in `/nix/store`) until garbage collected. Until it is garbage collected, opening the same Nix shell for downloaded programs will be instant (as they're already downloaded). 51 | 52 | As stated in the chapter on garbage collection, running the Nix garbage collector will remove any temporarily installed programs. Once garbage collected, in order to use them again, they will be redownloaded when a Nix shell is opened that requires packages which aren't in the Nix store. 53 | 54 | ## Nix shells with `fish` or `zsh` 55 | 56 | When using Nix shells, it can sometimes be useful to keep track of what packages are currently installed in that instance of the Nix shell. A helpful tool is the [any-nix-shell](https://github.com/haslersn/any-nix-shell), which shows the information of temporarily installed packages when using the fish shell or the z shell. 57 | -------------------------------------------------------------------------------- /src/packageoptions.md: -------------------------------------------------------------------------------- 1 | # Setting package options 2 | 3 | The NixOS configuration file not only allows you to configure the system, but it also allows you to configure the process of building itself. This is done by changing the attributes of the `nixpkgs` option. This also allows you to edit the settings of other applications which are installed in your system packages. 4 | 5 | ## Enabling unfree software 6 | 7 | As mentioned in the chapter on installing programs, unfree software (software that is not permitted to be redistributed) can be installed by using the following in your `configuration.nix` file: 8 | 9 | ```nix 10 | nixpkgs.config = { 11 | allowUnfree = true; 12 | }; 13 | ``` 14 | 15 | ## Setting package specific settings 16 | 17 | Using the [NixOS package search website](https://nixos.org/nixos/packages.html#) that was described in the chapter on installing programs, we are able to search for packages that we want. When you click on the package, it provides information about the package. In particular, we want to look at the **Nix expression** for the package. This concept is better explained using an example: 18 | 19 | ### Example: Enabling flash on Chromium: 20 | 21 | Firstly, we search for chromium using the NixOS package website. Clicking on the result provides us with a link to the Nix expression where this package is defined: 22 | 23 | ![chromium result from the online website](./chromium.png) 24 | 25 | Following the link leads us to a file called `browser.nix`. Unfortunately, in order to find the list of potential settings, we need to use the main endpoint for packages, which is the `default.nix` file. This can be done by changing directories (shown at the top of the file on GitHub) to find the relevant `default.nix` file. 26 | 27 | A snippet of the chromium `default.nix` file is shown below: 28 | 29 | ```nix 30 | ... 31 | 32 | # package customization 33 | , channel ? "stable" 34 | , enableNaCl ? false 35 | , gnomeSupport ? false, gnome ? null 36 | , gnomeKeyringSupport ? false 37 | , proprietaryCodecs ? true 38 | , enablePepperFlash ? false 39 | , enableWideVine ? false 40 | , cupsSupport ? true 41 | , pulseSupport ? config.pulseaudio or stdenv.isLinux 42 | , commandLineArgs ? "" 43 | }: 44 | 45 | ... 46 | ``` 47 | 48 | Any parameters followed with a `?` are basically optional, where the value after the `?` is their default value. In this example, we want to enable flash, so what we want to do is basically redefine the package named "chromium" with a copy of the package, except with the `enablePepperFlash` option set to true. 49 | 50 | ```nix 51 | nixpkgs.config = { 52 | 53 | chromium = { 54 | enablePepperFlash = true; 55 | }; 56 | 57 | }; 58 | ``` 59 | 60 | And it's that easy. This basically changes the package `chromium` which is used in `environment.systemPackages` to our new version of chromium that has pepper flash enabled (Pepper Flash is basically flash, but maintained by Google instead of Adobe). When the configuration is built, it will use the version of chromium that we have declared as opposed to the default version of chromium. 61 | -------------------------------------------------------------------------------- /src/unsafe.md: -------------------------------------------------------------------------------- 1 | # Unsafe NixOS 2 | 3 | > **Note:** 4 | > 5 | > The contents of this chapter are _heavily advised against_. In fact, they are beyond heavily advised against. **Do not** do the things outlined in this chapter. The sole reason this information is in NixOS4Noobs is to basically inform you to **never** do this stuff. 6 | 7 | > **Author's Note:** 8 | > 9 | > I read somewhere that one of the best ways of teaching someone something is to basically show them what _not_ to do, before telling them the correct way of doing something. That way, they gain a better understanding of the underlying consequences and know how to mitigate them in future. I thought this principle can apply very well to NixOS, since I have personally done all of these things and have had to deal with all of the consequences. 10 | 11 | ## Unlocking the Nix Store 12 | 13 | The Nix store, located in `/nix/store/` is where all of the Nix magic happens. Since this is basically the main back end for the Nix system, and all isolated installations of components are stored in this location, messing with the Nix store is not a good idea. Hence, it comes pre-built with a lovely lock on it to prevent anyone tampering with it. 14 | 15 | Nonetheless, Nix lets you unlock the store by adding the following one line to your `configuration.nix` file: 16 | 17 | ```nix 18 | nix.readOnlyStore = false; 19 | ``` 20 | 21 | This may seem super useful at first - it lets you fix up little derivations here and there and make everything work exactly as you want if something's a little off. However, this is not the case. Nix assumes that the Nix store is completely immutable and if something's not quite what Nix expects, Nix will basically have a melt down. 22 | 23 | ### Alternatives to unlocking the Nix Store 24 | 25 | So now you know _never to use that option_, the main alternatives are to create derivations or to use Nix expressions that write to the Nix store in a pure manner. You already know how to create derivations according to [Chapter 4. Making Nix packages](./derivations.md). 26 | 27 | #### Writing text files to the Nix Store 28 | 29 | Using the `builtin` function `toFile`, it's surprisingly easy to create a file in a Nix expression: 30 | 31 | ```nix 32 | builtins.toFile "filename.txt" '' 33 | file contents go here! 34 | ''; 35 | ``` 36 | 37 | This creates a file called `filename.txt`, with the provided file contents and stores it in the Nix store (fully hashed as you'd expect). The result of this function is the path which is created in the Nix store which refers to the file that was generated. 38 | 39 | #### Writing executable text files to the Nix Store 40 | 41 | Executable files can be written using the `pkgs`, which can be pulled into scope using the `with import {};` expression. The [writeTextFile](https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/trivial-builders.nix#L30) function allows you to create a file with extra options such as: 42 | 43 | - Declaring the file's folder which it is written to 44 | - Declaring if the file should be executable or not 45 | - Running a check phase (for example, to check for syntax errors) 46 | 47 | ```nix 48 | with import {}; 49 | writeTextFile { 50 | name = "my-file"; 51 | text = '' 52 | Contents of File 53 | ''; 54 | executable = true; 55 | destination = "/bin/my-file"; 56 | } 57 | ``` 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /docs/css/general.css: -------------------------------------------------------------------------------- 1 | /* Base styles and content styles */ 2 | 3 | @import 'variables.css'; 4 | 5 | html { 6 | font-family: "Open Sans", sans-serif; 7 | color: var(--fg); 8 | background-color: var(--bg); 9 | text-size-adjust: none; 10 | } 11 | 12 | body { 13 | margin: 0; 14 | font-size: 1rem; 15 | overflow-x: hidden; 16 | } 17 | 18 | code { 19 | font-family: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace; 20 | font-size: 0.875em; /* please adjust the ace font size accordingly in editor.js */ 21 | } 22 | 23 | .left { float: left; } 24 | .right { float: right; } 25 | .hidden { display: none; } 26 | .play-button.hidden { display: none; } 27 | 28 | h2, h3 { margin-top: 2.5em; } 29 | h4, h5 { margin-top: 2em; } 30 | 31 | .header + .header h3, 32 | .header + .header h4, 33 | .header + .header h5 { 34 | margin-top: 1em; 35 | } 36 | 37 | a.header:target h1:before, 38 | a.header:target h2:before, 39 | a.header:target h3:before, 40 | a.header:target h4:before { 41 | display: inline-block; 42 | content: "»"; 43 | margin-left: -30px; 44 | width: 30px; 45 | } 46 | 47 | .page { 48 | outline: 0; 49 | padding: 0 var(--page-padding); 50 | } 51 | .page-wrapper { 52 | box-sizing: border-box; 53 | } 54 | .js .page-wrapper { 55 | transition: margin-left 0.3s ease, transform 0.3s ease; /* Animation: slide away */ 56 | } 57 | 58 | .content { 59 | overflow-y: auto; 60 | padding: 0 15px; 61 | padding-bottom: 50px; 62 | } 63 | .content main { 64 | margin-left: auto; 65 | margin-right: auto; 66 | max-width: var(--content-max-width); 67 | } 68 | .content a { text-decoration: none; } 69 | .content a:hover { text-decoration: underline; } 70 | .content img { max-width: 100%; } 71 | .content .header:link, 72 | .content .header:visited { 73 | color: var(--fg); 74 | } 75 | .content .header:link, 76 | .content .header:visited:hover { 77 | text-decoration: none; 78 | } 79 | 80 | table { 81 | margin: 0 auto; 82 | border-collapse: collapse; 83 | } 84 | table td { 85 | padding: 3px 20px; 86 | border: 1px var(--table-border-color) solid; 87 | } 88 | table thead { 89 | background: var(--table-header-bg); 90 | } 91 | table thead td { 92 | font-weight: 700; 93 | border: none; 94 | } 95 | table thead tr { 96 | border: 1px var(--table-header-bg) solid; 97 | } 98 | /* Alternate background colors for rows */ 99 | table tbody tr:nth-child(2n) { 100 | background: var(--table-alternate-bg); 101 | } 102 | 103 | 104 | blockquote { 105 | margin: 20px 0; 106 | padding: 0 20px; 107 | color: var(--fg); 108 | background-color: var(--quote-bg); 109 | border-top: .1em solid var(--quote-border); 110 | border-bottom: .1em solid var(--quote-border); 111 | } 112 | 113 | 114 | :not(.footnote-definition) + .footnote-definition, 115 | .footnote-definition + :not(.footnote-definition) { 116 | margin-top: 2em; 117 | } 118 | .footnote-definition { 119 | font-size: 0.9em; 120 | margin: 0.5em 0; 121 | } 122 | .footnote-definition p { 123 | display: inline; 124 | } 125 | 126 | .tooltiptext { 127 | position: absolute; 128 | visibility: hidden; 129 | color: #fff; 130 | background-color: #333; 131 | transform: translateX(-50%); /* Center by moving tooltip 50% of its width left */ 132 | left: -8px; /* Half of the width of the icon */ 133 | top: -35px; 134 | font-size: 0.8em; 135 | text-align: center; 136 | border-radius: 6px; 137 | padding: 5px 8px; 138 | margin: 5px; 139 | z-index: 1000; 140 | } 141 | .tooltipped .tooltiptext { 142 | visibility: visible; 143 | } 144 | -------------------------------------------------------------------------------- /src/installingprogs.md: -------------------------------------------------------------------------------- 1 | # Installing programs 2 | 3 | There are many different ways of installing programs on NixOS. In this section, we will cover two methods of installing programs that use the `configuration.nix` file. 4 | 5 | ## Method 1: Installing programs using the `programs` attribute 6 | 7 | _Certain_ programs can be installed by using the following structure in your `configuration.nix` file: 8 | 9 | ```nix 10 | programs = { 11 | # Programs go here 12 | }; 13 | ``` 14 | 15 | Only a few programs can be installed this way - these programs can be found [here](https://nixos.org/nixos/options.html#programs.) by using the NixOS options search feature, or by using the nix repl: 16 | 17 | ```nix 18 | nix repl '' 19 | nix-repl> builtins.attrNames config.programs 20 | ``` 21 | 22 | > **Note** 23 | > 24 | > Using this method for installing programs is desirable if possible compared to method 2, as this normally sets the required environment variables for the program to function properly. In addition, various configuration options are available _(e.g. adding shell aliases to the fish shell)_ 25 | > 26 | > Of course, this is only an option if the specific program you want exists in the programs attribute. 27 | 28 | ### Example: Installing and setting up the `fish` shell 29 | 30 | In this example, we enable the program `chromium`, as well as the `fish` command. We also add an alias to the `du` command called `dirsize` which can be used within the fish shell: 31 | ```nix 32 | programs = { 33 | 34 | chromium.enable = true; 35 | 36 | fish = { 37 | enable = true; 38 | shellAliases = [ 39 | dirsize = "du -sh" 40 | ]; 41 | }; 42 | 43 | }; 44 | ``` 45 | 46 | ## Method 2: Installing programs using the system packages 47 | 48 | > **Unfree packages** 49 | > 50 | > Certain packages are known as `unfree`, which means that their license states that they cannot be redistributed (for example, Google Chrome). In order to install `unfree` packages, you need to add the following to your `configuration.nix` file: 51 | > ```nix 52 | > nixpkgs.config = { 53 | > allowUnfree = true; 54 | > }; 55 | > ``` 56 | 57 | This method of installing programs is the primary method of installing programs in NixOS. It basically uses the entire Nixpkgs suite of packages and allows you to choose the packages you want. The general structure in your `configuration.nix` file will look something like this: 58 | 59 | ```nix 60 | environment.systemPackages = with pkgs; [ 61 | # Packages go here 62 | ]; 63 | ``` 64 | 65 | Finding packages is a little bit more tricky compared to finding programs in method 1. The following strategies are as follows: 66 | 67 | ### Using the `nix search` command 68 | 69 | Using `nix search` is the easiest way to find packages for your current version of NixOS. Simply type `nix search ` to search for a specific package 70 | 71 | ``` 72 | $ nix search google chrome 73 | * nixpkgs.google-chrome (google-chrome) 74 | A freeware web browser developed by Google 75 | 76 | * nixpkgs.google-chrome-beta (google-chrome-beta) 77 | A freeware web browser developed by Google 78 | 79 | * nixpkgs.google-chrome-dev (google-chrome-dev) 80 | A freeware web browser developed by Google 81 | 82 | * nixpkgs.python37Packages.PyChromecast (python3.7-PyChromecast) 83 | Library for Python 3.4+ to communicate with the Google Chromecast 84 | ``` 85 | 86 | To use a package from the `nix search` command, **you must include the package name after `nixpkgs`, not the name in brackets**. This is due to various package 'flavours' being packaged under a single package name. 87 | 88 | For example: 89 | 90 | ```nix 91 | environment.systemPackages = with pkgs; [ 92 | google-chrome 93 | gnome3.gnome-mahjongg 94 | ]; 95 | ``` 96 | 97 | ### Using the online package search 98 | 99 | Using the [NixOS package search](https://nixos.org/nixos/packages.html#) website, it's easy to find packages. The name required in the system packages from this website is the **Attribute name** field. 100 | 101 | ![vitetris](./vitetris.png) 102 | 103 | ```nix 104 | environment.systemPackages = with pkgs; [ 105 | vitetris 106 | ]; 107 | ``` 108 | -------------------------------------------------------------------------------- /src/options.md: -------------------------------------------------------------------------------- 1 | # NixOS configuration options 2 | 3 | The NixOS configuration file also contains a section for other options to manage the system. This includes, but not limited to: 4 | 5 | - Configuring the hardware setup 6 | - Configuring TTYs 7 | - Configuring security systems 8 | - Configuring the way Nix builds your configuration 9 | - Configuring the boot setup 10 | 11 | Searching for these options is a little more tricky, but here are various ways to go about doing so: 12 | 13 | ## Method 1: Using the online options search 14 | 15 | > This method is best for finding new options and finding examples of alternative values for options 16 | 17 | The [Search NixOS options](https://nixos.org/nixos/options.html#) website is the best way to search for options. It includes descriptions of each option, along with its default value and sometimes an example of alternate values. Using options is as simple as declaring the **Option name** in your `configuration.nix` file and assigning a value to it: 18 | 19 | ```nix 20 | hardware.bluetooth.enable = true; 21 | ``` 22 | 23 | ## Method 2: Using the `nixos-option` command 24 | 25 | > This method is best for finding where your current system's configuration settings are declared 26 | 27 | The `nixos-option` command lets you browse the options by name. Compared to using the website, this is a lot more tedious and slow. 28 | 29 | ``` 30 | $ nixos-option 31 | This attribute set contains: 32 | _module 33 | appstream 34 | assertions 35 | boot 36 | ... 37 | 38 | $ nixos-option hardware 39 | This attribute set contains: 40 | bladeRF 41 | bluetooth 42 | brightnessctl 43 | 44 | $ nixos-option hardware.bluetooth 45 | This attribute set contains: 46 | enable 47 | extraConfig 48 | package 49 | powerOnBoot 50 | ``` 51 | 52 | If you reach the final "leaf" node of an option, the `nixos-option` command will provide information about that option, as well as the current assigned value in your current system configuration. This is the best method for searching for options that are defined in your current system configuration, especially if you have your configuration split over multiple files. 53 | 54 | ``` 55 | $ nixos-option hardware.bluetooth.enable 56 | Value: 57 | true 58 | 59 | Default: 60 | false 61 | 62 | Example: 63 | true 64 | 65 | Description: 66 | "Whether to enable support for Bluetooth.." 67 | 68 | Declared by: 69 | "/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/services/hardware/bluetooth.nix" 70 | 71 | Defined by: 72 | "/etc/nixos/configuration." 73 | ``` 74 | 75 | ## Method 3: Using the Nix repl 76 | 77 | > This method is best for finding the values of your current system's configuration 78 | 79 | Opening a Nix repl with the `''` parameter allows you to browse your current `configuration.nix` file as a parsed Nix expression. Compared to `nixos-option`, the Nix repl is a much faster way of traversing the set of system configuration options with its tab completion facility. 80 | 81 | _(In the example below, wherever you see `[Tab]`, this means press the tab button)_ 82 | 83 | ```nix 84 | $ nix repl '' 85 | 86 | nix-repl> config.[TAB] 87 | config._module config.i18n config.programs 88 | config.appstream config.ids config.security 89 | config.assertions config.jobs config.services 90 | ... 91 | ``` 92 | 93 | You can also use the Nix repl to view the current values of your current system configuration: 94 | 95 | ``` 96 | $ nix repl '' 97 | 98 | nix-repl> config.hardware.bluetooth.enable 99 | true 100 | ``` 101 | 102 | ## Method 4: Using `man configuration.nix` 103 | 104 | The `man configuration.nix` command displays all options that is available for the `configuration.nix` file. It's basically the same as Method 1, except searching for certain options is a little bit more tricky and technical. Using the `/` key, it is possible to search the man page for a specific option. 105 | 106 | ## Method 5: Using other people's `configuration.nix` file 107 | 108 | One of the best ways of figuring out how to use various NixOS configuration options is to look at other NixOS user's configuration files. [This website](https://search.tx0.co/?q=&i=nope&files=configuration.nix&repos=) is dedicated to a set of repositories of NixOS users and can be used to search for certain attributes in their specific configuration files by using the _File Path_ setting in the Advanced section below the main textbox. 109 | 110 | This also includes links to their repositories to where the code is declared. In addition, [JorelAli's configuration](https://github.com/JorelAli/nixos/blob/master/configuration.nix) is a pretty good resource that is well documented. 111 | -------------------------------------------------------------------------------- /src/channels.md: -------------------------------------------------------------------------------- 1 | # Nix channels 2 | 3 | Nix channels are basically "where the downloaded packages come from". By default, on NixOS, packages are downloaded from the `nixos` channel (Is that really a surprise?) 4 | 5 | In general, when it comes to channels, there are 3[^1] channels that are available: 6 | 7 | | Channel | Example channels | 8 | | ------- | ---------------- | 9 | | Stable channels | `nixos-19.03` | 10 | | Unstable channels (bleeding-edge) | `nixos-unstable` | 11 | | Old channels | `nixos-18.03`, `nixos-17.09` | 12 | 13 | ## Using different channels in your configuration 14 | 15 | There are two major methods of using different channels in your `configuration.nix` file. Which one you choose is entirely up to you, each have their own perks and drawbacks. 16 | 17 | > **Warning** 18 | > 19 | > There are multiple different "defined" NixOS channels out there. Some are named `nixos`, whereas others are named `nixpkgs`. **Do not use nixpkgs channels on NixOS**. The `nixos` channels have different tests to the `nixpkgs` channels and are designed for the operating system as a whole, unlike the `nixpkgs` channels. 20 | 21 | ### Method 1: Using `nix-channel` 22 | 23 | The `nix-channel` command is designed to manage multiple nix channels on your system. It's easy to update channels to the latest versions and add or remove channels. 24 | 25 | * To list all channels that are available in your system, use the `--list` flag: 26 | ``` 27 | $ sudo nix-channel --list 28 | ``` 29 | 30 | * To add a new channel (for example `nixos-unstable`), use the `--add` flag, followed by the URL of the channel and a name to identify it by. The list of channel URLs can be found at [https://nixos.org/channels/](https://nixos.org/channels/). 31 | 32 | ``` 33 | $ sudo nix-channel --add https://nixos.org/channels/nixos-unstable unstable 34 | ``` 35 | 36 | * To update a channel, use the `--update` flag, followed by the channel name that you declared when you added the channel: 37 | 38 | ``` 39 | $ sudo nix-channel --update unstable 40 | ``` 41 | 42 | Once you've added your desired channels, you can then add them to your `configuration.nix` file. This can be done using the Nix `let` expression, as followed: 43 | 44 | ```nix 45 | { config, pkgs, ... }: 46 | 47 | let 48 | unstable = import {}; 49 | in { 50 | # The rest of your configuration here 51 | 52 | environment.systemPackages = with pkgs; [ 53 | # To use unstable packages, precede package names with unstable. 54 | # as defined in the "let ... in" section above 55 | unstable.hello 56 | ]; 57 | 58 | }; 59 | ``` 60 | ### Method 2: Using git revisions 61 | 62 | This method gives you much more control over what specific version of Nixpkgs you want to use on your system, however it means that updating channels (if you choose to do so) will also have to be done manually. 63 | 64 | The only difference is that you require the following code structure: 65 | 66 | ```nix 67 | import (builtins.fetchGit { 68 | name = "NAME"; 69 | url = https://github.com/nixos/nixpkgs/; 70 | rev = "REV"; 71 | }) {}; 72 | ``` 73 | 74 | The _NAME_ is some sort of descriptive name for your own benefit, and the _REV_ refers to the Git commit hash of your choosing (This is pretty easy to find on GitHub, it's shown as a 7-character string on the [Nixpkgs repository's commits](https://github.com/NixOS/nixpkgs) - clicking on the clipboard icon next to it copies the full hash to your clipboard) 75 | 76 | An example of using this would be as follows: 77 | 78 | ```nix 79 | { config, pkgs, ... }: 80 | 81 | let 82 | myNixpkgs = import (builtins.fetchGit { 83 | name = "nixos-unstable-2018-09-12"; 84 | url = https://github.com/nixos/nixpkgs/; 85 | rev = "ca2ba44cab47767c8127d1c8633e2b581644eb8f"; 86 | }) {}; 87 | in { 88 | # The rest of your configuration here 89 | 90 | environment.systemPackages = with pkgs; [ 91 | # Exactly the same as the above example 92 | myNixpkgs.hello 93 | ]; 94 | }; 95 | ``` 96 | 97 | Alternatively, you can easily change all packages declared in the system packages to use your chosen git revision by changing the packages that are brought into scope after the `with` keyword: 98 | 99 | ```nix 100 | environment.systemPackages = with myNixpkgs; [ 101 | hello 102 | ]; 103 | ``` 104 | 105 | ## Finding information about current nix channels 106 | 107 | The [NixOS channel update website](http://howoldis.herokuapp.com/) provides insights on when the various Nix channels were last updated, including the link to the latest commit that was included for that update. It's the quickest and easiest way for you to browse through the repository to find whether a specific package has been updated or not. 108 | 109 | ----- 110 | 111 | [^1]: Technically there are 4 channels: Stable, Unstable, Old and _Small_. Small channels have much less packages, such as no desktop packages or packages for certain programming languages, as well as less tests for actual operating system usage. They're designed for servers running NixOS, where you want speedy updates. They normally build more stuff from source compared to other NixOS channels. 112 | -------------------------------------------------------------------------------- /src/nixexpressions.md: -------------------------------------------------------------------------------- 1 | # Nix Expressions 2 | 3 | The `configuration.nix` file is written as a _Nix Expression_, which is basically the "programming language" that Nix uses. In this chapter, we will cover the basics[^1] of writing Nix expressions, specifically for the NixOS configuration. 4 | 5 | [^1]: In particular, we will cover the things that you're likely to discover in the `configuration.nix` file. We will not cover _all_ of the technicalities (e.g. function definitions), but we will cover enough to get you through the configuration. 6 | 7 | ----- 8 | 9 | ## Basic data types 10 | 11 | As with any programming language, there are the basic data types, which are as follows: 12 | 13 | * **Strings** - Text values which are encased in quotes `"hello"`, or two single quotes for multi-line strings: 14 | 15 | ```nix 16 | '' 17 | This is on line 1 18 | This is another line 19 | '' 20 | ``` 21 | 22 | If you want to use Nix variables inside your strings, you can do so using the `${}` notation, like this[^2]: 23 | 24 | ```nix 25 | someSet = rec { 26 | myVar = "hello"; 27 | someString = "${myVar}, world!" 28 | } 29 | ``` 30 | 31 | [^2]: See the section below for recursive sets - since we reference `myVar` in the declaration of `someString`, the set needs to be declared as recursive. 32 | 33 | * **Integers & Floats** - Numerical values, such as `2` or `501.23`. Integer and floating point numbers are inferred. If using math with integers, integer division will be used by default. 34 | 35 | * **Paths** - Paths to files and directories don't need quotes, they can be written just like `/some/directory/file.txt` 36 | 37 | * **Functions** - These basically execute code. These will not be covered in NixOS4Noobs. 38 | 39 | * **Lists & Sets** - These are explained in more detail below 40 | 41 | ## Lists 42 | 43 | In Nix expressions, **lists are declared using square brackets**, and use a **space to separate each element**. 44 | 45 | ### Example: System packages 46 | 47 | The system packages section of the configuration file is represented as a list: 48 | 49 | ```nix 50 | environment.systemPackages = [ 51 | hello 52 | chromium 53 | ]; 54 | ``` 55 | 56 | It can also be written like this (Typically a space is put after the `[` and before the `]`, but this is optional): 57 | 58 | ```nix 59 | environment.systemPackages = [ hello chromium ]; 60 | ``` 61 | 62 | Complex elements which would involve spaces require brackets to "contain" them: 63 | 64 | ```nix 65 | environment.systemPackages = [ 66 | hello 67 | (import ./someLocalPackage.nix {}) 68 | chromium 69 | ]; 70 | ``` 71 | 72 | ## Sets (Attribute sets) 73 | 74 | Sets are similar to tables with key-value pairs. They consist of elements declared by some key, and assigned a value which can be any type. **Sets are declared using curly brackets**, and a **semicolon is used to separate each key-value pair**. Sets are polymorphic (They can have multiple types for _values_, not for keys). 75 | 76 | ```nix 77 | mySet = { 78 | name = "Bob"; 79 | otherName = "Jim"; 80 | aNumber = 2; 81 | isItWednesday = false; 82 | } 83 | ``` 84 | 85 | ### Example: System programs 86 | 87 | Sets are used to declare programs for the system using the `programs` key: 88 | 89 | ```nix 90 | programs = { 91 | adb.enable = true; 92 | bash.enableCompletion = true; 93 | ssh.forwardX11 = true; 94 | }; 95 | ``` 96 | 97 | ### Sets inside sets 98 | 99 | Because sets contain elements of keys and values, where values can be of any type, there's nothing stopping you from declaring a set with an element which is also a set. 100 | 101 | ```nix 102 | mySet = { 103 | myKey = { 104 | someValueInInnerSet = 10; 105 | }; 106 | } 107 | ``` 108 | 109 | This can get tedious and overcomplicated, so we can simplify this using the dot notation: 110 | 111 | ```nix 112 | mySet.myKey = { 113 | someValueInInnerSet = 10; 114 | } 115 | ``` 116 | 117 | Or even simpler: 118 | 119 | ```nix 120 | mySet.myKey.someValueInInnerSet = 10; 121 | ``` 122 | 123 | #### Example: Enabling sound in the system configuration 124 | 125 | In most configurations, enabling sound is done using the following code: 126 | ```nix 127 | sound.enable = true; 128 | ``` 129 | 130 | This can be written as: 131 | 132 | ```nix 133 | sound = { 134 | enable = true; 135 | } 136 | ``` 137 | 138 | There's no preference to which one is right and which one is wrong, it's entirely up to you. Some people like to split them up to make sections easier to read. 139 | 140 | ### Recursive sets (`rec`) 141 | 142 | Sets that use variables or values that are declared inside itself need to be declared as a recursive set. This is done using the `rec` keyword, which comes _just before_ the opening curly brackets: 143 | 144 | ```nix 145 | someSet = rec { 146 | someValue = 2; 147 | someOtherValue = 2 + someValue; 148 | } 149 | ``` 150 | 151 | This also applies for anything used in Strings using the `${}` notation: 152 | 153 | ```nix 154 | someSet = rec { 155 | myVar = "hello"; 156 | someString = "${myVar}, world!" 157 | } 158 | ``` -------------------------------------------------------------------------------- /docs/css/variables.css: -------------------------------------------------------------------------------- 1 | 2 | /* Globals */ 3 | 4 | :root { 5 | --sidebar-width: 300px; 6 | --page-padding: 15px; 7 | --content-max-width: 750px; 8 | } 9 | 10 | /* Themes */ 11 | 12 | .ayu { 13 | --bg: hsl(210, 25%, 8%); 14 | --fg: #c5c5c5; 15 | 16 | --sidebar-bg: #14191f; 17 | --sidebar-fg: #c8c9db; 18 | --sidebar-non-existant: #5c6773; 19 | --sidebar-active: #ffb454; 20 | --sidebar-spacer: #2d334f; 21 | 22 | --scrollbar: var(--sidebar-fg); 23 | 24 | --icons: #737480; 25 | --icons-hover: #b7b9cc; 26 | 27 | --links: #0096cf; 28 | 29 | --inline-code-color: #ffb454; 30 | 31 | --theme-popup-bg: #14191f; 32 | --theme-popup-border: #5c6773; 33 | --theme-hover: #191f26; 34 | 35 | --quote-bg: hsl(226, 15%, 17%); 36 | --quote-border: hsl(226, 15%, 22%); 37 | 38 | --table-border-color: hsl(210, 25%, 13%); 39 | --table-header-bg: hsl(210, 25%, 28%); 40 | --table-alternate-bg: hsl(210, 25%, 11%); 41 | 42 | --searchbar-border-color: #848484; 43 | --searchbar-bg: #424242; 44 | --searchbar-fg: #fff; 45 | --searchbar-shadow-color: #d4c89f; 46 | --searchresults-header-fg: #666; 47 | --searchresults-border-color: #888; 48 | --searchresults-li-bg: #252932; 49 | --search-mark-bg: #e3b171; 50 | } 51 | 52 | .coal { 53 | --bg: hsl(200, 7%, 8%); 54 | --fg: #98a3ad; 55 | 56 | --sidebar-bg: #292c2f; 57 | --sidebar-fg: #a1adb8; 58 | --sidebar-non-existant: #505254; 59 | --sidebar-active: #3473ad; 60 | --sidebar-spacer: #393939; 61 | 62 | --scrollbar: var(--sidebar-fg); 63 | 64 | --icons: #43484d; 65 | --icons-hover: #b3c0cc; 66 | 67 | --links: #2b79a2; 68 | 69 | --inline-code-color: #c5c8c6;; 70 | 71 | --theme-popup-bg: #141617; 72 | --theme-popup-border: #43484d; 73 | --theme-hover: #1f2124; 74 | 75 | --quote-bg: hsl(234, 21%, 18%); 76 | --quote-border: hsl(234, 21%, 23%); 77 | 78 | --table-border-color: hsl(200, 7%, 13%); 79 | --table-header-bg: hsl(200, 7%, 28%); 80 | --table-alternate-bg: hsl(200, 7%, 11%); 81 | 82 | --searchbar-border-color: #aaa; 83 | --searchbar-bg: #b7b7b7; 84 | --searchbar-fg: #000; 85 | --searchbar-shadow-color: #aaa; 86 | --searchresults-header-fg: #666; 87 | --searchresults-border-color: #98a3ad; 88 | --searchresults-li-bg: #2b2b2f; 89 | --search-mark-bg: #355c7d; 90 | } 91 | 92 | .light { 93 | --bg: hsl(0, 0%, 100%); 94 | --fg: #333333; 95 | 96 | --sidebar-bg: #fafafa; 97 | --sidebar-fg: #364149; 98 | --sidebar-non-existant: #aaaaaa; 99 | --sidebar-active: #008cff; 100 | --sidebar-spacer: #f4f4f4; 101 | 102 | --scrollbar: #cccccc; 103 | 104 | --icons: #cccccc; 105 | --icons-hover: #333333; 106 | 107 | --links: #4183c4; 108 | 109 | --inline-code-color: #6e6b5e; 110 | 111 | --theme-popup-bg: #fafafa; 112 | --theme-popup-border: #cccccc; 113 | --theme-hover: #e6e6e6; 114 | 115 | --quote-bg: hsl(197, 37%, 96%); 116 | --quote-border: hsl(197, 37%, 91%); 117 | 118 | --table-border-color: hsl(0, 0%, 95%); 119 | --table-header-bg: hsl(0, 0%, 80%); 120 | --table-alternate-bg: hsl(0, 0%, 97%); 121 | 122 | --searchbar-border-color: #aaa; 123 | --searchbar-bg: #fafafa; 124 | --searchbar-fg: #000; 125 | --searchbar-shadow-color: #aaa; 126 | --searchresults-header-fg: #666; 127 | --searchresults-border-color: #888; 128 | --searchresults-li-bg: #e4f2fe; 129 | --search-mark-bg: #a2cff5; 130 | } 131 | 132 | .navy { 133 | --bg: hsl(226, 23%, 11%); 134 | --fg: #bcbdd0; 135 | 136 | --sidebar-bg: #282d3f; 137 | --sidebar-fg: #c8c9db; 138 | --sidebar-non-existant: #505274; 139 | --sidebar-active: #2b79a2; 140 | --sidebar-spacer: #2d334f; 141 | 142 | --scrollbar: var(--sidebar-fg); 143 | 144 | --icons: #737480; 145 | --icons-hover: #b7b9cc; 146 | 147 | --links: #2b79a2; 148 | 149 | --inline-code-color: #c5c8c6;; 150 | 151 | --theme-popup-bg: #161923; 152 | --theme-popup-border: #737480; 153 | --theme-hover: #282e40; 154 | 155 | --quote-bg: hsl(226, 15%, 17%); 156 | --quote-border: hsl(226, 15%, 22%); 157 | 158 | --table-border-color: hsl(226, 23%, 16%); 159 | --table-header-bg: hsl(226, 23%, 31%); 160 | --table-alternate-bg: hsl(226, 23%, 14%); 161 | 162 | --searchbar-border-color: #aaa; 163 | --searchbar-bg: #aeaec6; 164 | --searchbar-fg: #000; 165 | --searchbar-shadow-color: #aaa; 166 | --searchresults-header-fg: #5f5f71; 167 | --searchresults-border-color: #5c5c68; 168 | --searchresults-li-bg: #242430; 169 | --search-mark-bg: #a2cff5; 170 | } 171 | 172 | .rust { 173 | --bg: hsl(60, 9%, 87%); 174 | --fg: #262625; 175 | 176 | --sidebar-bg: #3b2e2a; 177 | --sidebar-fg: #c8c9db; 178 | --sidebar-non-existant: #505254; 179 | --sidebar-active: #e69f67; 180 | --sidebar-spacer: #45373a; 181 | 182 | --scrollbar: var(--sidebar-fg); 183 | 184 | --icons: #737480; 185 | --icons-hover: #262625; 186 | 187 | --links: #2b79a2; 188 | 189 | --inline-code-color: #6e6b5e; 190 | 191 | --theme-popup-bg: #e1e1db; 192 | --theme-popup-border: #b38f6b; 193 | --theme-hover: #99908a; 194 | 195 | --quote-bg: hsl(60, 5%, 75%); 196 | --quote-border: hsl(60, 5%, 70%); 197 | 198 | --table-border-color: hsl(60, 9%, 82%); 199 | --table-header-bg: #b3a497; 200 | --table-alternate-bg: hsl(60, 9%, 84%); 201 | 202 | --searchbar-border-color: #aaa; 203 | --searchbar-bg: #fafafa; 204 | --searchbar-fg: #000; 205 | --searchbar-shadow-color: #aaa; 206 | --searchresults-header-fg: #666; 207 | --searchresults-border-color: #888; 208 | --searchresults-li-bg: #dec2a2; 209 | --search-mark-bg: #e69f67; 210 | } 211 | -------------------------------------------------------------------------------- /docs/css/chrome.css: -------------------------------------------------------------------------------- 1 | /* CSS for UI elements (a.k.a. chrome) */ 2 | 3 | @import 'variables.css'; 4 | 5 | ::-webkit-scrollbar { 6 | background: var(--bg); 7 | } 8 | ::-webkit-scrollbar-thumb { 9 | background: var(--scrollbar); 10 | } 11 | 12 | #searchresults a, 13 | .content a:link, 14 | a:visited, 15 | a > .hljs { 16 | color: var(--links); 17 | } 18 | 19 | /* Menu Bar */ 20 | 21 | #menu-bar { 22 | position: -webkit-sticky; 23 | position: sticky; 24 | top: 0; 25 | z-index: 101; 26 | margin: auto calc(0px - var(--page-padding)); 27 | } 28 | #menu-bar > #menu-bar-sticky-container { 29 | display: flex; 30 | flex-wrap: wrap; 31 | background-color: var(--bg); 32 | border-bottom-color: var(--bg); 33 | border-bottom-width: 1px; 34 | border-bottom-style: solid; 35 | } 36 | .js #menu-bar > #menu-bar-sticky-container { 37 | transition: transform 0.3s; 38 | } 39 | #menu-bar.bordered > #menu-bar-sticky-container { 40 | border-bottom-color: var(--table-border-color); 41 | } 42 | #menu-bar i, #menu-bar .icon-button { 43 | position: relative; 44 | padding: 0 8px; 45 | z-index: 10; 46 | line-height: 50px; 47 | cursor: pointer; 48 | transition: color 0.5s; 49 | } 50 | @media only screen and (max-width: 420px) { 51 | #menu-bar i, #menu-bar .icon-button { 52 | padding: 0 5px; 53 | } 54 | } 55 | 56 | .icon-button { 57 | border: none; 58 | background: none; 59 | padding: 0; 60 | color: inherit; 61 | } 62 | .icon-button i { 63 | margin: 0; 64 | } 65 | 66 | #print-button { 67 | margin: 0 15px; 68 | } 69 | 70 | html:not(.sidebar-visible) #menu-bar:not(:hover).folded > #menu-bar-sticky-container { 71 | transform: translateY(-60px); 72 | } 73 | 74 | .left-buttons { 75 | display: flex; 76 | margin: 0 5px; 77 | } 78 | .no-js .left-buttons { 79 | display: none; 80 | } 81 | 82 | .menu-title { 83 | display: inline-block; 84 | font-weight: 200; 85 | font-size: 20px; 86 | line-height: 50px; 87 | text-align: center; 88 | margin: 0; 89 | flex: 1; 90 | white-space: nowrap; 91 | overflow: hidden; 92 | text-overflow: ellipsis; 93 | } 94 | .js .menu-title { 95 | cursor: pointer; 96 | } 97 | 98 | .menu-bar, 99 | .menu-bar:visited, 100 | .nav-chapters, 101 | .nav-chapters:visited, 102 | .mobile-nav-chapters, 103 | .mobile-nav-chapters:visited, 104 | .menu-bar .icon-button, 105 | .menu-bar a i { 106 | color: var(--icons); 107 | } 108 | 109 | .menu-bar i:hover, 110 | .menu-bar .icon-button:hover, 111 | .nav-chapters:hover, 112 | .mobile-nav-chapters i:hover { 113 | color: var(--icons-hover); 114 | } 115 | 116 | /* Nav Icons */ 117 | 118 | .nav-chapters { 119 | font-size: 2.5em; 120 | text-align: center; 121 | text-decoration: none; 122 | 123 | position: fixed; 124 | top: 50px; /* Height of menu-bar */ 125 | bottom: 0; 126 | margin: 0; 127 | max-width: 150px; 128 | min-width: 90px; 129 | 130 | display: flex; 131 | justify-content: center; 132 | align-content: center; 133 | flex-direction: column; 134 | 135 | transition: color 0.5s; 136 | } 137 | 138 | .nav-chapters:hover { text-decoration: none; } 139 | 140 | .nav-wrapper { 141 | margin-top: 50px; 142 | display: none; 143 | } 144 | 145 | .mobile-nav-chapters { 146 | font-size: 2.5em; 147 | text-align: center; 148 | text-decoration: none; 149 | width: 90px; 150 | border-radius: 5px; 151 | background-color: var(--sidebar-bg); 152 | } 153 | 154 | .previous { 155 | float: left; 156 | } 157 | 158 | .next { 159 | float: right; 160 | right: var(--page-padding); 161 | } 162 | 163 | @media only screen and (max-width: 1080px) { 164 | .nav-wide-wrapper { display: none; } 165 | .nav-wrapper { display: block; } 166 | } 167 | 168 | @media only screen and (max-width: 1380px) { 169 | .sidebar-visible .nav-wide-wrapper { display: none; } 170 | .sidebar-visible .nav-wrapper { display: block; } 171 | } 172 | 173 | /* Inline code */ 174 | 175 | :not(pre) > .hljs { 176 | display: inline-block; 177 | vertical-align: middle; 178 | padding: 0.1em 0.3em; 179 | border-radius: 3px; 180 | color: var(--inline-code-color); 181 | } 182 | 183 | a:hover > .hljs { 184 | text-decoration: underline; 185 | } 186 | 187 | pre { 188 | position: relative; 189 | } 190 | pre > .buttons { 191 | position: absolute; 192 | z-index: 100; 193 | right: 5px; 194 | top: 5px; 195 | 196 | color: var(--sidebar-fg); 197 | cursor: pointer; 198 | } 199 | pre > .buttons :hover { 200 | color: var(--sidebar-active); 201 | } 202 | pre > .buttons i { 203 | margin-left: 8px; 204 | } 205 | pre > .buttons button { 206 | color: inherit; 207 | background: transparent; 208 | border: none; 209 | cursor: inherit; 210 | } 211 | pre > .result { 212 | margin-top: 10px; 213 | } 214 | 215 | /* Search */ 216 | 217 | #searchresults a { 218 | text-decoration: none; 219 | } 220 | 221 | mark { 222 | border-radius: 2px; 223 | padding: 0 3px 1px 3px; 224 | margin: 0 -3px -1px -3px; 225 | background-color: var(--search-mark-bg); 226 | transition: background-color 300ms linear; 227 | cursor: pointer; 228 | } 229 | 230 | mark.fade-out { 231 | background-color: rgba(0,0,0,0) !important; 232 | cursor: auto; 233 | } 234 | 235 | .searchbar-outer { 236 | margin-left: auto; 237 | margin-right: auto; 238 | max-width: var(--content-max-width); 239 | } 240 | 241 | #searchbar { 242 | width: 100%; 243 | margin: 5px auto 0px auto; 244 | padding: 10px 16px; 245 | transition: box-shadow 300ms ease-in-out; 246 | border: 1px solid var(--searchbar-border-color); 247 | border-radius: 3px; 248 | background-color: var(--searchbar-bg); 249 | color: var(--searchbar-fg); 250 | } 251 | #searchbar:focus, 252 | #searchbar.active { 253 | box-shadow: 0 0 3px var(--searchbar-shadow-color); 254 | } 255 | 256 | .searchresults-header { 257 | font-weight: bold; 258 | font-size: 1em; 259 | padding: 18px 0 0 5px; 260 | color: var(--searchresults-header-fg); 261 | } 262 | 263 | .searchresults-outer { 264 | margin-left: auto; 265 | margin-right: auto; 266 | max-width: var(--content-max-width); 267 | border-bottom: 1px dashed var(--searchresults-border-color); 268 | } 269 | 270 | ul#searchresults { 271 | list-style: none; 272 | padding-left: 20px; 273 | } 274 | ul#searchresults li { 275 | margin: 10px 0px; 276 | padding: 2px; 277 | border-radius: 2px; 278 | } 279 | ul#searchresults li.focus { 280 | background-color: var(--searchresults-li-bg); 281 | } 282 | ul#searchresults span.teaser { 283 | display: block; 284 | clear: both; 285 | margin: 5px 0 0 20px; 286 | font-size: 0.8em; 287 | } 288 | ul#searchresults span.teaser em { 289 | font-weight: bold; 290 | font-style: normal; 291 | } 292 | 293 | /* Sidebar */ 294 | 295 | .sidebar { 296 | position: fixed; 297 | left: 0; 298 | top: 0; 299 | bottom: 0; 300 | width: var(--sidebar-width); 301 | overflow-y: auto; 302 | padding: 10px 10px; 303 | font-size: 0.875em; 304 | box-sizing: border-box; 305 | -webkit-overflow-scrolling: touch; 306 | overscroll-behavior-y: contain; 307 | background-color: var(--sidebar-bg); 308 | color: var(--sidebar-fg); 309 | } 310 | .js .sidebar { 311 | transition: transform 0.3s; /* Animation: slide away */ 312 | } 313 | .sidebar code { 314 | line-height: 2em; 315 | } 316 | .sidebar-hidden .sidebar { 317 | transform: translateX(calc(0px - var(--sidebar-width))); 318 | } 319 | .sidebar::-webkit-scrollbar { 320 | background: var(--sidebar-bg); 321 | } 322 | .sidebar::-webkit-scrollbar-thumb { 323 | background: var(--scrollbar); 324 | } 325 | 326 | .sidebar-visible .page-wrapper { 327 | transform: translateX(var(--sidebar-width)); 328 | } 329 | @media only screen and (min-width: 620px) { 330 | .sidebar-visible .page-wrapper { 331 | transform: none; 332 | margin-left: var(--sidebar-width); 333 | } 334 | } 335 | 336 | .chapter { 337 | list-style: none outside none; 338 | padding-left: 0; 339 | line-height: 2.2em; 340 | } 341 | .chapter li { 342 | color: var(--sidebar-non-existant); 343 | } 344 | .chapter li a { 345 | color: var(--sidebar-fg); 346 | display: block; 347 | padding: 0; 348 | text-decoration: none; 349 | } 350 | .chapter li a:hover { text-decoration: none } 351 | .chapter li .active, 352 | a:hover { 353 | /* Animate color change */ 354 | color: var(--sidebar-active); 355 | } 356 | 357 | .spacer { 358 | width: 100%; 359 | height: 3px; 360 | margin: 5px 0px; 361 | } 362 | .chapter .spacer { 363 | background-color: var(--sidebar-spacer); 364 | } 365 | 366 | @media (-moz-touch-enabled: 1), (pointer: coarse) { 367 | .chapter li a { padding: 5px 0; } 368 | .spacer { margin: 10px 0; } 369 | } 370 | 371 | .section { 372 | list-style: none outside none; 373 | padding-left: 20px; 374 | line-height: 1.9em; 375 | } 376 | 377 | /* Theme Menu Popup */ 378 | 379 | .theme-popup { 380 | position: absolute; 381 | left: 10px; 382 | top: 50px; 383 | z-index: 1000; 384 | border-radius: 4px; 385 | font-size: 0.7em; 386 | color: var(--fg); 387 | background: var(--theme-popup-bg); 388 | border: 1px solid var(--theme-popup-border); 389 | margin: 0; 390 | padding: 0; 391 | list-style: none; 392 | display: none; 393 | } 394 | .theme-popup .default { 395 | color: var(--icons); 396 | } 397 | .theme-popup .theme { 398 | width: 100%; 399 | border: 0; 400 | margin: 0; 401 | padding: 2px 10px; 402 | line-height: 25px; 403 | white-space: nowrap; 404 | text-align: left; 405 | cursor: pointer; 406 | color: inherit; 407 | background: inherit; 408 | font-size: inherit; 409 | } 410 | .theme-popup .theme:hover { 411 | background-color: var(--theme-hover); 412 | } 413 | .theme-popup .theme:hover:first-child, 414 | .theme-popup .theme:hover:last-child { 415 | border-top-left-radius: inherit; 416 | border-top-right-radius: inherit; 417 | } 418 | -------------------------------------------------------------------------------- /docs/clipboard.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * clipboard.js v1.6.1 3 | * https://zenorocha.github.io/clipboard.js 4 | * 5 | * Licensed MIT © Zeno Rocha 6 | */ 7 | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Clipboard=e()}}(function(){var e,t,n;return function e(t,n,o){function i(a,c){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!c&&l)return l(a,!0);if(r)return r(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var s=n[a]={exports:{}};t[a][0].call(s.exports,function(e){var n=t[a][1][e];return i(n?n:e)},s,s.exports,e,t,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function e(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function e(){var t=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=document.body.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px";var o=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=o+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,document.body.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function e(){this.fakeHandler&&(document.body.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function e(){this.selectedText=(0,i.default)(this.target),this.copyText()}},{key:"copyText",value:function e(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function e(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function e(){this.target&&this.target.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function e(){this.removeFake()}},{key:"action",set:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function e(){return this._action}},{key:"target",set:function e(t){if(void 0!==t){if(!t||"object"!==("undefined"==typeof t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function e(){return this._target}}]),e}();e.exports=c})},{select:5}],8:[function(t,n,o){!function(i,r){if("function"==typeof e&&e.amd)e(["module","./clipboard-action","tiny-emitter","good-listener"],r);else if("undefined"!=typeof o)r(n,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var a={exports:{}};r(a,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=a.exports}}(this,function(e,t,n,o){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}var u=i(t),s=i(n),f=i(o),d=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText}},{key:"listenClick",value:function e(t){var n=this;this.listener=(0,f.default)(t,"click",function(e){return n.onClick(e)})}},{key:"onClick",value:function e(t){var n=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new u.default({action:this.action(n),target:this.target(n),text:this.text(n),trigger:n,emitter:this})}},{key:"defaultAction",value:function e(t){return l("action",t)}},{key:"defaultTarget",value:function e(t){var n=l("target",t);if(n)return document.querySelector(n)}},{key:"defaultText",value:function e(t){return l("text",t)}},{key:"destroy",value:function e(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],n="string"==typeof t?[t]:t,o=!!document.queryCommandSupported;return n.forEach(function(e){o=o&&!!document.queryCommandSupported(e)}),o}}]),t}(s.default);e.exports=h})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}); -------------------------------------------------------------------------------- /docs/modules.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Modules [WIP] - NixOS4Noobs 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 52 | 53 | 54 | 61 | 62 | 63 | 73 | 74 | 77 | 78 |
79 | 80 |
81 | 82 | 114 | 115 | 116 | 126 | 127 | 128 | 129 | 136 | 137 |
138 |
139 |

Modules

140 | 141 |
142 | 143 | 159 |
160 |
161 | 162 | 175 | 176 |
177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | -------------------------------------------------------------------------------- /docs/nixshell.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Nix Shell [WIP] - NixOS4Noobs 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 52 | 53 | 54 | 61 | 62 | 63 | 73 | 74 | 77 | 78 |
79 | 80 |
81 | 82 | 114 | 115 | 116 | 126 | 127 | 128 | 129 | 136 | 137 |
138 |
139 |

Nix Shell

140 | 141 |
142 | 143 | 159 |
160 |
161 | 162 | 175 | 176 |
177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | -------------------------------------------------------------------------------- /docs/packages.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Managing Nix Packages - NixOS4Noobs 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 52 | 53 | 54 | 61 | 62 | 63 | 73 | 74 | 77 | 78 |
79 | 80 |
81 | 82 | 114 | 115 | 116 | 126 | 127 | 128 | 129 | 136 | 137 |
138 |
139 |

Managing Nix Packages

140 | 141 |
142 | 143 | 159 |
160 |
161 | 162 | 175 | 176 |
177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | -------------------------------------------------------------------------------- /docs/buildingpackages.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Building packages [WIP] - NixOS4Noobs 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 52 | 53 | 54 | 61 | 62 | 63 | 73 | 74 | 77 | 78 |
79 | 80 |
81 | 82 | 114 | 115 | 116 | 126 | 127 | 128 | 129 | 136 | 137 |
138 |
139 |

Building packages

140 | 141 |
142 | 143 | 159 |
160 |
161 | 162 | 175 | 176 |
177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | -------------------------------------------------------------------------------- /docs/derivations.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Making Nix packages [WIP] - NixOS4Noobs 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 52 | 53 | 54 | 61 | 62 | 63 | 73 | 74 | 77 | 78 |
79 | 80 |
81 | 82 | 114 | 115 | 116 | 126 | 127 | 128 | 129 | 136 | 137 |
138 |
139 |

Making Nix packages

140 | 141 |
142 | 143 | 159 |
160 |
161 | 162 | 175 | 176 |
177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | -------------------------------------------------------------------------------- /docs/containerschapter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Sandboxes & Containers [WIP] - NixOS4Noobs 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 52 | 53 | 54 | 61 | 62 | 63 | 73 | 74 | 77 | 78 |
79 | 80 |
81 | 82 | 114 | 115 | 116 | 126 | 127 | 128 | 129 | 136 | 137 |
138 |
139 |

Sandboxes & Containers

140 | 141 |
142 | 143 | 159 |
160 |
161 | 162 | 175 | 176 |
177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | -------------------------------------------------------------------------------- /docs/containers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Containers [WIP] - NixOS4Noobs 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 52 | 53 | 54 | 61 | 62 | 63 | 73 | 74 | 77 | 78 |
79 | 80 |
81 | 82 | 114 | 115 | 116 | 126 | 127 | 128 | 129 | 136 | 137 |
138 |
139 |

Containers

140 |

Coming soon:

141 |
    142 |
  • Creating declarative contains with NixOS
  • 143 |
  • Accessing them
  • 144 |
  • Using them via SSH (and X11 openssh forwarding)
  • 145 |
  • Networking?
  • 146 |
147 | 148 |
149 | 150 | 166 |
167 |
168 | 169 | 182 | 183 |
184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | -------------------------------------------------------------------------------- /docs/overriding.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Overriding attributes [WIP] - NixOS4Noobs 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 52 | 53 | 54 | 61 | 62 | 63 | 73 | 74 | 77 | 78 |
79 | 80 |
81 | 82 | 114 | 115 | 116 | 126 | 127 | 128 | 129 | 136 | 137 |
138 |
139 |

Overriding attributes

140 |

Coming soon:

141 |
    142 |
  • How to override attributes using nixpkgs.config.packageOverrides
  • 143 |
  • Using overrideAttrs (and probably mentioning that the variable name old can literally be anything -.-)
  • 144 |
145 | 146 |
147 | 148 | 164 |
165 |
166 | 167 | 180 | 181 |
182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | -------------------------------------------------------------------------------- /docs/tipsandtricks.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Tips & Tricks [WIP] - NixOS4Noobs 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 52 | 53 | 54 | 61 | 62 | 63 | 73 | 74 | 77 | 78 |
79 | 80 |
81 | 82 | 114 | 115 | 116 | 126 | 127 | 128 | 129 | 136 | 137 |
138 |
139 |

Tips & Tricks

140 |

Coming soon:

141 |
    142 |
  • Creating bash scripts using Nix (writeShellScriptBin)
  • 143 |
  • Writing to /etc and using environment linking to handle .config files (And why I prefer this to home manager)
  • 144 |
  • System-wide program synced configurations (e.g. a system-wide color scheme that is controlled using a simple Nix file)
  • 145 |
146 | 147 |
148 | 149 | 165 |
166 |
167 | 168 | 181 | 182 |
183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | -------------------------------------------------------------------------------- /docs/overlays.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Overlays [WIP] - NixOS4Noobs 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 52 | 53 | 54 | 61 | 62 | 63 | 73 | 74 | 77 | 78 |
79 | 80 |
81 | 82 | 114 | 115 | 116 | 126 | 127 | 128 | 129 | 136 | 137 |
138 |
139 |

Overlays

140 |

Coming soon:

141 |
    142 |
  • Explaining how self: super: { /* Code here */ } works
  • 143 |
  • Using super.callPackage
  • 144 |
  • Using a default.nix file as an overlay for a folder
  • 145 |
  • Probably worth mentioning the difference between super.callPackage blah {}; and import blah; and how callPackage works. (Probably including an example of import blah with pkgs; {blah1, blah2, blah3, blah...} and why super.callPackage blah {} is so much better).
  • 146 |
147 | 148 |
149 | 150 | 166 |
167 |
168 | 169 | 182 | 183 |
184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | -------------------------------------------------------------------------------- /docs/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | About - NixOS4Noobs 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 52 | 53 | 54 | 61 | 62 | 63 | 73 | 74 | 77 | 78 |
79 | 80 |
81 | 82 | 114 | 115 | 116 | 126 | 127 | 128 | 129 | 136 | 137 |
138 |
139 |

About

140 |

About the author

141 |

I'm just a NixOS user that is tired of seeing people struggle to figure out NixOS on the NixOS subreddit.

142 |

Suggestions or fixes

143 |

To suggest new content or topics that you deem suitable for NixOS4Noobs to cover, please feel free to make a pull request or open an issue

144 | 145 |
146 | 147 | 163 |
164 |
165 | 166 | 179 | 180 |
181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | --------------------------------------------------------------------------------