Home

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 ManagerSway, Hyprlandbspwm
Terminal EmulatorKittyKitty
BarWaybarPolybar
Application LauncherRofi-waylandrofi
Notification DaemonMakoDunst
Display ManagerNone(TTY1 Login)None(TTY1 Login)
network management toolNetworkManagerNetworkManager
Input method frameworkFcitx5Fcitx5
System resource monitorBtopBtop
File ManagerRanger, NemoRanger, Nemo
LockscreenSwaylock-effectsi3lock-fancy
ShellFishFish
Music Playermpd, ncmpcpp, mpc, Netease-cloud-music-gtkmpd, ncmpcpp, mpc, Netease-cloud-music-gtk
Media Playermpvmpv
Text EditorNeovimNeovim
IconsPapirusPapirus
FontsNerd fontsNerd fonts
Image Viewerimvfeh
Screenshot Softwaregrimshot,grimblastflameshot
Screen Recordingwf-recorder, OBSOBS
Clipboardwl-clipboardxclip
Color Pickerhyprpicker

窗口管理器

sway & hyprland

https://user-images.githubusercontent.com/75824585/201473117-578af0df-e4ea-4dc9-91a6-c30281d46e7a.mp4

sway 与 hyprland 外观一致,此处展示的是 hyprland

bspwm

动画极为流畅,只是录制视频有点卡卡的样子

https://user-images.githubusercontent.com/75824585/220659189-be78cf81-0b8c-4865-a777-74febef8edcc.mp4

主题

hyprland & sway

<details> <summary><b>Load</b> <span style="font-size:14px;">(Click to expand) </span> </summary>

catppuccin-light 2023-01-12T02:21:59

catppuccin-dark 2023-01-12T03:00:29

nord 2023-01-17T00:15:22

</details>

bspwm

<details> <summary><b>Load</b> <span style="font-size:14px;">(Click to expand) </span> </summary>

2023-02-22_21-30

</details>

目录结构

├── 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)

  1. 准备一个 64 位的 nixos minimal iso image 烧录好,然后进入 live 系统。假设我已经分好两个分区/dev/nvme0n1p1 /dev/nvme0n1p3
  2. 格式化分区
  mkfs.fat -F 32 /dev/nvme0n1p1
  mkfs.ext4 /dev/nvme0n1p3
  1. 挂载
  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
  1. 生成一个基本的配置
  nixos-generate-config --root /mnt
  1. 克隆仓库到本地
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
  1. 将 /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
  1. 修改被覆盖后的 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" ];
    };
...
  1. 移除 '/mnt/etc/nixos/Flakes/.git'
rm -rf .git
  1. 用户名修改: 编辑 /mnt/etc/nixos/Flakes/flake.nix 修改 user 变量,主机名修改: 编辑 /mnt/etc/nixos/Flakes/hosts/system.nix 修改 networking 属性组中的 hostName

  2. 使用 mkpasswd {PASSWORD} -m sha-512 命令生成的密码哈希串替换掉 /mnt/etc/nixos/Flakes/hosts/laptop/wayland/default.nix 中的 users.users.<name>.hashedPassword 值替换掉。(在文件中有两处需要替换的内容)

  3. 选择 Window Manager

    Wayland: 这行这行 取消注释, 并且注释 这行这行

Hyprland: 如果 这行这行 有注释, 则均取消注释, 并且注释掉下面涉及到 sway 的两行

Sway: 如果 这行这行 有注释, 则均取消注释, 并且注释掉上面涉及到 hyprland 的两行

Xorg: 这行这行 取消注释, 并且注释 这行这行

Bspwm: 默认

  1. 选择主题

    Wayland

这里 任意选择一个

Xorg

nord: 默认

  1. 安装
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
  1. 重启
reboot
  1. 享受它吧!