(5 kde Plasma 桌面)nixos 从0实现全集 梦中情os
nixos
#输入法
添加到 configuration.nix
nix
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-chinese-addons
fcitx5-gtk
];
};
#启用桌面
添加到 configuration.nix
nix
services.xserver.enable = true;
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
#构建
plasma6 目前还在unstable阶段,并且确实很多插件都有问题,建议先用plasma5
nix
sudo nixos-rebuild switch --option substituters https://mirror.sjtu.edu.cn/nix-channels/store
但是 国内源很多有有问题,所以最好还是科学上网
如果构建中出问题需要更换源码,可以运行下面的命令清理后重新运行
sh
sudo nix-collect-garbage -d
#一个单独configuration.nix 带plasma6 但是 没有带flakes的实例
nix
{ config, lib, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
nix.settings.substituters = [ "https://mirrors.ustc.edu.cn/nix-channels/store" ];
nixpkgs.config.allowUnfree = true;
networking.hostName = "nixos"; # Define your hostname.
time.timeZone = "Asia/Shanghai";
virtualisation.vmware.guest.enable = true;
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-chinese-addons
fcitx5-gtk
];
};
services.xserver.enable = true;
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma6.enable = true;
sound.enable = true;
users.mutableUsers = false; # 禁止useradd添加用户
#security.sudo.wheelNeedsPassword = false;
users.users.yh= { #用户名是yh
isNormalUser = true;
hashedPassword = "$y$j9T$I9BXOYYJGTV/Yx5hM7YmJ/$0Mhrve6QTJW4qZtBHRqUG7dJnXWRmdjwkFkNMM0ARA3";
extraGroups = [
"wheel"
"users"
];
};
environment.systemPackages = with pkgs; [
wget
curl
unzip
zsh
ntfs3g
wqy_zenhei
kitty
microsoft-edge
];
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys = [
"ssh-rsa XXXXX [email protected]"
];
users.users.yh.openssh.authorizedKeys.keys = [
"ssh-rsa XXXXX [email protected]"
];
programs.wayfire = {
enable = true;
plugins = with pkgs.wayfirePlugins; [
wcm
wf-shell
wayfire-plugins-extra
];
};
users.defaultUserShell = pkgs.zsh;
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
};
#history.size = 10000;
#history.path = "${config.xdg.dataHome}/zsh/history";
};
system.stateVersion = "23.11";
}
构建
sh
nix-channel --add https://mirrors.ustc.edu.cn/nix-channels/nixpkgs-unstable nixos
nix-channel --update
sudo nixos-rebuild switch --option substituters https://mirrors.ustc.edu.cn/nix-channels/store