简体中文(中国大陆) | English (UK)
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
a.mp4
sway 与 hyprland 外观一致,此处展示的是 hyprland
bspwm
动画极为流畅,只是录制视频有点卡卡的样子
2023-02-22.22-36-48.mp4
hyprland & sway
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),前往此处
- 准备一个 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
- 享受它吧!