mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-02-24 17:04:48 +01:00
179 lines
4.2 KiB
Nix
179 lines
4.2 KiB
Nix
{ config, pkgs, ... }:
|
||
|
||
{
|
||
# enable flakes globally
|
||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||
|
||
# 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";
|
||
};
|
||
|
||
# Enable CUPS to print documents.
|
||
services.printing.enable = true;
|
||
|
||
|
||
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
|
||
|
||
# normal fonts
|
||
noto-fonts
|
||
noto-fonts-cjk
|
||
noto-fonts-emoji
|
||
|
||
# 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 = {
|
||
serif = [ "Noto Serif" "Noto Color Emoji" ];
|
||
sansSerif = [ "Noto Sans" "Noto Color Emoji" ];
|
||
monospace = [ "JetBrainsMono Nerd Font" "Noto Color Emoji" ];
|
||
emoji = [ "Noto Color Emoji" ];
|
||
};
|
||
};
|
||
|
||
programs.dconf.enable = true;
|
||
|
||
# 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;
|
||
};
|
||
|
||
# Allow unfree packages
|
||
nixpkgs.config.allowUnfree = true;
|
||
|
||
# List packages installed in system profile. To search, run:
|
||
# $ nix search wget
|
||
environment.systemPackages = with pkgs; [
|
||
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||
wget
|
||
curl
|
||
git
|
||
|
||
# networking tools
|
||
ethtool
|
||
iperf3
|
||
nmap
|
||
socat
|
||
|
||
# system tools
|
||
sysstat
|
||
lm_sensors # for `sensors` command
|
||
|
||
# misc
|
||
findutils
|
||
file
|
||
which
|
||
tree
|
||
gnused
|
||
gnutar
|
||
gawk
|
||
p7zip
|
||
xz
|
||
zstd
|
||
|
||
# video/audio tools
|
||
libva-utils
|
||
nvtop
|
||
vdpauinfo
|
||
vulkan-tools
|
||
glxinfo
|
||
glmark2
|
||
|
||
# minimal screen capture tool, used by i3 blur lock to take a screenshot
|
||
# print screen key is also bound to this tool in i3 config
|
||
scrot
|
||
|
||
neofetch
|
||
xfce.thunar # xfce4's file manager
|
||
nnn # terminal file manager
|
||
];
|
||
|
||
|
||
# Enable sound with pipewire.
|
||
sound.enable = true;
|
||
hardware.pulseaudio.enable = false;
|
||
|
||
# security with polkit
|
||
services.power-profiles-daemon = {
|
||
enable = true;
|
||
};
|
||
security.polkit.enable = true;
|
||
# security with gnome-kering
|
||
services.gnome.gnome-keyring.enable = true;
|
||
security.pam.services.greetd.enableGnomeKeyring = true;
|
||
|
||
services = {
|
||
dbus.packages = [ pkgs.gcr ];
|
||
|
||
geoclue2.enable = true;
|
||
|
||
pipewire = {
|
||
enable = true;
|
||
alsa.enable = true;
|
||
alsa.support32Bit = true;
|
||
pulse.enable = true;
|
||
# If you want to use JACK applications, uncomment this
|
||
jack.enable = true;
|
||
|
||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||
# no need to redefine it in your config for now)
|
||
#media-session.enable = true;
|
||
};
|
||
|
||
udev.packages = with pkgs; [
|
||
gnome.gnome-settings-daemon
|
||
platformio # udev rules for platformio
|
||
];
|
||
};
|
||
|
||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||
users.users.ryan = {
|
||
isNormalUser = true;
|
||
description = "ryan";
|
||
extraGroups = [ "networkmanager" "wheel" "docker" "wireshark" ];
|
||
openssh.authorizedKeys.keys = [
|
||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJx3Sk20pLL1b2PPKZey2oTyioODrErq83xG78YpFBoj admin@ryan-MBP"
|
||
];
|
||
};
|
||
} |