mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-18 07:13:44 +01:00
110 lines
3.3 KiB
Nix
110 lines
3.3 KiB
Nix
{ config, pkgs, devenv, ... }:
|
||
|
||
{
|
||
# for nix server, we do not need to keep too much generations
|
||
boot.loader.systemd-boot.configurationLimit = 10;
|
||
# boot.loader.grub.configurationLimit = 10;
|
||
# do garbage collection weekly to keep disk usage low
|
||
nix.gc = {
|
||
automatic = true;
|
||
dates = "weekly";
|
||
options = "--delete-older-than 1w";
|
||
};
|
||
|
||
# Manual optimise storage: nix-store --optimise
|
||
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store
|
||
auto-optimise-store = true;
|
||
|
||
# enable flakes globally
|
||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||
|
||
# Allow unfree packages
|
||
nixpkgs.config.allowUnfree = true;
|
||
|
||
# Set your time zone.
|
||
time.timeZone = "Asia/Shanghai";
|
||
|
||
# Select internationalisation properties.
|
||
i18n.defaultLocale = "en_US.UTF-8";
|
||
|
||
i18n.extraLocaleSettings = {
|
||
LC_ADDRESS = "zh_CN.UTF-8";
|
||
LC_IDENTIFICATION = "zh_CN.UTF-8";
|
||
LC_MEASUREMENT = "zh_CN.UTF-8";
|
||
LC_MONETARY = "zh_CN.UTF-8";
|
||
LC_NAME = "zh_CN.UTF-8";
|
||
LC_NUMERIC = "zh_CN.UTF-8";
|
||
LC_PAPER = "zh_CN.UTF-8";
|
||
LC_TELEPHONE = "zh_CN.UTF-8";
|
||
LC_TIME = "zh_CN.UTF-8";
|
||
};
|
||
|
||
# all fonts are linked to /nix/var/nix/profiles/system/sw/share/X11/fonts
|
||
fonts = {
|
||
# use fonts specified by user rather than default ones
|
||
enableDefaultFonts = false;
|
||
fontDir.enable = true;
|
||
|
||
fonts = with pkgs; [
|
||
# icon fonts
|
||
material-design-icons
|
||
font-awesome
|
||
|
||
# 思源系列字体是 Adobe 主导的。其中汉字部分被称为「思源黑体」和「思源宋体」,是由 Adobe + Google 共同开发的
|
||
source-sans # 无衬线字体,不含汉字。字族名叫 Source Sans 3 和 Source Sans Pro,以及带字重的变体,加上 Source Sans 3 VF
|
||
source-han-sans # 思源黑体
|
||
|
||
# nerdfonts
|
||
(nerdfonts.override { fonts = [
|
||
"FiraCode"
|
||
"JetBrainsMono"
|
||
"Iosevka"
|
||
];})
|
||
];
|
||
|
||
# user defined fonts
|
||
# the reason there's Noto Color Emoji everywhere is to override DejaVu's
|
||
# B&W emojis that would sometimes show instead of some Color emojis
|
||
fontconfig.defaultFonts = {
|
||
sansSerif = [ "Noto Sans" "Noto Color Emoji" ];
|
||
monospace = [ "JetBrainsMono Nerd Font" "Noto Color Emoji" ];
|
||
emoji = [ "Noto Color Emoji" ];
|
||
};
|
||
};
|
||
|
||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||
# Or disable the firewall altogether.
|
||
networking.firewall.enable = false;
|
||
|
||
# Enable the OpenSSH daemon.
|
||
services.openssh = {
|
||
enable = true;
|
||
settings = {
|
||
X11Forwarding = true;
|
||
PermitRootLogin = "no"; # disable root login
|
||
PasswordAuthentication = false; # disable password login
|
||
};
|
||
openFirewall = true;
|
||
};
|
||
|
||
# List packages installed in system profile. To search, run:
|
||
# $ nix search wget
|
||
environment.systemPackages = with pkgs; [
|
||
neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||
wget
|
||
curl
|
||
aria2
|
||
git # used by nix flakes
|
||
git-lfs # used by huggingface models
|
||
];
|
||
|
||
# replace default editor with neovim
|
||
environment.variables.EDITOR = "nvim";
|
||
|
||
# for power management
|
||
services.power-profiles-daemon = {
|
||
enable = true;
|
||
};
|
||
services.upower.enable = true;
|
||
} |