(5 kde Plasma 桌面)nixos 从0实现全集 梦中情os

输入法

添加到 configuration.nix

1
2
3
4
5
6
7
  i18n.inputMethod = {
      enabled = "fcitx5";
      fcitx5.addons = with pkgs; [
          fcitx5-chinese-addons
          fcitx5-gtk
      ];
  };

启用桌面

添加到 configuration.nix

1
2
3
  services.xserver.enable = true;
  services.xserver.displayManager.sddm.enable = true;
  services.xserver.desktopManager.plasma5.enable = true; 

构建

plasma6 目前还在unstable阶段,并且确实很多插件都有问题,建议先用plasma5

1
sudo nixos-rebuild switch --option  substituters https://mirror.sjtu.edu.cn/nix-channels/store

但是 国内源很多有有问题,所以最好还是科学上网 如果构建中出问题需要更换源码,可以运行下面的命令清理后重新运行

1
sudo nix-collect-garbage -d

一个单独configuration.nix 带plasma6 但是 没有带flakes的实例

 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{ 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 joyanhui@qq.com"
];

  users.users.yh.openssh.authorizedKeys.keys = [
    "ssh-rsa XXXXX joyanhui@qq.com"
  ];

  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"; 

}

构建

1
2
3
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
Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计