• Stars
    star
    823
  • Rank 55,417 (Top 2 %)
  • Language
    Nix
  • License
    MIT License
  • Created over 1 year ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

❄️ Ryan4Yin's Nix Config ❄️

Stargazers

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

Why Nix?

Nix allows for easy-to-manage, collaborative, reproducible deployments. This means that once something is setup and configured once, it works forever. If someone else shares their configuration, anyone can make use of it.

Want to know Nix in detail? Looking for a beginner-friendly tutorial or best practices? Check out NixOS & Nix Flakes Book - 🛠️ ❤️ An unofficial & opinionated 📖 for beginners!

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

Components

NixOS(Wayland) NixOS(Xorg)
Window Manager Hyprland i3
Terminal Emulator Kitty Kitty
Bar Waybar i3block
Application Launcher anyrun rofi
Notification Daemon Mako Dunst
Display Manager GDM GDM
Color Scheme Catppuccin Catppuccin
network management tool NetworkManager NetworkManager
Input method framework Fcitx5 Fcitx5
System resource monitor Btop Btop
File Manager ranger + thunar ranger + thunar
Shell Nushell + Starship Nushell + Starship
Music Player mpd, ncmpcpp, mpc, Netease-cloud-music-gtk Netease-cloud-music-gtk
Media Player mpv mpv
Text Editor Neovim Neovim
Fonts Nerd fonts Nerd fonts
Image Viewer imv imv
Screenshot Software grim flameshot
Screen Recording OBS OBS
Filesystem & Encryption tmpfs on /, Btrfs subvolumes on a LUKS crypted partition for persistent, unlock via passphrase tmpfs on /, Btrfs subvolumes on a LUKS crypted partition for persistent, unlock via passphrase
Secure Boot lanzaboote lanzaboote

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

Hyprland + AstroNvim

I3 + AstroNvim

Neovim

See ./home/base/desktop/neovim for details.

Hosts

See ./hosts for details.

Secrets Management

See ./secrets for details.

How to Deploy this Flake?

🔴 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, cifs-mount.nix, Nvidia Support, etc.) which is not suitable for your hardware, and my private secrets repository ryan4yin/nix-secrets that only I have access to. You may use this repo as a reference to build your own configuration.

For MacOS:

# deploy the darwin configuration(harmonicia)
make ha

# deploy with details
make ha-debug

For NixOS:

Need to restart the machine when switching between wayland and xorg.

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

# we can also deploy using `make`, which is defined in Makefile
make i3    # deploy my pc with i3 window manager
# make hypr  # deploy my pc with hyprland compositor

# or we can deploy with details
make i3-debug
# make hypr-debug

To deploy this flake from NixOS's official ISO image(purest installation method), please refer to ryan4yin/nix-config/nixos-install

How to create & managage VM from this flake?

use aquamarine as an example, we can create a virtual machine with the following command:

# 1. generate a proxmox vma image file
nom build .#aquamarine  # `nom`(nix-output-monitor) can be replaced by the standard command `nix`

# 2. upload the genereated image to proxmox server's backup directory `/var/lib/vz/dump`
#    please replace the vma file name with the one you generated in step 1.
scp result/vzdump-qemu-aquamarine-nixos-23.11.20230603.dd49825.vma.zst [email protected]:/var/lib/vz/dump

# 3. the image we uploaded will be listed in proxmox web ui's this page: [storage 'local'] -> [backups], we can restore a vm from it via the web ui now.

Once the virtual machine aquamarine is created, we can deploy updates to it with the following commands:

# 1. add the ssh key to ssh-agent
ssh-add ~/.ssh/ai-idols

# 2. deploy the configuration to all the remote host with tag `@dist-build`
# using the ssh key we added in step 1
colmena apply --on '@dist-build' --show-trace

If you're not familiar with remote deployment, please read this tutorial first: Remote Deployment - NixOS & Flakes Book

References

Other dotfiles that inspired me:

More Repositories

1

nixos-and-flakes-book

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

knowledge

(Chinese Only)Everything I know: DevOps & CloudNative, Linux, Embedded, Homelab, Music, Blockchain, AI, etc...
Jupyter Notebook
416
star
3

nix-darwin-kickstarter

macOS as Code! A beginner-friendly nix-darwin + home-manager + flakes startup configuration. 一份易于理解的 nix-darwin 初始配置模板,专为新手制作.
Nix
318
star
4

video2chars

Convert video to ascii art animation.
Python
199
star
5

nixos-rk3588

Minimal NixOS running on RK3588/RK3588s based SBC(Orange Pi 5 Plus, Orange Pi 5, Rock 5A, etc)
Nix
123
star
6

nixos-licheepi4a

NixOS Running on LicheePi 4A(RISC-V)
Nix
33
star
7

wallpapers

My Wallpapers
Nushell
25
star
8

thiscute.world

Ryan4Yin's Space
HTML
17
star
9

guitar-synthesizer

使用 Python/Julia/Matlab 合成吉他音色
Python
7
star
10

learn-stm32f103c8t6

C
6
star
11

pulumi-libvirt

A Pulumi provider that lets you provision servers on a libvirt host via pulumi.
Go
5
star
12

learn-8051-asm

学习玩耍 8051 汇编
Assembly
4
star
13

video2ascii-rs

yet another video2chars in rust
Rust
4
star
14

waline-comments-backup

comments backup for thiscute.world
Python
2
star
15

k8s-gitops

Kubernetes as Code
Shell
2
star
16

video2ascii-c

yet another video2ascii written in c
C
1
star
17

Video2ASCII.jl

convert video to ascii art animation
Julia
1
star
18

uptime.ryan4yin.space

Uptime Monitor and Status Page for Ryan4yin's Websites
1
star
19

learn-container

Learn Linux Container
Rust
1
star
20

nur-packages

Ryan Yin's Nix User Repository
Nix
1
star