{"id":13494681,"url":"https://github.com/ryan4yin/nix-config","last_synced_at":"2025-04-13T10:46:28.190Z","repository":{"id":161895439,"uuid":"631333073","full_name":"ryan4yin/nix-config","owner":"ryan4yin","description":"❄️ My nix config for both desktops(NixOS+macOS) and homelab servers(NixOS).","archived":false,"fork":false,"pushed_at":"2025-04-13T08:43:44.000Z","size":42820,"stargazers_count":1295,"open_issues_count":0,"forks_count":76,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-13T09:39:14.858Z","etag":null,"topics":["dotfiles","hyprland","i3","nix","nix-flake","nix-flakes","nixos","nixos-configuration","rice","ricing","unixporn"],"latest_commit_sha":null,"homepage":"https://nixos-and-flakes.thiscute.world","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryan4yin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ryan4yin","patreon":"ryan4yin","custom":["https://buymeacoffee.com/ryan4yin"]}},"created_at":"2023-04-22T17:29:16.000Z","updated_at":"2025-04-13T08:43:49.000Z","dependencies_parsed_at":"2023-07-12T23:30:07.637Z","dependency_job_id":"9a5ea4b8-448f-4c86-9c50-2217a2daede0","html_url":"https://github.com/ryan4yin/nix-config","commit_stats":{"total_commits":1301,"total_committers":14,"mean_commits":92.92857142857143,"dds":"0.039969254419677136","last_synced_commit":"6aef21ec8f325ba0349d125e7816fa188ab17007"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryan4yin%2Fnix-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryan4yin%2Fnix-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryan4yin%2Fnix-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryan4yin%2Fnix-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryan4yin","download_url":"https://codeload.github.com/ryan4yin/nix-config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248702363,"owners_count":21148114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotfiles","hyprland","i3","nix","nix-flake","nix-flakes","nixos","nixos-configuration","rice","ricing","unixporn"],"created_at":"2024-07-31T19:01:27.173Z","updated_at":"2025-04-13T10:46:28.152Z","avatar_url":"https://github.com/ryan4yin.png","language":"Nix","funding_links":["https://github.com/sponsors/ryan4yin","https://patreon.com/ryan4yin","https://buymeacoffee.com/ryan4yin"],"categories":["Nix","Nix Configurations","dotfiles"],"sub_categories":[],"readme":"\u003ch2 align=\"center\"\u003e:snowflake: Ryan4Yin's Nix Config :snowflake:\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/palette/macchiato.png\" width=\"400\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://github.com/ryan4yin/nix-config/stargazers\"\u003e\n\t\t\u003cimg alt=\"Stargazers\" src=\"https://img.shields.io/github/stars/ryan4yin/nix-config?style=for-the-badge\u0026logo=starship\u0026color=C9CBFF\u0026logoColor=D9E0EE\u0026labelColor=302D41\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://nixos.org/\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/NixOS-24.11-informational.svg?style=for-the-badge\u0026logo=nixos\u0026color=F2CDCD\u0026logoColor=D9E0EE\u0026labelColor=302D41\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/ryan4yin/nixos-and-flakes-book\"\u003e\n        \u003cimg src=\"https://img.shields.io/static/v1?label=Nix Flakes\u0026message=learning\u0026style=for-the-badge\u0026logo=nixos\u0026color=DDB6F2\u0026logoColor=D9E0EE\u0026labelColor=302D41\"\u003e\u003c/a\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003e My configuration is becoming more and more complex, and **it will be difficult for beginners to\n\u003e read**. If you are new to NixOS and want to know how I use NixOS, I would recommend you to take a\n\u003e look at the [ryan4yin/nix-config/releases](https://github.com/ryan4yin/nix-config/releases) first,\n\u003e **check out to some simpler older versions, such as\n\u003e [i3-kickstarter](https://github.com/ryan4yin/nix-config/tree/i3-kickstarter), which will be much\n\u003e easier to understand**.\n\nThis repository is home to the nix code that builds my systems:\n\n1. NixOS Desktops: NixOS with home-manager, hyprland, agenix, etc.\n2. macOS Desktops: nix-darwin with home-manager, share the same home-manager configuration with\n   NixOS Desktops.\n3. NixOS Servers: virtual machines running on Proxmox/KubeVirt, with various services, such as\n   kubernetes, homepage, prometheus, grafana, etc.\n\nSee [./hosts](./hosts) for details of each host.\n\nSee [./Virtual-Machine.md](./Virtual-Machine.md) for details of how to create \u0026 manage KubeVirt's\nVirtual Machine from this flake.\n\n## Why NixOS \u0026 Flakes?\n\nNix allows for easy-to-manage, collaborative, reproducible deployments. This means that once\nsomething is setup and configured once, it works (almost) forever. If someone else shares their\nconfiguration, anyone else can just use it (if you really understand what you're copying/referring\nnow).\n\nAs for Flakes, refer to\n[Introduction to Flakes - NixOS \u0026 Nix Flakes Book](https://nixos-and-flakes.thiscute.world/nixos-with-flakes/introduction-to-flakes)\n\n**Want to know NixOS \u0026 Flakes in detail? Looking for a beginner-friendly tutorial or best practices?\nYou don't have to go through the pain I've experienced again! Check out my\n[NixOS \u0026 Nix Flakes Book - 🛠️ ❤️ An unofficial \u0026 opinionated :book: for beginners](https://github.com/ryan4yin/nixos-and-flakes-book)!**\n\n\u003e If you're using macOS, check out\n\u003e [ryan4yin/nix-darwin-kickstarter](https://github.com/ryan4yin/nix-darwin-kickstarter) for a quick\n\u003e start.\n\n## Components\n\n|                             | NixOS(Wayland)                                                                                                      |\n| --------------------------- | ------------------------------------------------------------------------------------------------------------------- |\n| **Window Manager**          | [Hyprland][Hyprland]                                                                                                |\n| **Terminal Emulator**       | [Zellij][Zellij] + [Kitty][Kitty]                                                                                   |\n| **Bar**                     | [Waybar][Waybar]                                                                                                    |\n| **Application Launcher**    | [anyrun][anyrun]                                                                                                    |\n| **Notification Daemon**     | [Mako][Mako]                                                                                                        |\n| **Display Manager**         | [GDM][GDM]                                                                                                          |\n| **Color Scheme**            | [Catppuccin][Catppuccin]                                                                                            |\n| **network management tool** | [NetworkManager][NetworkManager]                                                                                    |\n| **Input method framework**  | [Fcitx5][Fcitx5]                                                                                                    |\n| **System resource monitor** | [Btop][Btop]                                                                                                        |\n| **File Manager**            | [Yazi][Yazi] + [thunar][thunar]                                                                                     |\n| **Shell**                   | [Nushell][Nushell] + [Starship][Starship]                                                                           |\n| **Music Player**            | [mpd][mpd], [ncmpcpp][ncmpcpp], [mpc][mpc]                                                                          |\n| **Media Player**            | [mpv][mpv]                                                                                                          |\n| **Text Editor**             | [Neovim][Neovim] + [DoomEmacs][DoomEmacs]                                                                           |\n| **Fonts**                   | [Nerd fonts][Nerd fonts]                                                                                            |\n| **Image Viewer**            | [imv][imv]                                                                                                          |\n| **Screenshot Software**     | [flameshot][flameshot] + [grim][grim]                                                                               |\n| **Screen Recording**        | [OBS][OBS]                                                                                                          |\n| **Filesystem \u0026 Encryption** | tmpfs on `/`, [Btrfs][Btrfs] subvolumes on a [LUKS][LUKS] encrypted partition for persistent, unlock via passphrase |\n| **Secure Boot**             | [lanzaboote][lanzaboote]                                                                                            |\n\nWallpapers: https://github.com/ryan4yin/wallpapers\n\n## Hyprland + AstroNvim + DoomEmacs\n\n![](./_img/hyprland_2023-07-29_1.webp)\n\n![](./_img/hyprland_2023-07-29_2.webp)\n\n![](./_img/emacs-2024-01-07.webp)\n\n## Neovim\n\nSee [./home/base/tui/editors/neovim/](./home/base/tui/editors/neovim/) for details.\n\n## Emacs\n\nSee [./home/base/tui/editors/emacs/](./home/base/tui/editors/emacs/) for details.\n\n## Secrets Management\n\nSee [./secrets](./secrets) for details.\n\n## How to Deploy this Flake?\n\n\u003c!-- prettier-ignore --\u003e\n\u003e :red_circle: **IMPORTANT**: **You should NOT deploy this flake directly on your machine :exclamation:\n\u003e It will not succeed.** This flake contains my hardware configuration(such as\n\u003e [hardware-configuration.nix](hosts/idols-ai/hardware-configuration.nix),\n\u003e [Nvidia Support](https://github.com/ryan4yin/nix-config/blob/v0.1.1/hosts/idols-ai/default.nix#L77-L91),\n\u003e etc.) which is not suitable for your hardware, and requires my private secrets repository\n\u003e [ryan4yin/nix-secrets](https://github.com/ryan4yin/nix-config/tree/main/secrets) to deploy. You\n\u003e may use this repo as a reference to build your own configuration.\n\nFor NixOS:\n\n\u003e To deploy this flake from NixOS's official ISO image (purest installation method), please refer to\n\u003e [./nixos-installer/](./nixos-installer/)\n\n\u003e Need to restart the machine when switching between `wayland` and `xorg`.\n\n```bash\n# deploy one of the configuration based on the hostname\nsudo nixos-rebuild switch --flake .#ai-hyprland\n\n# deploy via `just`(a command runner with similar syntax to make) \u0026 Justfile\njust hypr  # deploy my pc with hyprland compositor\n\n# or we can deploy with details\njust hypr debug\n```\n\nFor macOS:\n\n```bash\n# If you are deploying for the first time,\n# 1. install nix \u0026 homebrew manually.\n# 2. prepare the deployment environment with essential packages available\nnix-shell -p just nushell\n# 3. comment home-manager's code in lib/macosSystem.nix to speed up the first deployment.\n# 4. comment out the proxy settings in scripts/darwin_set_proxy.py if the proxy is not ready yet.\n\n# 4. deploy harmonica's configuration(macOS Intel)\njust ha\n\n# deploy fern's configuration(Apple Silicon)\njust fe\n\n# deploy with details\njust ha debug\n# just fe debug\n```\n\n\u003e [What y'all will need when Nix drives you to drink.](https://www.youtube.com/watch?v=Eni9PPPPBpg)\n\u003e (copy from hlissner's dotfiles, it really matches my feelings when I first started using NixOS...)\n\n## References\n\nOther dotfiles that inspired me:\n\n- Nix Flakes\n  - [NixOS-CN/NixOS-CN-telegram](https://github.com/NixOS-CN/NixOS-CN-telegram)\n  - [notusknot/dotfiles-nix](https://github.com/notusknot/dotfiles-nix)\n  - [xddxdd/nixos-config](https://github.com/xddxdd/nixos-config)\n  - [bobbbay/dotfiles](https://github.com/bobbbay/dotfiles)\n  - [gytis-ivaskevicius/nixfiles](https://github.com/gytis-ivaskevicius/nixfiles)\n  - [davidtwco/veritas](https://github.com/davidtwco/veritas)\n  - [gvolpe/nix-config](https://github.com/gvolpe/nix-config)\n  - [Ruixi-rebirth/flakes](https://github.com/Ruixi-rebirth/flakes)\n  - [fufexan/dotfiles](https://github.com/fufexan/dotfiles): gtk theme, xdg, git, media, anyrun,\n    etc.\n  - [nix-community/srvos](https://github.com/nix-community/srvos): a collection of opinionated and\n    sharable NixOS configurations for servers\n- Modularized NixOS Configuration\n  - [hlissner/dotfiles](https://github.com/hlissner/dotfiles)\n  - [viperML/dotfiles](https://github.com/viperML/dotfiles)\n- Hyprland(wayland)\n  - [notwidow/hyprland](https://github.com/notwidow/hyprland): This is where I start my hyprland\n    journey.\n  - [HeinzDev/Hyprland-dotfiles](https://github.com/HeinzDev/Hyprland-dotfiles): Refer to the waybar\n    configuration here.\n  - [linuxmobile/kaku](https://github.com/linuxmobile/kaku)\n- Neovim/AstroNvim\n  - [maxbrunet/dotfiles](https://github.com/maxbrunet/dotfiles): astronvim with nix flakes.\n- Misc\n  - [1amSimp1e/dots](https://github.com/1amSimp1e/dots)\n\n[Hyprland]: https://github.com/hyprwm/Hyprland\n[Kitty]: https://github.com/kovidgoyal/kitty\n[Nushell]: https://github.com/nushell/nushell\n[Starship]: https://github.com/starship/starship\n[Waybar]: https://github.com/Alexays/Waybar\n[polybar]: https://github.com/polybar/polybar\n[rofi]: https://github.com/davatorium/rofi\n[anyrun]: https://github.com/Kirottu/anyrun\n[Dunst]: https://github.com/dunst-project/dunst\n[Fcitx5]: https://github.com/fcitx/fcitx5\n[Btop]: https://github.com/aristocratos/btop\n[mpv]: https://github.com/mpv-player/mpv\n[Zellij]: https://github.com/zellij-org/zellij\n[Neovim]: https://github.com/neovim/neovim\n[AstroNvim]: https://github.com/AstroNvim/AstroNvim\n[DoomEmacs]: https://github.com/doomemacs/doomemacs\n[flameshot]: https://github.com/flameshot-org/flameshot\n[grim]: https://github.com/emersion/grim\n[flameshot]: https://github.com/flameshot-org/flameshot\n[imv]: https://sr.ht/~exec64/imv/\n[OBS]: https://obsproject.com\n[Mako]: https://github.com/emersion/mako\n[Nerd fonts]: https://github.com/ryanoasis/nerd-fonts\n[catppuccin]: https://github.com/catppuccin/catppuccin\n[mpd]: https://github.com/MusicPlayerDaemon/MPD\n[ncmpcpp]: https://github.com/ncmpcpp/ncmpcpp\n[mpc]: https://github.com/MusicPlayerDaemon/mpc\n[Netease-cloud-music-gtk]: https://github.com/gmg137/netease-cloud-music-gtk\n[NetworkManager]: https://wiki.gnome.org/Projects/NetworkManager\n[wl-clipboard]: https://github.com/bugaevc/wl-clipboard\n[GDM]: https://wiki.archlinux.org/title/GDM\n[thunar]: https://gitlab.xfce.org/xfce/thunar\n[Yazi]: https://github.com/sxyazi/yazi\n[Catppuccin]: https://github.com/catppuccin/catppuccin\n[Btrfs]: https://btrfs.readthedocs.io\n[LUKS]: https://wiki.archlinux.org/title/Dm-crypt/Encrypting_an_entire_system\n[lanzaboote]: https://github.com/nix-community/lanzaboote\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryan4yin%2Fnix-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryan4yin%2Fnix-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryan4yin%2Fnix-config/lists"}