Collection of system configurations and derivations for packages not found in Nixpkgs, accessible via a Nix flake.
A script to compile a LaTeX project via pdflatex provided by TeX Live.
nix run github:hfxbse/nixos-config#flaketexParameters to the script can be pass after a -- as typical for flakes.
Here is an example which will display the script help.
# everything after the `--` will be passed to the script
nix run github:hfxbse/nixos-config#flaketex -- -hNeovim configuration on all host machines implemented using NixVim. Can be run as a standalone program, no dependency on NixOS, though Nerd Fonts is needed to display icons correctly.
Wrapper around nix flake init to avoid having to type long URLs manually.
.editorconfigfor.nixfiles and enforcing a new line at the end of all files.- GitHub Workflow to check the validity of the flake.
systemhelper function only usingnixpkgs.lib.genAttrs..gitignoreexcluding build output from Nix.
To utilize this template run
nix flake init -t github:hfxbse/nixos-config- Disable secure boot in the BIOS of your computer and set it into setup mode.
- Format the disk from the installer via disko:
sudo nix --experimental-features "nix-command flakes" \ run github:nix-community/disko/latest -- \ --mode destroy,format,mount \ disk-config.nix - Install NixOS from the configuration flake:
sudo nixos-install --flake .⚠️ Secure boot needs to be disabled in the configuration at this point⚠️ - Enter the installation via
nixos-enterand set the password of the normal users. - Boot into the new NixOS installation
- Generate secure boot platform keys and enroll them:
nix run nixpkgs#sbctl -- create-keys nix run nixpkgs#sbctl -- enroll-keys
⚠️ Omitting Microsoft's platform keys might brick your system⚠️ This has not been an issue on a Lenovo ThinkPad X12 gen 1. - Enabled secure boot within the BIOS of your computer.
- Setup automatic unlocking of the LUKS's encryption via TPM:
sudo systemd-cryptenroll --tpm2-device auto --tpm2-pcrs=0+2+7+12 --wipe-slot=tpm2 /dev/X
- Create a file on your local machine at
/tmp/disk.keycontaining the LUKS password. - Populate the
host/<server-name>/setup-keysdirectory with theauthorized_keysfiles. You need this to access the server after the installation as no initial password is set. - Disable secure boot in the server configuration. Secure boot can only be configuration after the initial installation. See the guide for desktop machines and laptops for more information.
- Run nixos-anywhere to
install the NixOS configuration
nix run github:nix-community/nixos-anywhere -- \ --flake .#<server-name> \ --no-substitute-on-destination \ --target-host <user>@<host> \ --disk-encryption-keys /tmp/disk.key /tmp/disk.key \ --extra-files hosts/<server-name>/setup-keys/
Minimal live system to create a bootable ISO from with Nix flakes enabled by default as well as other quality of live improvements for a headless installation.
A parameterized build is possible using the non-flake CLI, for example setting up an authorized key for an SSH connection can be accomplished via
nix-build iso.nix --argstr authorizedKey "$(cat ~/.ssh/id_rsa.pub)"