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:

apps
commands to run to utilize the flake or for development.
home-switch
run the home-manager switch command for this flake.
nixos-switch
run the nixos-rebuild switch command for this flake.
use-caches
add caches to project nix.conf. Only needed when modifying the caches.
install-qutebrowser-dicts
install dictionaries to be used within qutebrowser.
backup
backup fish history and GnuPG sshcontrol.
devShells
developer shells
default
a shell with tools used for development and required setup for flakes.
lib
library functions to be used with flakes or within Nix.
kebabCaseToCamelCase
convert kebab case to camel case (hello-world -> helloWorld)
importDirToAttrs
given a directory import all files into a set corresponding to each file name.
pkgsForSystem
import the input nixpkgs with overlays provided by this flake for a system.
forAllSystem
create an attrset by all the supported systems and runs a function which receives the packages for that system.
nixosSystem
wrapper around the corresponding function in nixpkgs which integrates packages, overlays, NixOS modules, Home Manager modules from this flake.
nixosSystemFor
helper function to build configuration for target host, this can be an input for another flake where you can extend the host configuration (e.g. I use it for my private configuration additions).
homeManagerConfiguration
wrapper around the corresponding function in Home Manager that adds modules from this flake and enables generic Linux support in case it is a Linux machine (assuming NixOS users would use the NixOS intergarion instead.)
homeConfigurations
user configuration for Home Manager.
homeManagerModules
modules that can be used together with Home Manager.
custom-defaultBrowser
configure a default browser.
custom-keybindings
enable vi/emacs keybindings across the system.
profiles-development
development profile module.
profiles-gnome
configure gnome (e.g. disable gnome-keyring-ssh).
profiles-highContrast
enable high contrast where possible.
programs-editorconfig
configure editorconfig.
programs-gnomeShell
gnome-shell configuration module.
programs-ripgrep
configure ripgrep.
targets-genericLinux
fixes for generic Linux module.
nixosConfigurations
host configurations for NixOS.
nixosModules
modules that can be used together with NixOS.
custom-dictionaries
configure dictionaries (both aspell and hunspell) via one setting.
custom-i18n
configure internationalization.
custom-keyboard
configure keyboard for console, kmscon and xserver via one setting.
custom-shell
configure shell environment.
overlays
custom overlays.
default
package overlay including the mentioned packages.
iosevka
iosevka configured with the slab set.
packages
packages not in the default nixpkgs.

Usage

Show what is provided:

nix flake show

Switch both system (NixOS) and home:

nix run .#nixos-switch

Switch home only:

nix run .#home-switch

Update all inputs:

nix flake update --commit-lock-file

Update a single input:

nix flake lock --update-input nixpkgs --commit-lock-file

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 .#nixosConfigurations.yubikey-installer.config.system.build.isoImage

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:

Nest/group modules

Script to regenerate hardware-config for current host

About

Configuration for NixOS and user home (dot files).

Resources

License

Stars

Watchers

Forks

Packages

No packages published