• 社区首页
  • 版块
我的 NixOS 配置文件
深度杂谈475个浏览 ·3个评论
电梯直达到第
lookfor
deepin^4
发表于2020-09-25 04:13
楼主
本帖最后由 lookfor 于 2020-10-6 19:25 编辑
  1. # Edit this configuration file to define what should be installed on
  2. # your system.  Help is available in the configuration.nix(5) man page
  3. # and in the NixOS manual (accessible by running ‘nixos-help’).

  4. { config, pkgs, ... }:

  5. {
  6.         imports =
  7.                 [ # Include the results of the hardware scan.
  8.                 ./hardware-configuration.nix
  9.                 ];

  10.         nix.binaryCaches = [ "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" "https://cache.nixos.org/" ];

  11. # Use the GRUB 2 boot loader.
  12.         boot.loader.grub.enable = true;
  13.         boot.loader.grub.version = 2;
  14. # boot.loader.grub.efiSupport = true;
  15. # boot.loader.grub.efiInstallAsRemovable = true;
  16. # boot.loader.efi.efiSysMountPoint = "/boot/efi";
  17.         boot.loader.grub.useOSProber = true;
  18. # Define on which hard drive you want to install Grub.
  19.         boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only

  20. # networking.hostName = "nixos"; # Define your hostname.
  21. # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

  22. # The global useDHCP flag is deprecated, therefore explicitly set to false here.
  23. # Per-interface useDHCP will be mandatory in the future, so this generated config
  24. # replicates the default behaviour.
  25. #networking.useDHCP = false;
  26. # networking.interfaces.enp1s0.useDHCP = true;
  27. # networking.interfaces.wlp2s0.useDHCP = true;
  28.                 networking.networkmanager.enable = true;

  29. # Configure network proxy if necessary
  30. # networking.proxy.default = "http://user:password@proxy:port/";
  31. # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  32. # Select internationalisation properties.
  33.         i18n = {
  34.                 defaultLocale = "zh_CN.UTF-8";
  35.                 supportedLocales = [ "zh_CN.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" ];
  36.                 inputMethod.enabled = "fcitx";
  37.                 inputMethod.fcitx.engines = with pkgs.fcitx-engines; [ rime ];
  38.         };

  39. # Set your time zone.
  40.         time.timeZone = "Asia/Shanghai";

  41. # List packages installed in system profile. To search, run:
  42. # $ nix search wget
  43.         nixpkgs.config.allowUnfree = true;  

  44.         environment.systemPackages = with pkgs; [
  45.                           wget vim konsole firefox chromium
  46.                         fcitx fcitx-configtool fcitx-engines.rime
  47.                         zsh oh-my-zsh git
  48.         ];

  49.         fonts = {
  50.                 fontconfig.enable = true;
  51.                 enableFontDir = true;
  52.                 enableGhostscriptFonts = true;
  53.                 fonts = with pkgs; [
  54.                         noto-fonts
  55.                                 noto-fonts-cjk
  56.                                 noto-fonts-emoji
  57.                                 wqy_microhei
  58.                                 wqy_zenhei
  59.                 ];
  60.         };


  61. # Enable zsh
  62.         programs.zsh.enable = true;

  63. # Enable Oh-my-zsh
  64.         programs.zsh.ohMyZsh = {
  65.                 enable = true;
  66.                 plugins = ["z" ];
  67.                 theme = "robbyrussell";
  68.         };

  69. # Some programs need SUID wrappers, can be configured further or are
  70. # started in user sessions.
  71. # programs.mtr.enable = true;
  72. # programs.gnupg.agent = {
  73. #   enable = true;
  74. #   enableSSHSupport = true;
  75. #   pinentryFlavor = "gnome3";
  76. # };

  77. # List services that you want to enable:

  78. # Enable the OpenSSH daemon.
  79. # services.openssh.enable = true;

  80. # Open ports in the firewall.
  81. # networking.firewall.allowedTCPPorts = [ ... ];
  82. # networking.firewall.allowedUDPPorts = [ ... ];
  83. # Or disable the firewall altogether.
  84. # networking.firewall.enable = false;

  85. # Enable CUPS to print documents.
  86. # services.printing.enable = true;

  87. # Enable sound.
  88.         sound.enable = true;
  89.         hardware.pulseaudio.enable = true;

  90. # Enable the X11 windowing system.
  91.         services.xserver.enable = true;
  92.         services.xserver.layout = "us";
  93. # services.xserver.xkbOptions = "eurosign:e";

  94. # Enable touchpad support.
  95. # services.xserver.libinput.enable = true;

  96. # Enable the KDE Desktop Environment.
  97.         services.xserver.displayManager.sddm.enable = true;
  98.         services.xserver.desktopManager.plasma5.enable = true;

  99. # Define a user account. Don't forget to set a password with ‘passwd’.
  100.         users.users.her = {
  101.                 isNormalUser = true;
  102.                 extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
  103.                         shell = pkgs.zsh;
  104.         };

  105. # This value determines the NixOS release from which the default
  106. # settings for stateful data, like file locations and database versions
  107. # on your system were taken. It‘s perfectly fine and recommended to leave
  108. # this value at the release version of the first install of this system.
  109. # Before changing this value read the documentation for this option
  110. # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  111.         system.stateVersion = "20.03"; # Did you read the comment?


  112. }
Copy the Code



回复收藏只看作者
所有回复
lookfor
deepin^4
发表于2020-09-25 04:16
沙发
配置 oh-my-zsh
  1. sudo ln -s /etc/zshrc .zshrc
Copy the Code
lookfor
deepin^4
发表于2020-09-25 04:36
板凳
dororo2020
deepin^2
发表于2020-09-25 06:01
地板
爱了爱了
发布帖子

光荣榜

  • 周榜
  • 月榜
  • 总榜