安装nixos后要做的事情

更新channel源

1
2
sudo nix-channel --add https://mirrors.tuna.tsinghua.edu.cn/nix-channels/nixos-24.11 nixos
sudo nix-channel --update

注意修改nixos-24.11到匹配的版本

启用flatpak

  1. /etc/nixos/configuration.nix中添加如下代码,启用flatpak
1
2
3
4
# flatpak support
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ];
xdg.portal.enable = true;
services.flatpak.enable = true;
  1. 启用蓝牙
1
2
hardware.bluetooth.enable = true; # enables support for Bluetooth
hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot
  1. 启用系统级工具
1
2
3
4
5
6
7
8
9
10
11
12
13
environment.systemPackages = with pkgs; [
vim
wget
pkgs.git
pkgs.nodejs_20
pkgs.texliveSmall
cpkgs.hexo-cli
pkgs.pandoc
pkgs.vscode
pkgs.microsoft-edge
pkgs.texliveSmall

];
  1. 安装字体及输入法
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
i18n.inputMethod = {

enable = true;
type = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-gtk # alternatively, kdePackages.fcitx5-qt
fcitx5-chinese-addons # table input method support
fcitx5-nord # a color theme
fcitx5-fluent
fcitx5-material-color
rime-data
fcitx5-rime
];

};

fonts = {
packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
source-code-pro
hack-font
jetbrains-mono
];
};

  1. 配置网络
1
2
3
4
5
6
7
8
9
# Enable networking
networking.networkmanager.enable = true;
networking.networkmanager.dns = "none";
networking.nameservers = [
"223.5.5.5"
"8.8.8.8"
"114.114.114.114"
];

  1. 更新系统执行sudo nixos-rebuild switch更新系统

  2. 修改flatpak源,并安装常用软件

1
2
3
4
sudo flatpak remote-modify flathub --url=https://mirrors.ustc.edu.cn/flathub

flatpak install flathub md.obsidian.Obsidian

其他参考网站

包搜索

删除历史版本

1
2
3
nixos-rebuild list-generations
sudo nix-collect-garbage -d
sudo nixos-rebuild boot
作者

Mixion

发布于

2025-04-15

更新于

2025-04-19

许可协议