目录

安装nixos后要做的事情

更新channel源

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
  # flatpak support
  xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ];
  xdg.portal.enable = true;
  services.flatpak.enable = true;
  1. 启用蓝牙
hardware.bluetooth.enable = true; # enables support for Bluetooth
hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot
  1. 启用系统级工具
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. 安装字体及输入法
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. 配置网络
  # 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源,并安装常用软件

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

flatpak install flathub md.obsidian.Obsidian

其他参考网站

包搜索

删除历史版本

nixos-rebuild list-generations
sudo nix-collect-garbage -d
sudo nixos-rebuild boot