1 Star 0 Fork 0

邓文漾/nixos-impermanent

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Hydenix+Impermance

This is my personal NixOS configuration repository.

[!WARNING] NixOS is not for beginners!!! Make sure you know what you are doing before executing anything!!!

Features

  1. Use impermanence for a minimal installation, guide by the great NixOS contributor: Vimjoyer's Perfect NixOS | impermanence Setup
  2. Use hydenix as the Hyperland desktop environment, it's a nixos implementation of hyprdots, a hyprland dotfiles configuration.
  3. Use thundertheidiot solution about persisting /etc/shadow file to allow users be able to change their password after the installation.

Looks like

How to use

Preperation

  1. Downloads the minimal ISO image from NixOS official page because the hydenix is designed based on the minimal installation.
  2. Use a tool like ventoy to build a NixOS usb boot driver.

Minimal Install

  1. Booting from the install medium

  2. git clone https://gitee.com/jackwenyoung/nixos-impermanence.git

  3. Run git checkout -b first-minimal --trace origin/first-minimal to check out to the first-minimal branch.

  4. Setup network

    1. Use wpa service
    sudo -i
    systemctl start wpa_supplicant.service
    wpa_cli
    add_network
    set_network 0 ssid "<Your Wifi Name>"
    set_network 0 psk "<Your Wifi Password>"
    enable_network 0
    <ctrl+d> to exit
    git clone https://gitee.com/jackwenyoung/nixos-impermanent.git
    
    1. (Optional)Setup Proxy if you have issue to connect Github, might need another computer with a proxy service like clash-verge.
    export HTTP_PROXY=http://proxy_ip:proxy_port
    export HTTPS_PROXY=http://proxy_ip:proxy_port
    export ALL_PROXY=http://proxy_ip:proxy_port
    
  5. Get the target disk name

    1. If you have multiple disks, you should run ls -l /dev/disk/by-id/ to get the unique name as the blue one in the screenshot below. The blue one for example: "nvme-ZHITAI_TiPro7000_1TB_ZTA21T0KA23433024L" is the device name you need.
    2. If you only have one disk, the short name should work, run lsblk to get it. It should look like "/dev/sda" or "/dev/nvme" etc.
    3. Why? Because if you have multiple disks, the short name might be changed on every time you boot the machine. And it would cause system fail to boot, trust me, I have experienced it.
  6. Run nix-shell -p vim to get vim or any other editor to edit the disko.nix file, replace the "device" to your device name.

  7. Run disko to destroy,format,mount the device as the command below.

    nix --experimental-features "nix-command flakes" run github:nix-community/disko -- \
    -m destroy,format,mount ./nixos-impermanent/disko.nix
    
    or
    
    nix --experimental-features "nix-command flakes" run github:nix-community/disko -- \
    -m destroy,format,mount ./nixos-impermanent/disko.nix --arg device '"<your-device-name>"'
    
  8. Run nixos-generate-config --no-filesystems --root /mnt to generate "configuration.nix" and "hardware-configuration.nix".

  9. Run cp -r ./nixos-impermanent /mnt/persist/nixos and you need to copy the generated "hardware-configuration.nix" to "/mnt/persist/nixos", you can't just use mine obviously.

  10. Modify the username, hostname, password, timezone and etc in /mnt/persist/nixos

  11. Finally, Install your brand new NixOS with command: nixos-install --root /mnt --flake /mnt/persist/nixos#default

Hydenix Install

  1. Run chown -R <your_user_name> /persist/nixos
  2. Check out to the "hydenix" branch with git checkout -b --track origin/hydenix
  3. Run sudo nixos-rebuild switch --flake /persist/nixos#<your-hostname> to install the hydenix
  4. Reboot and login with your initialPassword, remember using passwd <your-user-name> to change the password.
  5. Happy hacking🤭!

Thanks

  • Vimjoyer Youtube Channel, I learned a lot from his videos about NixOS.
  • hydenix, A great startup template for NixOS comes with beautiful and powerful presets.
  • HYDE, hydenix is the nix version of HYDE.
  • nix-starter-configs, I built my old NixOS based on this.
  • nvf, A good framework to build your own neovim mostly in nix. NixCats is also good, but I prefer to use nix rather than lua.
MIT License Copyright (c) 2025 邓文漾 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
Nix 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jackwenyoung/nixos-impermanent.git
git@gitee.com:jackwenyoung/nixos-impermanent.git
jackwenyoung
nixos-impermanent
nixos-impermanent
main

搜索帮助