1
9
Fork
You've already forked cfg
1
my old NixOS setup - deprecated in favor of repo dots https://codeberg.org/kiara/dots
  • Nix 84%
  • Shell 4.4%
  • Python 3.3%
  • Scheme 3.2%
  • JavaScript 2.1%
  • Other 3%
2025年05月21日 08:58:49 +02:00
.git-hooks add pre-commit hook, closes #210 2025年01月17日 21:15:30 +01:00
.vscode project IDE support: vscode/vscodium 2024年04月10日 14:18:29 +02:00
facter dynamically handle hardware configuration, closes #362 2025年01月25日 01:17:41 +01:00
home-manager/kiara un-style vscode, closes #382 2025年04月12日 08:22:17 +02:00
hosts/hammer bitwarden cli 2025年04月07日 10:36:53 +02:00
lib specify access-tokens 2025年02月16日 15:58:19 +01:00
modules format by nixfmt-rfc-style 2024年12月23日 18:11:58 +01:00
overlays set meta.mainProgram on local-ai, workaround for this package for #311 2025年03月12日 22:01:51 +01:00
pkgs swap out anyrun for rmenu, closes #241 , supersedes #239 2025年02月21日 12:51:54 +01:00
screenshots cpu/ram/process monitor: btop/zfxtop/gnome-system-monitor -> bottom 2024年09月22日 10:51:32 +02:00
scripts wallust-templates 2025年02月28日 15:35:49 +01:00
.envrc make lorri optional 2024年11月24日 14:00:11 +01:00
.gitattributes yml -> yaml 2024年09月22日 12:04:33 +02:00
.gitignore annotate gitignore 2025年02月09日 07:50:01 +01:00
.sops.yaml reproduce SSH using shoji(-nix), see #244 2025年01月25日 23:40:34 +01:00
flake.lock update unstable 2025年04月10日 13:28:42 +02:00
flake.nix wallust-templates 2025年02月28日 15:35:49 +01:00
garnix.yaml garnix: add schema 2025年03月10日 21:00:57 +01:00
justfile un-hardcode device, see #320 2025年01月26日 15:21:29 +01:00
LICENSE license: BSD-0 2024年03月31日 14:35:59 +02:00
nixpkgs.nix format by nixfmt-rfc-style 2024年12月23日 18:11:58 +01:00
overlays.nix format by nixfmt-rfc-style 2024年12月23日 18:11:58 +01:00
packages.nix revert 66d61d4cc9 : "mv home-only overlays/packages to packageOverrides, closes #193 " 2025年01月17日 22:46:51 +01:00
README.md soft-archive to direct visitors to new repo (while leaving issue tracker functional) 2025年05月21日 08:58:49 +02:00
secrets.enc.yaml specify access-tokens 2025年02月16日 15:58:19 +01:00
shell.nix trim down shell, closes #454 2025年03月30日 09:27:35 +02:00
treefmt.nix treefmt: nixfmt-rfc-style -> nixfmt 2024年12月23日 18:20:52 +01:00

kiara's nix config

ARCHIVED IN FAVOR OF https://codeberg.org/kiara/dots

Gitea Last Commit GitHub commit activity Gitea Issues

This is my setup for NixOS.

philosophy

  • reproducible
    • NixOS with flakes to lock versions
    • ephemeral root to stay conscious about unreproduced state
  • ergonomics
    • keyboard-first favoring vim-like keybinds
  • intuitiveness
    • scrollable tiling

screenshots

(credit: wallpaper by Alena Aenami.)

JIT-installed neofetch

neofetch

