- Desktop Preview
- Introduction
- Getting Started
- Nix-Flake: Beginning of a Journey
- (Optional) Doom Emacs
- Congratulations! π
- Useful Links
- Special Thanks
A hamerspace containing a declarative NixOS environment consisting of many
hand-crafted configurations, ranging from: Kitty, Alacritty, Doom-Emacs, Zathura
to many other applications which can be found in the ./home
directory.
Warning
This repository, similar to other dotfile/configuration repositories, is subjected to change. The reader ought to read through the commit history before blindly cloning, fetching or updating the necessary files required to power up their NixOS environment!
In this README I will attempt to explain how to replicate my NixOS setup or achieve similar feats. If you find this guide not as useful as it was designed to be, do submit an issue requesting a change for the specific sections you found to be confusing. Or submit a push request (PR) to this repository and hopefully we can produce better results together!
Throughout my Nix journey, I've came across two interesting projects and among those projects are Nix-Flakes and Home-Manager. (Both projects will be introduced later in this README.) These projects have been setup in such manner that allows its users to carefully tune their system environments to their liking!
Note
This project is still in its early stages! Henceforth one should familiarize themselves with the Risks that comes with the usage of such experimental features.
As of 22.05
the NixOS ISO comes equipped with a well-developed installer that
reduces the "complexity" of installing NixOS on your device! Therefore manual
intervention should not be required for a minimal installation.
Don't forget to append the following lines of code to your /etc/nixos/configuration.nix
:
nix.package = pkgs.nixUnstable;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
git clone --depth 1 https://github.com/Icy-Thought/Snowflake.git
cd snowflake && cp -r templates/hosts/desktop hosts/deviceX
where deviceX
is the name you'd like to give to your host device. This name will later be used when installing/updating your new NixOS setup.
Suggestion: before replacing hardware.nix
with your hardware-configuration.nix
:
- view the file and see what you'd like to retain
- rename the file (backup)
- add your Nix generated hardware configuration
.nix
file - paste your desired configurations in your new file
OTHERWISE, proceed by executing the command below.
cp /etc/nixos/hardware-configuration.nix deviceX/hardware.nix
Warning
As of now, my snowflake directory is expected to be placed inside
~/Workspace/public/snowflake/
. And for your configuration to work properly you are
expected to place the directory in that exact location!
Modify snowflake.dir
to point to the location where you are keeping the
snowflake repository:
Lines 26 to 29 in f576ca0
For the sake of making things quicker (not the wisest choice), I have added both Intel and AMD CPU settings in the hardware.nix
template. Therefore you ought to remove the one not being used.
There might be other configurations that you need to add to your hardware.nix
file, therefore it is the wisest choice to always look (grep hardware.
) in the NixOS Manual.
snowflake/templates/hosts/desktop/hardware.nix
Lines 46 to 47 in d93a907
Note
By default, Nautilus & Dolphin does not hide system partitions from mounted devices category.
I have chosen to hide those partitions from the mounted devices category of the
mentioned file managers. I have also added several kernel parameters and other
device-specific configurations for my setup in this repository. (check
hosts/deviceX
)
What you are required to edit is:
fileSystems
entries indefault.nix
.- The specific parts which you wish to exclude from your setup, such as: kernel parameters, modules to disable, packages to be installed among other configurations.
(Example): hiding /boot
from Nautilus mounted devices.
fileSystems."/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
options = [ "x-gvfs-hide" ]; # For hiding boot partition entry in Nautilus.
};
Warning
Make sure to replace /dev/disk/by-uuid/xyz
(or partuuid
) with /dev/disk/by-label/X
, where X
follows the label you have chosen to name your partitions with during your partition setup.
Note
Before rebuilding our NixOS system with our new device configurations, we ought to make our flake.nix
aware of our new device directory (deviceX
). Otherwise you'll run into #25!
git add ./hosts/deviceX/*
After completing your setup, there remains one command to be executed (device =
directory name of your device placed inside hosts
, which in this case is deviceX
:
nixos-rebuild switch --use-remote-sudo --flake .#deviceX --impure";
reboot
You have successful installed your/my personally hand-crafted/replicated Nix-Flake environment. I hope it suits your needs, if not then you are always welcome to propose changes or fork the project and customize the repository to your heart's content!
- NixOS Manual: A manual for the newcomer to read and understand different parts of the NixOS distribution.
- Home-Manager: Helps you
manage your
~/home
related configurations. - Nix Pills: A series written to familiarize the user with the Nix programming language.
- Nixpkgs Unstable: A manual which introduces the Nix-language to people unfamiliar with the wonders of this language.
- Nix Flake MVP: A written Nix guide by edolstra.
- A Tour of Nix: a beautifully crafted introduction into the Nix programming language.
- hlissner/dotfiles: nix-flake skeleton!