For my 1 year linux challenge i decided todo it over NixOS. What is NixOS? Well lets just pull that from nixos themselves.
That sounds good and all but what does it mean? It means that your entire system is defined in a config file. This includes everything from users, desktop managers, file systems, etc. You just define how you want your system and it does it.
Example Config
{ config, pkgs, ... }
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "firewire_ohci" "xhci_pci" "usb_storage" "usbhid" "sd_mod" "sr_mod" "sdhci_pci" ];
nix.maxJobs = lib.mkDefault 8;
fileSystems."/" =
{ device = "/dev/disk/by-uuid/707667f2-d30e-4d11-b692-bbd3a98ce3ab";
fsType = "ext4";
};
boot.loader.grub = {
enable = true;
version = 2;
device = "/dev/sdb";
};
networking = {
hostName = "Nixos-Zeta";
networkmanager.enable = true;
};
time.timeZone = "America/Chicago";
sound.enable = true;
hardware.pulseaudio.enable = true;
environment.systemPackages = with pkgs; [
exa chromium python3 git gnumake gnome3.gnome-screenshot gcc unrar
];
services = {
xserver = {
enable = true;
layout = "us";
libinput.enable = true;
windowManager = {
default = "i3";
i3.enable = true;
i3.extraPackages = with pkgs; [
lm_sensors
rofi
i3lock
i3blocks
];
};
displayManager = {
gdm.enable = true;
};
};
};
users.groups.foo.gid = 1337;
users.users.dje4321 = {
isNormalUser = true;
uid = 1337;
home = "/home/foo";
description = "Test User";
extraGroups = [ "wheel" "networkmanager" "foo" "video" "leds" ];
};
system.nixos.stateVersion = "18.09";
Above is a example config for a system. You can see how every aspect of the system can be controlled. This can get rather complex but will give you almost absolute control on how the system is defined. Some of the things you can do is setup sshd in your initrd incase your remote machine wont boot into the main os. Another thing you can do is just run a command once your initrd has finished mounting drives.
Nixos has 2 major pros that makes it stand out above the rest. Its atomic so parts of the system can just be added and removed without leaving much of a trace and it has reproducible builds. These two combined allows you to just keep a configuration and modify it at will and know what that your system can always roll back to a previous state.
Nixos manages being atomic by keeping packages in /nix/store. Everything from the kernel, glibc, bash, etc is kept there. packages have a specific name scheming of (HASH)-(NAME)-(VERSION)
so something like binutils would be 4mf2xm9p32lzrim927yk92xhx35yaz62-binutils-2.30
. From there anything that is installed system-wide is linked to /run/current-system. So if we were to look at the ls command, then we could find it at /run/current-system/sw/bin/ls
but that is linked to /nix/store/4mf2xm9p32lzrim927yk92xhx35yaz62-binutils-2.30/bin/ls
There is one huge glaring problem with managing packages this way. That problem is that prebuilt binaries dont work because everything from the interpreter to libraries are not where they are expected. There is no /lib where a program can expect to find the libraries it needs. There are solutions to this but they are imperfect at best. ive been working on my own solution but even that has its own problems.
If you want to know more practical and philosophical knowledge on nixos then i would reccomend looking at both the manual and this amazing talk. I encourage you to try nixos in a VM and see what kind of power it can have when it comes to managing your system