linux-nixos-hyprland-config-dotfiles

XNM1MIT活跃维护

一套基于 NixOS、Hyprland 和 Catppuccin Macchiato 主题的 Linux 桌面配置 dotfiles,开箱即用且可定制,省去从零折腾窗口管理器与主题搭配的时间。

Linux 🐧 configuration based on NixOS ❄️, Hyprland, and Catppuccin Macchiato theme 😸 for a consistent, complete, and customizable experience. 🚀

暂无版本951star +1 / 7 天54fork同步于 2026-11-11 05:49 UTC

怎么上手

由 README 提炼,执行前请确认
sudo nix flake update --flake /etc/nixos; and sudo nixos-rebuild switch --flake /etc/nixos#your-hostname
硬件要求按 README 说明

README 未说明具体硬件要求,仅提到该配置并不轻量,可能占用较多磁盘空间,且需要一定的 NixOS 知识

需要 CUDA
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

一套基于 NixOS 和 Hyprland 的完整桌面配置,用 Catppuccin Macchiato 主题统一外观,可直接复现

一套基于 NixOS、Hyprland 和 Catppuccin Macchiato 主题的 Linux 桌面配置 dotfiles,开箱即用且可定制,省去从零折腾窗口管理器与主题搭配的时间。

核心能力

  • 用 Nix flake 管理整套系统配置,可复现到其他机器
  • Hyprland 合成器搭配 Waybar、Dunst、Rofi 等完整桌面组件
  • 几乎所有组件统一为 Catppuccin Macchiato 主题
  • 用 Podman 替代 Docker 做无根容器,并启用 AppArmor、USBGuard 等加固
  • 内置 Fish、Helix、Kitty、Yazi 等开发与终端工具链

容易踩的坑

