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
'';
Snowflake
git clone --depth 1 https://github.com/Icy-Thought/Snowflake.git
hosts/deviceX
Directorycd 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.
hardware.nix
with hardware-configuration.nix
Suggestion: before replacing hardware.nix
with your hardware-configuration.nix
:
.nix
fileOTHERWISE, 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:
https://github.com/Icy-Thought/snowflake/blob/f576ca018a7dd97e0f9d887835e2559e1e5cc02c/modules/options.nix#L26-L29
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.
[!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 in default.nix
.(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
(orpartuuid
) with/dev/disk/by-label/X
, whereX
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!
~/home
related configurations.