Awesome
简体中文(中国大陆) | English (UK)
<p align="center"><img src="https://user-images.githubusercontent.com/75824585/210402874-da3422d5-ab65-4975-b73a-c300065c6792.png" width=300px></p> <h2 align="center">Ruixi-rebirth's NixOS Config</h2> <p align="center"><img src="https://user-images.githubusercontent.com/75824585/196195007-ecebb290-2c6b-4fab-9e1e-2dbb12f7eb44.png" width=300px></p>系统组件
NixOS(Wayland) | Nixos(Xorg) | |
---|---|---|
Window Manager | Sway, Hyprland | bspwm |
Terminal Emulator | Kitty | Kitty |
Bar | Waybar | Polybar |
Application Launcher | Rofi-wayland | rofi |
Notification Daemon | Mako | Dunst |
Display Manager | None(TTY1 Login) | None(TTY1 Login) |
network management tool | NetworkManager | NetworkManager |
Input method framework | Fcitx5 | Fcitx5 |
System resource monitor | Btop | Btop |
File Manager | Ranger, Nemo | Ranger, Nemo |
Lockscreen | Swaylock-effects | i3lock-fancy |
Shell | Fish | Fish |
Music Player | mpd, ncmpcpp, mpc, Netease-cloud-music-gtk | mpd, ncmpcpp, mpc, Netease-cloud-music-gtk |
Media Player | mpv | mpv |
Text Editor | Neovim | Neovim |
Icons | Papirus | Papirus |
Fonts | Nerd fonts | Nerd fonts |
Image Viewer | imv | feh |
Screenshot Software | grimshot,grimblast | flameshot |
Screen Recording | wf-recorder, OBS | OBS |
Clipboard | wl-clipboard | xclip |
Color Picker | hyprpicker |
窗口管理器
sway & hyprland
sway 与 hyprland 外观一致,此处展示的是 hyprland
bspwm
动画极为流畅,只是录制视频有点卡卡的样子
主题
<details> <summary><b>Load</b> <span style="font-size:14px;">(Click to expand) </span> </summary>hyprland & sway
catppuccin-light
catppuccin-dark
nord
</details><details> <summary><b>Load</b> <span style="font-size:14px;">(Click to expand) </span> </summary> </details>bspwm
目录结构
├── blog
│ ├── archetypes
│ ├── assets
│ ├── content
│ ├── layouts
│ ├── static
│ └── themes
├── hosts
│ ├── laptop
│ └── server
├── modules
│ ├── desktop
│ ├── devlop
│ ├── editors
│ ├── environment
│ ├── fonts
│ ├── hardware
│ ├── programs
│ ├── scripts
│ ├── shell
│ ├── theme
│ └── virtualisation
├── overlays
│ ├── cinnamon.nemo
│ └── flameshot
├── pkgs
│ ├── catppuccin-cursors
│ ├── catppuccin-frappe-gtk
│ ├── catppuccin-latte-gtk
│ ├── fcitx5-pinyin-moegirl
│ ├── fcitx5-pinyin-zhwiki
│ ├── go-musicfox
│ └── swww
└── secrets
└── _public_keys_
如何安装?
最小安装(包含 wm,没有 tmpfs as root),前往此处
如何安装?(root on tmpfs)
- 准备一个 64 位的 nixos minimal iso image 烧录好,然后进入 live 系统。假设我已经分好两个分区
/dev/nvme0n1p1
/dev/nvme0n1p3
- 格式化分区
mkfs.fat -F 32 /dev/nvme0n1p1
mkfs.ext4 /dev/nvme0n1p3
- 挂载
mount -t tmpfs none /mnt
mkdir -p /mnt/{boot,nix,etc/nixos}
mount /dev/nvme0n1p3 /mnt/nix
mount /dev/nvme0n1p1 /mnt/boot
mkdir -p /mnt/nix/persist/etc/nixos
mount -o bind /mnt/nix/persist/etc/nixos /mnt/etc/nixos
- 生成一个基本的配置
nixos-generate-config --root /mnt
- 克隆仓库到本地
nix-shell -p git
git clone https://github.com/Ruixi-rebirth/flakes.git /mnt/etc/nixos/Flakes
cd /mnt/etc/nixos/Flakes/
nix develop --extra-experimental-features nix-command --extra-experimental-features flakes
- 将 /mnt/etc/nixos 中的
hardware-configuration.nix
拷贝到 /mnt/etc/nixos/Flakes/hosts/laptop/hardware-configuration.nix
cp /mnt/etc/nixos/hardware-configuration.nix /mnt/etc/nixos/Flakes/hosts/laptop/hardware-configuration.nix
- 修改被覆盖后的
hardware-configuration.nix
nvim /mnt/etc/nixos/Flakes/hosts/laptop/hardware-configuration.nix
...
#这只是一个例子
#请参考 `https://elis.nu/blog/2020/05/nixos-tmpfs-as-root/#step-4-1-configure-disks`
fileSystems."/" =
{ device = "none";
fsType = "tmpfs";
options = [ "defaults" "size=8G" "mode=755" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/49e24551-c0e0-48ed-833d-da8289d79cdd";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/3C0D-7D32";
fsType = "vfat";
};
fileSystems."/etc/nixos" =
{ device = "/nix/persist/etc/nixos";
fsType = "none";
options = [ "bind" ];
};
...
- 移除 '/mnt/etc/nixos/Flakes/.git'
rm -rf .git
-
用户名修改: 编辑
/mnt/etc/nixos/Flakes/flake.nix
修改 user 变量,主机名修改: 编辑/mnt/etc/nixos/Flakes/hosts/system.nix
修改 networking 属性组中的 hostName 值 -
使用
mkpasswd {PASSWORD} -m sha-512
命令生成的密码哈希串替换掉/mnt/etc/nixos/Flakes/hosts/laptop/wayland/default.nix
中的users.users.<name>.hashedPassword
值替换掉。(在文件中有两处需要替换的内容) -
选择 Window Manager
Hyprland: 如果 这行 和 这行 有注释, 则均取消注释, 并且注释掉下面涉及到 sway 的两行
Sway: 如果 这行 和 这行 有注释, 则均取消注释, 并且注释掉上面涉及到 hyprland 的两行
Bspwm: 默认
- 选择主题
Wayland
这里 任意选择一个
Xorg
nord: 默认
- 安装
nixos-install --no-root-passwd --flake .#laptop
#或者指定源:
nixos-install --option substituters "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" --no-root-passwd --flake .#laptop
- 重启
reboot
- 享受它吧!