These are my dotfiles, written in Nix using home-manager
. Derived from nix-starter-configs.
My old dotfiles can be found here.
Warning
Stability is not guaranteed for anyone but me, and breaking changes may arrive unannounced.
You may use this as a baseline for your own config, but it would be unwise to use it as a distribution!
Requirements:
dconf
forhome-manager
activation scriptgcr
forpinentry-gnome3
(forgpg-agent
)nix
forhome-manager
Add these lines to your nix.conf
:
experimental-features = nix-command flakes
Optionally, to set up synchronization of the lazy.nvim lockfile to this repo, save this as a script and run it:
#!/usr/bin/env bash
# link rw nvim config into place
ROOT_PATH="$(git rev-parse --show-toplevel)/home-manager/hosts/_common_/programs+services/tui/neovim/config/read-write"
for dir in $(find -L "$ROOT_PATH" -mindepth 1 -maxdepth 1); do
ln -sf "$dir" "$XDG_CONFIG_HOME/nvim/$(basename $dir)"
done
This step is performed automatically by the switch script.
On non-NixOS systems:
wezterm-terminfo
(or elsewezterm
looks weird)
On all systems:
xauth
(must be installed system-wide)xinit
/startx
(I don't use a display manager)
On all systems:
alsa-utils
for volume controllibpulse
for volume controlxsecurelock
for lock screen (must be installed system-wide)
Use the switch script:
# one-time only
chmod +x ./switch.fish
# then print usage information
./switch.fish -h
Or, you can manually build a configuration:
# NOTE: `--impure` is required for `nixGL`. The rest of the configuration does not perform any impure action.
nix run .#home-manager -- build --impure --flake .#<user>@<hostname> --show-trace
…and then switch if you like its output:
# NOTE: `--impure` is required for `nixGL`. The rest of the configuration does not perform any impure action.
nix run .#home-manager -- switch -b pre-home-manager --impure --flake .#<user>@<hostname>
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # or some other link
inputs.dotfiles = {
url = "github:Iron-E/dotfiles";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ { self, nixpkgs, dotfiles }: {
# define outputs
};
}
This repository defines a homeManagerModules
output, which can be used to access the home-manager modules (not the configs!) which are used by these dotfiles.
An implementation of nix-community/nixGL#114 (comment).
Provides the options:
Name | Type | Default | Description |
---|---|---|---|
nixgl.prefix |
str |
"" |
Will be prepended to commands which are wrapped with nixGL. Should be set on non-NixOS systems. |
Provides the outputs:
Name | Type | Description |
---|---|---|
config.lib.nixgl.prefix |
pkg -> pkg |
Can be used to wrap a package with nixGL. See the aforementioned issue comment. |
Example:
{ inputs, outputs, config, lib, pkgs, ... }: {
nixpkgs = { overlays = [inputs.nixgl.overlays.default]; }; # make sure `nixgl` is a flake input
nixgl.prefix = lib.getExe' pkgs.nixgl.auto.nixGLDefault "nixGL";
home.packages = [(config.lib.nixgl.wrap pkgs.wezterm)];
}
The dotfiles provide a hosts
output that is a path to the hosts directory in the nix store. This can be used to import the dotfiles
in a NixOS config and integrate this standalone home-manager config into a home-manager NixOS module config.
The dotfiles provide a lib
output, but:
- you'll have to read the source code (I'm not documenting the lib of my dotfiles, sorry!); and
- heed the warning at the top of this README.
The dotfiles provide an overlays
output.
The overlays.additions
output is additional packages defined in this repository that can be overlayed onto nixpkgs.
overlays.modifications
which are customized existing nix packages.
The nerdfonts
nix package, with only symbols included.