2025-04-15 发表2025-04-19 更新2 分钟读完 (大约297个字) 0 次访问
安装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
在/etc/nixos/configuration.nix
中添加如下代码,启用flatpak
1 2 3 4 xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ]; xdg.portal.enable = true ; services.flatpak.enable = true ;
启用蓝牙
1 2 hardware.bluetooth.enable = true ; hardware.bluetooth.powerOnBoot = true ;
启用系统级工具
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 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 fcitx5-chinese-addons fcitx5-nord 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 2 3 4 5 6 7 8 9 networking.networkmanager.enable = true ; networking.networkmanager.dns = "none" ; networking.nameservers = [ "223.5.5.5" "8.8.8.8" "114.114.114.114" ];
更新系统执行sudo nixos-rebuild switch
更新系统
修改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