ZaneyOS 2.1 Documentation
Table of Contents
β¬οΈ How To Install & Update #
π Script: #
This is the easiest and recommended way of starting out. The script is not meant to allow you to change every option that you can in the flake or help you install extra packages. It is simply here so you can get my configuration installed with as little chances of breakages and then fiddle to your hearts content!
The install script also functions as a method of updating ZaneyOS. The same command below can be used to backup the current flake to ~/.config/zaneyos-backups and install the current upstream one.
Simply copy this and run it:
nix-shell -p git curl
sh <(curl -L https://gitlab.com/Zaney/zaneyos/-/raw/main/install-zaneyos.sh)
π€ How Does It Work? #
When you run the rebuild switch command with the flake argument and give it the ZaneyOS folder, it sources the flake.nix that sources the config.nix in your specific hosts folder.
Which the config.nix file is going to pull in the users.nix and home.nix to set different configuration settings. The hardware.nix is automatically generated with all the things you need and the config.nix imports it.
All of your configuration files are in the hosts/
Having the configuration files as a .nix file allows me to use the Nix language to generate the actual desired config file. This allows me to use Nix Colors, a phenomenal tool in NixOS, to define a base16 colorscheme and let the user change the theme and have all the programs change upon rebuild. Even GTK applications change too!
π° What Is NixOS & Why Choose It? #
NixOS is a Linux distribution known for its unique approach to package management and system configuration. It uses the Nix package manager, which is based on a purely functional approach to managing software and system configurations.
In NixOS, the entire operating system configuration is described declaratively in a configuration file, allowing for reproducibility and easy rollbacks. This means that changes to the system can be tracked and reversed, making it robust and reliable for system administrators and developers.
From Keir Williams: βAt the core of NixOS is a configuration file, written in the Nix language. This Nix expression is used to specify packages, users, groups, services, networking, and a whole set of other things typically configured on a Linux system.
Due to the nature of the Nix language, the system is configured completely declaratively. You specify what you want to achieve on your system, instead of specifying the step-by-step commands required to accomplish it. Using NixOSβs built-in configuration options, you can specify how you want the system to look in a manner that is logical to you. How things are built is calculated by Nix itself.β
Inside of NixOS those of you who are used to Linux distributions such as Arch where there is an extra repository with almost any package you may need, will be surprised. Nixpkgs has over 80,000 packages in its repositories with many of the packages you might otherwise need something like the AUR for.
Choosing NixOS often depends on specific needs and preferences. Here are some reasons why people opt for NixOS:
ποΈ Declarative Configuration #
NixOS employs a declarative approach to system configuration. This means the entire system configuration is defined in a single file or files, making it reproducible and easier to manage. Changes are tracked and can be rolled back if needed.
π¦ Functional Package Management #
The Nix package manager ensures that each package and its dependencies are isolated and managed separately. This prevents conflicts between different versions of software and enables easy rollbacks to previous versions.
ποΈ Reproducibility #
NixOS allows for consistent and reproducible environments, critical in development, testing, and deployment scenarios. It’s particularly valuable in DevOps and CI/CD pipelines where consistent environments are essential.
π― Multiple Environments and Rollbacks #
With NixOS, it’s possible to have multiple versions of the same software installed simultaneously without conflicts. This flexibility is especially useful for developers or those requiring different versions of software for various projects.
π« Community and Customization #
NixOS has an active community that contributes to its growth, sharing configurations, and offering support. Its customizable nature allows users to tailor their systems to their needs.
π What Is Home Manager? #
I think I did a good job of explaining that here on my YouTube channel:
π How To Use ZaneyOS #
I have some very useful aliases that are available to you after switching to the flake.
π Update The Flakes Inputs & Packages #
- flake-update
This runs a nix flake update
on the flake directory. You probably shouldn’t run this. This updates all packages and the lock file in the ZaneyOS flake. Only do this if you need to and know you need to, running this command opens you up to breaking changes.
- flake-rebuild
Runs a rebuild switch --flake
on the flake directory. Used for updating the system after you have made changes to some of the files.
- gcCleanup
This removes all other generations other than the current. Great for cleaning up the system if you have been rebuilding and making changes a lot recently.
π¦ Adding & Installing Extra Packages #
You can find the place to put packages to be installed for your user specifically at hosts/insert-hostname/users.nix and for the system packages it’s the hosts/insert-hostname/config.nix file.
Visit the NixOS Packages page to search for the application you want. It is a good idea to check the NixOS Options at the top of that page as well for the package your searching for.
If the package you are installing needs extra configuration there is a decent chance there is a way of installing it, (enable = true;), through NixOS options or Home Manager.
π€― Variables & Theming #
In your host specific folder you will find the variables.nix file. This is where you can set variables that are used other places in the configuration. The link to finding the themes available is below.
option | description |
---|---|
gitUsername | Set username for Git, similar to *git config –global user.name “insert-username-here”. |
gitEmail | The email you use for your Git account. |
theme | A base16 colorscheme to use with NixColors |
borderAnim | Enables or disables the looped animated borders. This is distracting to some. |
extraMonitorSettings | Add “monitor=” hyprland lines to hyprland config for host specific monitor settings. |
clock24h | Enable the time for different utilities to be presented in 24 hour format. |
waybarAnimations | Determines whether or not the elements on waybar may be animated. |
browser | The name of the browser do you want installed and used by default. The package name too, for ones like google-chrome where the binary is google-chrome-stable this is solved for you. So it would just be google-chrome. |
terminal | Name of the binary for your terminal of choice. Example: “kitty” or “alacritty”. |
π File Structure Explained #
The way the files are structured is quite simple. The repository top level has the Gitlab specific files as well as the flake.nix and flake.lock files that are responsible for managing the flake. Then we have the modules folder which contains modules that allow me to give you simple drivers.amd.enable = true;
option that sets many other config settings, this helps keep the config.nix from looking like an absolute beast.
The hosts folder has separate hosts configurations with the folder containing the files named by the hostname of that system. These could be put in home.nix and are being imported by it. However, these being in that file would make it significantly larger.
Below you’ll see the file structure:
βββ config
β βββ emoji
β βββ hyprland.nix
β βββ waybar.nix
β βββ base16-themes
β βββ starship.toml
β βββ ...
βββ modules
β βββ amd-drivers.nix
β βββ intel-drivers.nix
β βββ local-hardware-clock.nix
β βββ vm-guest-services.nix
β βββ ...
βββ scripts
β βββ emopicker9000.nix
β βββ wallsetter.nix
β βββ ...
βββ pkgs
β βββ sddm-sugar-dark.nix
β βββ ...
βββ flake.nix
βββ flake.lock
βββ hosts
β βββ default
β βββ config.nix
β βββ hardware.nix
β βββ home.nix
β βββ users.nix
β βββ variables.nix
βββ README.md
βββ ...
π Virtualization #
The smartd service will need to be disabled inside of a virtual machine.
Please remember to enable the vm-guest-services when running inside a virtual machine.
This will ensure you have the best experience possible.
π Wofi Selecting What Was Typed #
When searching for something using wofi the search bar is selected at the start when you have typed something. So make sure to use the arrow keys to actually select the first option that is highlighted if thats what you are looking for.
π Google Chrome #
The package name and binary name for Chrome is different. This could be true of other browsers or terminals. So make sure to pay attention to the NixOS Package Search as it will tell you both. Put the package name in the config.nix and the binary name in the variables.nix file.
Thank you for taking the time to read the documentation and for all of those of you who have contributed to making this and the project better I cannot thank you enough.