the expanded notification bar SwayNotificationCenter is shown with a notification about a completed rebuild. this menu can be opened using `Super+`` or by right-clicking the 'Windows' button.

file managers

yazi

yazi is a terminal-based file manager with vim-like keybindings. thunar is available as a graphical alternative.

thunar

firefox

firefox

Firefox is used as a web browser, with some basic add-ons.

terminal-based IDE

helix

running ide in the WezTerm terminal opens a terminal-based IDE at that directory, consisting of:

  • Git TUI lazygit, offering a terminal-based way to work with Git repositories, including vim keybindings.
  • helix, featuring language servers for nix (thru nixd) and others
  • a shell, using Nushell and decorated using powerline-go and oh-my-posh

lazygit

As a back-up, the graphical VSCodium is provided (with some plugins).

JIT application menu

jit menu

A menu to JIT-install and run applications can be opened using Super+Shift+Space.

audio volume

volume control

Right-clicking the volume icon in the bar opens Pulse Audio Volume Control.

wifi

nmtui

Pressing Super+i or right-clicking the wifi icon opens the Network Manager TUI.

show dependency age

just age

command just age showing the age of any dependencies included in flake.lock

emoji picker

emoji picker

pressing the Microsoft keyboard's emoji key](https://support.microsoft.com/en-us/topic/use-microsoft-ergonomic-keyboard-c917dad0-3797-d97b-efb3-fbe27ac9703c#ID0EDFBBDDD) (Super-Ctrl-Alt-Shift-Space) triggers an emoji picker using fuzzy picker fzf.

file picker

file picker

pressing CTRL-T in the shell opens fzf's file picker, copying the selected file or directory path to the clipboard.

devices

This configuration was made with the following devices in mind:

Name Use Model Config
hammer home laptop Lenovo IdeaPad Slim 5 16ABR8 nixosConfigurations
orca work laptop Dell XPS 13 9340 homeConfigurations

usage

prerequisites

installation

clean install from NixOS USB
cd ~/Downloads
git clone https://codeberg.org/kiara/cfg.git
cd cfg
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko -f .#hammer
dest=/mnt/persist/home/kiara/.config/sops/age/
sudo mkdir -p $dest
sudo cp -r ./. $dest
sudo cp ~/Downloads/keys.txt $dest # import/create
sudo nixos-install --no-root-passwd --flake ".#hammer" --no-root-passwd
sudo nixos-enter --root /mnt
cp /etc/{machine-id,group,passwd,shadow} /persist/etc
install from existing NixOS system
$ sudo nixos-rebuild switch --fast --flake .#hammer

commands

$ just -l
Available recipes:
 age # Check when inputs were last updated
 boot # Build a new configuration
 clean # Remove all generations older than 7 days
 decode # Decode secrets
 default # default action: list actions
 dry # Dry-build a new configuration
 encode # Encode secrets
 ephemeral dir="$HOME" # Show what has yet to be persisted in a folder. Usage: just ephemeral $HOME | $PAGER
 fmt # Format code
 gc # Garbage collect all unused nix store entries
 home # Rebuild the home config
 hooks # Set up Git hooks
 lock # Lock inputs
 patch-desktop-xwayland # Patch persisted wine/steam desktop entries to run xwayland
 repl # Open a Nix REPL - run manually to load flake: `:lf .`
 switch # Rebuild the system
 test # Run tests
 up # Update all inputs
 upp input # Update specific input. Usage: just upp nixpkgs

... or if just isn't available yet:

nix run nixpkgs#just -- -l

impermanence

to ensure you can persist useful state on an ephemeral system, you can find say:

  • newly created (5 mins) files: find ~ -cmin -5 2>/dev/null
  • files now on root: tree -x /
  • diffs from last backup: rsync --dry-run

features

fixes for flake

  • the flake.locked nixpkgs is used for:
    • nix commands
    • 'command not found' errors
  • nix flake show is fixed using Flake Schemas
  • $SHELL is retained in nix shell

used software

Component Software
Nix interpreter Lix
Nix shell Lorri
DM TUIgreet
Compositor Niri 1
Bar Waybar
Notifications Swaynotificationcenter
Menu Rmenu
Web browser Firefox
File browser Yazi
Terminal Wezterm
Text editor VSCodium
Editor (shell) Helix
Shell Nushell
Fuzzy finder Fzf
Pager Bat
Text-to-speech Piper thru LocalAI

style

package types

command drop-ins

command drop-in improvements
cd n/a (can skip it in Zsh)
cd z remembers visited locations
cd cd (enhancd) interactive directory picker using cd, cd . or cd ..
ls eza (aliased to ls) friendlier output and interface
cat bat syntax highlighting
find fd faster, friendlier interface, respects .gitignore
grep rg friendlier interface
make just show comments, friendlier file format
ssh xxh use your favorite shell

keybinds

Used keyboard layouts, with remaps:

  • Caps Lock -> Esc

  • Scroll Lock -> Compose

  • workman-programmer, with application keymaps modified to keep arrow actions h/j/k/l (+ actions 'y'/'n') in their ergonomic qwerty positions (at the cost of moving actions e/o to keys h/l)

  • en-us (qwerty)

Binds reserved for Emacs-like binds:

  • Any layout: Alt-w/n/p/b
    • Workman layout (beside above): Alt-d/f

Application keybinds, tweaked to layout by setting config.keyboard.active:

mouse

bottom bar

module left-click right-click scroll
start button open rmenu application launcher toggle swaync notifications -
workspaces go to selected workspace open wdisplays go to previous/next workspace
media player toggle play/pause skip ahead previous/next
clock - toggle month/year in calendar pop-up previous/next in calendar pop-up
bluetooth bluetuith bluetuith -
volume toggle mute Pulse Audio Volume Control change volume
memory manage processes with Bottom - -
CPU manage processes with Bottom - -
battery run battery viewer powersupply - -
storage garbage-collect nix show big files/folders using dust -
network manage network by networkmanager_dmenu manage network by nmtui -
systray (application-specific) open application context menu -

what goes where

what where
system configuration ./hosts/
home-manager configuration ./home-manager/
binaries and command wrappers ./home-manager/kiara/commands.nix
reusable modules ./modules/
custom functions ./lib/
custom packages ./pkgs/*.nix (from flake inputs: ./pkgs/default.nix)
overlays ./overlays/*.nix (from flake inputs: ./flake.nix)
LSP ./home-manager/kiara/features/development/
shell scripts ./home-manager/kiara/scripts/*.sh
dotfiles ./home-manager/kiara/dotfiles/ + ./home-manager/kiara/dotfiles.nix
custom desktop entries ./home-manager/kiara/desktop.nix
MIME types ./home-manager/kiara/mime.nix
file templates ./home-manager/kiara/dotfiles/Templates/
keybinds ./home-manager/kiara/niri.nix
persisted state ./hosts/hammer/persistence.nix

  1. While Niri uses Wayland, X11 applications can be emulated thru xwayland-run. ↩︎