랭킹으로 돌아가기

ryan4yin/nix-config

Nixnixos-and-flakes.thiscute.world

❄️ My nix config for both desktops(NixOS+macOS) and homelab servers(NixOS).

nixosnixos-configurationnixdotfilesnix-flakenix-flakeshyprlandi3ricingriceunixporn
스타 성장
스타
2k
포크
98
주간 성장
이슈
0
5001k1.5k
2023년 5월2024년 5월2025년 6월2026년 7월
README

:snowflake: Ryan4Yin's Nix Config :snowflake:

Stargazers

My configuration is becoming more and more complex, and it will be difficult for beginners to read. If you are new to NixOS and want to know how I use NixOS, I would recommend you to take a look at the ryan4yin/nix-config/releases first, check out to some simpler older versions, such as i3-kickstarter, which will be much easier to understand.

This repository is home to the nix code that builds my systems:

  1. NixOS Desktops: NixOS with home-manager, niri, agenix, etc.
  2. macOS Desktops: nix-darwin with home-manager, share the same home-manager configuration with NixOS Desktops.
  3. NixOS Servers: virtual machines running on Proxmox/KubeVirt, with various services, such as kubernetes, homepage, prometheus, grafana, etc.

See ./hosts for details of each host.

See ./Virtual-Machine.md for details of how to create & manage KubeVirt's Virtual Machine from this flake.

Why NixOS & Flakes?

Nix allows for easy-to-manage, collaborative, reproducible deployments. This means that once something is setup and configured once, it works (almost) forever. If someone else shares their configuration, anyone else can just use it (if you really understand what you're copying/referring now).

As for Flakes, refer to Introduction to Flakes - NixOS & Nix Flakes Book

Want to know NixOS & Flakes in detail? Looking for a beginner-friendly tutorial or best practices? You don't have to go through the pain I've experienced again! Check out my NixOS & Nix Flakes Book - 🛠️ ❤️ An unofficial & opinionated :book: for beginners!

If you're using macOS, check out ryan4yin/nix-darwin-kickstarter for a quick start.

Components

NixOS(Wayland)
Window Manager Niri
Terminal Emulator Zellij + foot/Kitty/Alacritty/Ghostty
Status Bar / Notifier / Launcher / lockscreens noctalia-shell
Display Manager tuigreet
Color Scheme catppuccin-nix
network management tool NetworkManager
Input method framework Fcitx5 + rime + 小鹤音形 flypy
System resource monitor Btop
File Manager Yazi + thunar
Shell Nushell + Starship
Media Player mpv
Editors / IDE Helix (primary), Neovim (backup) — configuration & usage
Fonts Nerd fonts
Image Viewer imv
Screenshot Software Niri's builtin function
Screen Recording OBS
Filesystem & Encryption tmpfs as /, Btrfs subvolumes on a LUKS encrypted partition for persistent, unlock via passphrase
Secure Boot lanzaboote

Wallpapers: https://github.com/ryan4yin/wallpapers

Screenshots

desktop

overview

nvim

Editors / IDE

Secrets Management

See ./secrets for details.

How to Deploy this Flake?

:red_circle: IMPORTANT: You should NOT deploy this flake directly on your machine :exclamation: It will not succeed. This flake contains my hardware configuration(such as hardware-configuration.nix, Nvidia Support, etc.) which is not suitable for your hardware, and requires my private secrets repository ryan4yin/nix-secrets to deploy. You may use this repo as a reference to build your own configuration.

For NixOS:

To deploy this flake from NixOS's official ISO image (purest installation method), please refer to ./nixos-installer/

# deploy one of the configuration based on the hostname
sudo nixos-rebuild switch --flake .#ai-niri

# Deploy the niri nixosConfiguration by hostname match
just niri

# or we can deploy with details
just niri debug

For macOS:

# If you are deploying for the first time,
# 1. install nix & homebrew manually.
# 2. prepare the deployment environment with essential packages available
nix-shell -p just nushell
# 3. comment home-manager's code in lib/macosSystem.nix to speed up the first deployment.
# 4. comment out the proxy settings in scripts/darwin_set_proxy.py if the proxy is not ready yet.

# Deploy the darwinConfiguration by hostname match
just local

# deploy with details
just local debug

What y'all will need when Nix drives you to drink. (copy from hlissner's dotfiles, it really matches my feelings when I first started using NixOS...)

References

Other dotfiles that inspired me:

관련 저장소
NixOS/nixpkgs

Nix Packages collection & NixOS

NixMIT Licensenixpkgsnix
25.5k19.6k
nix-community/home-manager

Manage a user environment using Nix [maintainer=@khaneliman, @rycee]

NixMIT Licensenixnixpkgs
nix-community.github.io/home-manager/
10.1k2.4k
xonsh/xonsh

🐚 Python-powered shell. Full-featured, cross-platform and AI-friendly.

PythonPyPIOtherxonshdevops
xon.sh
9.6k730
nix-community/awesome-nix

😎 A curated list of the best resources in the Nix community [maintainer=@cyntheticfox]

Creative Commons Zero v1.0 Universalawesome-listawesome
nix-community.github.io/awesome-nix/
5.3k203
NixOS/nix.dev

Official documentation for getting things done with Nix.

NixCreative Commons Attribution Share Alike 4.0 Internationalnixdocumentation
nix.dev
3.9k334
Misterio77/nix-starter-configs

Simple and documented config templates to help you get started with NixOS + home-manager + flakes. All the boilerplate you need!

NixCreative Commons Zero v1.0 Universaldotfilesflakes
3.8k178
dustinlyons/nixos-config

General purpose Nix starter template for macOS or NixOS w/ step-by-step instructions

NixBSD 3-Clause "New" or "Revised" Licensedotfilesnix
3.6k200
nix-community/nixos-anywhere

Install NixOS everywhere via SSH [maintainers=@Mic92 @Lassulus @phaer @Enzime @a-kenji]

ShellMIT Licensedeploymentnix
nix-community.github.io/nixos-anywhere/
3.3k209
ryan4yin/nixos-and-flakes-book

:hammer_and_wrench: :heart: Want to know NixOS & Flakes in detail? Looking for a beginner-friendly tutorial? Then you've come to the right place! 想要学习使用 NixOS 与 Flakes 吗?在寻找一份新手友好的教程?那你可来对地方了!

TypeScriptnpmCreative Commons Attribution Share Alike 4.0 Internationallinuxnix
nixos-and-flakes.thiscute.world
3.2k156
Mic92/sops-nix

Atomic secret provisioning for NixOS based on sops

NixMIT Licensenixossops
3k223
nix-community/NixOS-WSL

NixOS on WSL [maintainer=@nzbr]

NixApache License 2.0nixoswsl
3k161
nix-community/nh

Yet another Nix CLI helper. [Maintainers=@NotAShelf, @faukah]

Rustcrates.ioEuropean Union Public License 1.2nixosnix
3k120