[go: nahoru, domu]

Skip to content

Configuration for NixOS and user home (dot files).

License

Notifications You must be signed in to change notification settings

terlar/nix-config

Repository files navigation

nix-config

Configuration for NixOS and user home (dot files). It is provided via Nix flakes and includes the following components:

lib
library functions to be used with flakes or within Nix.
kebabCaseToCamelCase
convert kebab case to camel case (hello-world -> helloWorld)
listNixFilesRecursiveToAttrs
given a directory list all nix files recursively and create a flat attribute set with a key corresponding to each file path.
modulesFromDir
given a directory create an attribute set for each module and create a default module importing all those modules.
homeConfigurations
user configuration for Home Manager.
homeModules
modules that can be used together with Home Manager.
nixosConfigurations
host configurations for NixOS.
nixosModules
modules that can be used together with NixOS.
overlays
custom overlays.
default
package overlay including a subset of packages.
fromInputs
composed overlay from all input overlays.
packages
packages not in the default nixpkgs.
drduh-gpg-conf
GPG config per drduh recommendation.
drduh-yubikey-guide
The drduh YubiKey guide readable via the terminal.
yubikeyInstallerImage
YubiKey Installer ISO.

Usage

Show what is provided:

nix flake show

Switch both system (NixOS) and home:

nix run nixpkgs#nixos-rebuild -- switch --flake .

Switch home only:

nix run home-manager -- switch --flake .

Update all inputs:

nix flake update

Update a single input:

nix flake lock --update-input nixpkgs

Development

Use a local input during development:

nix flake lock --override-input nixpkgs path:../nixpkgs

Non-NixOS

Default shell

If you use a custom shell, you need to manually set the default shell, this is done by:

echo $HOME/.nix-profile/bin/fish | sudo tee -a /etc/shells
chsh -s $HOME/.nix-profile/bin/fish

YubiKey ISO

Used to create a safe environment for YubiKey operations having all the necessary tools.

Build the ISO:

nix build -L .#yubikeyInstallerImage

Copy the ISO to a USB-key/storage device:

sudo dd if=result/iso/*.iso of=/dev/sda status=progress
sync

Tasks

Extract some inline stuff into external files

GC helpers?

Home manager config for qutebrowser + dicts

Look into if more PA config is needed:

Script to regenerate hardware-config for current host

Make YubiKey steps into an flake app