默认 USBGuard 会拦截所有 USB 设备,需先在 nixos/usb.nix 里加入可信设备,否则摄像头、蓝牙、WiFi 可能失效;需先用 rg --hidden FIXME 和 rg --hidden 'xnm' 把分区、显示器、用户名、主机名改成自己的;首次 rebuild 前要临时启用 nix-command 和 flakes,且 /etc/nixos 下文件须归 root 所有

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    nixos nixpkgs linux kernel hyprland rust

    Showcase Gif

    Table of Contents

    📖 About

    This repository houses my NixOS Linux ❄️ flake configuration, featuring the Hyprland window manager and adorned with the stylish Catppuccin Macchiato theme. I rely on this setup as my daily driver for work and programming, primarily in Rust 🦀. Feel free to utilize it in its entirety or borrow specific components for your own configuration.

    [!NOTE] It's essential to note that this configuration is not minimalistic or lightweight and may require some disk space and knowledge to understand. If you're looking for something simpler, this configuration may not be suitable for you.

    This system leverages cutting-edge channels and versions of software to provide you with the latest updates and features. Notably, it utilizes:

    • flake (An experimental feature of the Nix package manager)
    • nur (The Nix User Repository) *currently disabled
    • nixpkgs: unstable
    • rust: stable version

    This approach ensures that you stay on the forefront of technology, receiving the most recent software advancements promptly.

    [!WARNING] However, it's important to note that this emphasis on bleeding-edge software may impact the stability of the system.

    [!IMPORTANT] Please note that the system utilizes Podman instead of Docker for containerization due to various reasons, primarily related to security (rootless and daemonless containers), easier migration to Kubernetes, availability of pods, compatibility with systemd, and better security for distrobox. If you prefer to use Docker instead of Podman, you can make the switch by commenting out the Podman section in the nixos/virtualisation.nix file and uncommenting the Docker section. More details on Docker configuration in NixOS can be found here.

    [!NOTE] The system enables AppArmor and additional hardening through kernel LSMs, along with security services such as Fail2Ban and USBGuard. Firejail is also preinstalled for sandboxing desktop applications.

    You have the flexibility to customize these configurations according to your needs by modifying the respective configuration files.

    🌟 Showcase

    [!IMPORTANT] The showcased images do not reflect the latest version of the system's appearance. The final setup may vary slightly.

    Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Showcase Video

    🔧 Components

    ComponentVersion/Name
    DistroNixOS
    KernelZen
    ShellFish
    Display ServerWayland
    WM (Compositor)Hyprland
    BarWaybar
    NotificationDunst
    LauncherRofi-Wayland
    EditorHelix
    TerminalKitty + Starship
    OSDAvizo
    Night GammaHyprsunset
    Fetch UtilityFastfetch
    ThemeCatppuccin Macchiato
    IconsColloid-teal-dark, Numix-Circle
    FontJetBrains Mono + Nerd Font Patch
    PlayerPear Desktop + Spotify
    File BrowserThunar + Yazi
    Internet BrowserQutebrowser, Brave + Vimium + NightTab + Stylus
    MimetypesMPV, Imv, Zathura
    Image EditorSwappy
    ScreenshotGrim + Slurp
    RecorderWl-screenrec
    Color PickerHyprpicker
    ClipboardWl-clipboard + Cliphist + Wl-clip-persist
    IdleHypridle
    LockHyprlock
    Logout menuWlogout
    WallpaperHyprpaper
    Graphical BootPlymouth + Catppuccin-plymouth
    Display ManagerGreetd + Tuigreet
    ContainerizationPodman
    Mesh VPNTailscale

    And many other useful utilities. The full list can be found in the system configuration files at nixos directory.

    ✨ Features

    • 🔄 Reproducible: Built on NixOS, this configuration can be effortlessly reproduced on other machines, ensuring a consistent setup.

    • 🖌️ Consistent: Nearly every component has been meticulously styled to adhere to the Catppuccin Macchiato theme, providing a visually cohesive experience.

    • ✅ Complete: This system is equipped with a wide range of components and utilities, akin to the completeness of operating systems like MacOS or Windows.

    • 🎨 Customizable: Leveraging the power of Linux and Hyprland, this configuration offers extensive customization options, allowing you to tailor your setup to your preferences.

    🔗 Tailscale

    Tailscale is enabled through nixos/vpn.nix, with the tailscale CLI installed. Routing features are disabled, and the configured Tailscale UDP port is allowed through the firewall.

    After rebuilding the system, authenticate the machine and verify its connection:

    sudo tailscale up
    tailscale status
    

    🚀 Installation

    1. Download and Install NixOS from the official site.
    2. Temporarily install ripgrep and fish using the command: nix-shell -p ripgrep fish --run fish. You can also use classic bash and grep for the next step without installing fish and ripgrep.
    3. Run the command rg --hidden FIXME and change/add lines to match your device, swaps, partitions, peripherals, file systems, etc. in the configuration files.

    [!IMPORTANT] Ensure that you configure USBGuard in the nixos/usb.nix file to avoid potential issues. By default, USBGuard blocks all USB devices, which can lead to the disabling of crucial hardware components such as the integrated camera, bluetooth, wifi, etc. To configure USBGuard properly, add your trusted USB devices to the configuration. You can obtain a list of all connected devices by using the lsusb command from the usbutils package.

    [!WARNING] Failure to configure USBGuard appropriately may result in the inability to connect any USB devices to your machine. If needed, you can also disable USBGuard altogether by setting services.usbguard.enable to false in the configuration:services.usbguard.enable = false;. This step ensures that USBGuard is not actively blocking any USB devices.

    [!IMPORTANT] Remember to update the monitor settings in the Hyprland configuration file located at home/.config/hypr/hyprland.lua.

    [!IMPORTANT] Also, important: If you use disk encryption with LUKS and want to use encrypted swap, you need to enable swap on LUKS. This is usually auto-generated in /etc/nixos/configuration.nix as the boot.initrd.luks.devices."luks-...".device = "/dev/disk/by-uuid/..."; code block, if you set this option up during the NixOS installation process. You can simply copy this snippet to either nixos/swap.nix, nixos/hardware-configuration.nix, or nixos/configuration.nix (Personally, I prefer to copy it to hardware-configuration.nix). Alternatively, you can set it up manually or use swap encryption with a random key.

    1. To change the default username and/or hostname, run the command rg --hidden 'xnm' to find and fix all instances of the username, and rg --hidden 'isitreal-laptop' for the hostname.

    [!IMPORTANT] Make sure to change the username to match yours set during installation to avoid login issues.

    [!IMPORTANT] Also, don't forget to delete or change to my git settings in home/.gitconfig, home/projects/.gitconfig.personal, home/.ssh/config, and home/work/.gitconfig.work files, as they are configured for my personal use.

    1. For the first rebuild, enable nix-command and flakes temporarily if your current system does not already have them (more here). After the first successful rebuild, this repo keeps both features enabled through nixos/nix-settings.nix.
    2. Copy or move all files (with replacements) from the home directory to your $HOME directory in Linux.
    3. Copy or move all files (with replacements and sudo permissions) from the nixos directory to /etc/nixos/.

    [!IMPORTANT] Ensure that system.stateVersion = "your_version"; is correctly set to the release version of the initial installation of your system in the configuration.nix file.

    [!IMPORTANT] Also, for security reasons, ensure all files in the /etc/nixos directory are owned by root. If not, change ownership using the command: sudo chown -R root:root /etc/nixos.

    1. Run the command sudo nix flake update --flake /etc/nixos; and sudo nixos-rebuild switch --flake /etc/nixos#your-hostname or nswitchu. If you chose first command, replace your-hostname with your hostname before running the command; by default, hostname is set to isitreal-laptop.
    2. Post-installation configuration:
    • Import GNOME settings along with the theme by executing the following command: dconf load / < home/.config/gnome_settings_backup.dconf. Additionally, you can use tools like gnome-tweaks or themechanger to fine-tune specific theme preferences to your liking.

    • Install dictionaries for spellchecking in Qutebrowser by using the similar command in bash: $(find $(nix-store --query --outputs $(which qutebrowser)) -iname '*dictcli.py*' | head -1) install en-US hi-IN. To obtain a list of all available dictionaries, run: $(find $(nix-store --query --outputs $(which qutebrowser)) -iname '*dictcli.py*' | head -1) list in bash. For more information, visit the Qutebrowser page on the nixos wiki.

    • Apply Catppuccin theme for websites in your browser (Brave, Firefox, Chromium):

      • Install the Stylus Extension from its official website.
      • Open the extension's settings page and navigate to the Backup section.
      • Click "Import" and select the file home/.config/stylus-catppuccin.json.
    • Apply Catppuccin theme for Cool-Retro-Term:

      • Launch Cool-Retro-Term.
      • Right-click on the window and select "Settings".
      • In the General panel, click "Import" and select the file home/.config/cool-retro-term-style.json.
      • Select the imported profile named "catppuccin-theme".
      • Click "Load" and exit from "Settings".
    • Apply Open-WebUI Settings (only if you enable services.open-webui.enable = true in nixos/llm.nix)

      • Navigate to the Open-WebUI page: http://localhost:8888.
      • Signup or signin if you haven't already done so.
      • Click on the user photo in the top-right corner.
      • From the dropdown menu, select "Admin Panel".
      • In the Admin Panel, go to the "Settings" tab.
      • Under the Settings tab, locate and click on the "Database" section.
      • Click "Import Config from JSON File" and select the configuration file: home/.config/open-webui-config.json from your file manager.
    • Login to your accounts.

    • Customize graphical applications to suit your preferences.

    After this, you will have a complete system.

    ⌨️ Keybindings

    Main

    Key CombinationAction
    SUPER + ALT + RResize windows mode
    SUPER + ALT + MMove windows mode
    SUPER + H, J, K, L/ArrowsChange window focus
    SUPER + 1..0Change workspace (1-10)
    SUPER + ALT + 1..0Change workspace (11-20)
    SUPER + SHIFT + 1..0Move window to workspace (1-10)
    SUPER + SHIFT + ALT + 1..0Move window to workspace (11-20)
    SUPER + SHIFT + QKill active window
    SUPER + SHIFT + FToggle floating window
    SUPER + CTRL + FToggle full-screen
    SUPER + SHIFT + OToggle split
    SUPER + SHIFT + PToggle pseudo
    SUPER + CTRL + EExpose all windows using pyprland
    SUPER + CTRL + MExpose all minimized windows using pyprland
    SUPER + MMinimize or restore a window using pyprland
    SUPER + CTRL + TLaunch scratchpad with kitty using pyprland
    SUPER + CTRL + VLaunch scratchpad with pavucontrol using pyprland
    SUPER + TLaunch kitty
    SUPER + DLaunch rofi -show drun
    SUPER + BLaunch qutebrowser
    SUPER + SHIFT + BLaunch brave
    SUPER + FLaunch thunar
    SUPER + ESCAPELaunch wlogout
    SUPER + SLaunch spotify
    SUPER + YLaunch pear-desktop
    SUPER + SHIFT + DLaunch discord
    SUPER + SHIFT + TLaunch telegram
    SUPER + SHIFT + LLaunch hyprlock
    SUPER + SHIFT + STake screenshot
    SUPER + ELaunch swappy to edit last taken screenshot
    SUPER + RRecord screen area (MP4)
    SUPER + SHIFT + RRecord screen area (GIF)
    SUPER + CLaunch color picker (using hyprpicker)
    SUPER + ZToggle Zoom (with pyprland)
    SUPER + VLaunch clipboard menu (rofi -dmenu)
    SUPER + SHIFT + VLaunch clipboard menu (rofi -dmenu) (copy to clipboard)
    SUPER + XLaunch clipboard deletion item menu (rofi -dmenu)
    SUPER + SHIFT + XClear clipboard
    SUPER + ULaunch bookmark menu (rofi -dmenu)
    SUPER + SHIFT + UAdd text from clipboard to bookmark
    SUPER + CTRL + ULaunch bookmark deletion item menu (rofi -dmenu)
    SUPER + SHIFT + AToggle airplane mode
    SUPER + SHIFT + NToggle notifications
    SUPER + SHIFT + YToggle bluetooth
    SUPER + SHIFT + WToggle wifi
    SUPER + PToggle play-pause player
    SUPER + ]Player next track
    SUPER + [Player previous track

    You can find all other keybindings in /home/.config/hypr/hyprland.lua in the bind section. All system fish scripts are located at /home/.config/fish/functions directory.

    🐟 Useful aliases in Fish Shell

    This system includes a fish shell configuration file (/home/.config/fish/config.fish) that provides various aliases to enhance your experience working with it.

    Common commands:

    • cl: clear the terminal screen (shorthand for clear)
    • lgit: launch the lazygit command-line Git client
    • ldocker: launch the lazydocker command-line Docker client
    • conf: navigate to the ~/.config directory

    NixOS-specific commands:

    • nswitch: rebuild your system using the current flake
    • nswitchu: rebuild and update your system using the current flake
    • nau: add the unstable channel to the package manager
    • nsgc: optimize the nix store and remove unreferenced and obsolete store paths (equivalent to sudo nix-store --gc)
    • ngc: delete all old generations of user profiles (equivalent to sudo nix-collect-garbage -d)
    • ngc7: delete generations of user profiles older than 7 days (equivalent to sudo nix-collect-garbage --delete-older-than 7d)
    • ngc14: delete generations of user profiles older than 14 days (equivalent to sudo nix-collect-garbage --delete-older-than 14d)
    • nixos: navigate to the /etc/nixos directory
    • store: navigate to the /nix/store directory

    You can customize this configuration by adding more aliases to the file and editing existing ones. This makes your experience more personalized and smoother.

    🤖 AI Tools and Services

    This configuration includes several AI/LLM tools and services for local development and experimentation:

    Local AI Services:

    • Ollama - Local LLM server with pre-loaded models:

      • Accessible at http://localhost:11434
      • Current defaults include llama3.2:3b, smallthinker:3b, gemma3n:e4b, gemma3:4b, gpt-oss:20b, second_constantine/gpt-oss-u:20b, qwen3:14b, devstral-small-2:24b, glm-4.7-flash, x/z-image-turbo, x/flux2-klein:4b, and x/flux2-klein:9b
      • Text embedding model: nomic-embed-text-v2-moe
      • CUDA acceleration enabled for GPU inference
      • See nixos/llm.nix for the current model list
    • SearXNG (Searx fork) - Privacy-respecting meta search engine:

      • Accessible at http://localhost:7777
      • Supports HTML and JSON formats
      • 🔒 Remember to set SEARX_SECRET_KEY in your environment file: home/.config/.env.searxng
    • Open WebUI - Optional local ChatGPT-style UI for Ollama:

      • Configured for http://localhost:8888
      • Disabled by default in nixos/llm.nix
      • Supports model switching and prompt templates when enabled

    AI Tools:

    • aichat - ChatGPT-like CLI and REPL; also the fish shell assistant: Ctrl+P (or Alt+A) turns a # comment into a command and a command into a comment, Ctrl+Space suggests up to five command completions via fzf using recent history as context while preserving the typed command prefix. With empty input, it suggests likely next commands from history. All backed by the remote DGX vLLM. AIChat's model and request options are configured in home/.config/aichat/config.yaml. Both shortcuts show progress using gum; generated commands are placed on the shell command line for review, not executed automatically. Copy home/.config/.env.llm.example to ~/.config/.env.llm, run chmod 600 ~/.config/.env.llm, and set VLLM_API_BASE and VLLM_API_KEY as literal, unquoted values without inline comments. For AIChat outside fish, run ln -s ../.env.llm ~/.config/aichat/.env if that path does not exist.
    • oterm - TUI LLM client with markdown support
    • fabric-ai - Prompt and workflow toolkit for local AI usage
    • opencode - Terminal coding agent powered by local and remote models
    • agent-browser - Browser automation tool for AI workflows
    • pay-respects - thefuck-style fixer for the last failed command (f or Ctrl+X Ctrl+X, also auto-offers a fix on command-not-found). Rules run locally; when no rule provides a fix, it requests AI suggestions from the self-hosted DGX vLLM, remote from this machine. Fish derives _PR_AI_URL and _PR_AI_API_KEY from the shared endpoint and key in ~/.config/.env.llm, and loads _PR_AI_MODEL and _PR_AI_EXTRA_BODY from the same file. These settings override the upstream hosted defaults.
    • omp - terminal coding agent, installed from the can1357/oh-my-pi flake input. Its configuration lives in home/.omp/: settings (agent/config.yml, agent/models.yml, with <DGX_TAILSCALE_IP> placeholders), MCP and LSP config, authored extensions and hooks, managed skills, the node manifest (agent/package.json + lock in place of node_modules), and home/.agents/.skill-lock.json listing every skill with its upstream repository. The latter is checked-in generated state, so the skill set survives a cache wipe. Plugin runtime state (plugins/) is machine-local and regenerated by restore.sh, which is also the human-readable list of installed plugins. Caches, sessions, databases and the downloaded skill folders are left out. Credentials live only in agent/.env (gitignored, see agent/.env.example): models.yml references VLLM_API_KEY and D1_API_KEY by name, and HINDSIGHT_API_TOKEN overrides hindsight.apiToken, so no secret is ever written to a tracked file. On a new machine: copy home/.omp to ~/.omp and home/.agents to ~/.agents, fill the placeholders and .env, then run home/.omp/restore.sh to reinstall the plugins (npm plugin, two marketplaces) and the skill set.

    [!NOTE] Ollama and SearXNG are enabled by default. Open WebUI is available in the configuration, but disabled by default.

    To disable them:

    1. Edit nixos/llm.nix
    2. Disable services by setting their enable attribute to false:
      services.ollama.enable = false;
      services.searx.enable = false;
      services.open-webui.enable = false;
      
    3. Remove AI CLI tools from environment.systemPackages if desired
    4. Rebuild your configuration with nswitch

    🦀 Useful info for Rustaceans

    Here are some tips to enhance your Rust experience on this system:

    1. Installation Customization: This system utilizes rust-overlay for Rust installation using the Nix approach. To customize the installation, including modifications to compilation targets, components, channels, or profiles, follow these steps:

      • Locate the nixos/rust-toolchain.toml file and make the necessary adjustments based on your requirements.

      • If you are working on multiple projects with distinct rust-toolchain.toml files or need to switch between stable and nightly Rust versions, consider the following options:

        • Set up a Nix environment using flake.nix and rust-overlay for each project separately. Utilize nix develop or direnv to manage project-specific Rust environments.

        • Alternatively, you can install rustup through environment.systemPackages and nixpkgs for a system-wide Rust setup. This allows you to manage Rust versions globally through rustup.

    2. Troubleshooting Compilation Issues: If you encounter issues during Rust compilation, particularly those related to OpenSSL, SQLite, Wayland, or any other program utilized by pkg-config in the compilation process (see here), you can employ the nix-shell -p pkg-config {your_dependency} [other_dependencies] --run fish command. This command opens a Nix shell with the necessary dependencies, facilitating seamless code compilation. Alternatively, you can employ the approach outlined in the initial section (Installation Customization) by utilizing flake.nix with dev shell instead of nix-shell. Moreover, when using the Nix Dev shell, be aware that the compilation takes place in the runtime directory, which might be insufficient for certain projects. To address this, you can adjust the runtime directory size in the nixos/users.nix file under services.logind.extraConfig="RuntimeDirectorySize=8G".

    3. Cross-Compilation: For cross-compilation, consider using tools like zigbuild or cross. Personally, I find zigbuild preferable, but both are valuable options for your cross-compilation needs.

    4. Cargo and Rust Tools: This system comes equipped with a variety of cargo and rust tools to ensure a smooth Rust development experience. Some of these tools include:

      • rust-analyzer
      • cargo-watch
      • cargo-deny
      • cargo-audit
      • cargo-update
      • cargo-edit
      • cargo-outdated
      • cargo-license
      • cargo-tarpaulin
      • cargo-cross
      • cargo-zigbuild
      • cargo-nextest
      • cargo-spellcheck
      • cargo-modules
      • cargo-bloat
      • cargo-unused-features
      • cargo-feature
      • cargo-features-manager
      • bacon
    5. Environment Setup: You can set up your Rust project environment on this system using nix develop or nix-shell with default.nix, shell.nix, or flake.nix to create a tailored environment for your Rust project (Also, I personally recommend using it alongside with direnv).

    🔑 Yubikey on NixOS

    This repo contains a NixOS configuration file (nixos/yubikey.nix) enabling:

    • Yubikey authentication with pam_u2f
    • Passwordless login in greetd, sudo, and hyprlock

    [!WARNING] While convenient, using a Yubikey for display managers (like greetd) and screen lockers (like hyprlock) without additional two-factor or multi-factor authentication (2FA/MFA) has risks. If your Yubikey is lost or stolen, someone could gain full system access before you reset keys. Yubikeys excel at protecting against online attacks but are less secure against offline attacks.

    [!TIP] For enhanced security and a passwordless experience: You can consider a YubiKey Bio Series device. These keys support FIDO2/WebAuthn and FIDO U2F and has built in fingerprint scanner for strong authentication. Please note, they do not offer Smart card, OpenPGP, or OTP functionality.

    📜 License

    This project is licensed under the MIT License - see the LICENSE file for details.