mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-31 06:33:07 +02:00
feat: add comments, format all nix files
This commit is contained in:
@@ -50,11 +50,13 @@
|
||||
font-awesome
|
||||
|
||||
# nerdfonts
|
||||
(nerdfonts.override { fonts = [
|
||||
"FiraCode"
|
||||
"JetBrainsMono"
|
||||
"Iosevka"
|
||||
];})
|
||||
(nerdfonts.override {
|
||||
fonts = [
|
||||
"FiraCode"
|
||||
"JetBrainsMono"
|
||||
"Iosevka"
|
||||
];
|
||||
})
|
||||
|
||||
];
|
||||
};
|
||||
@@ -64,4 +66,4 @@
|
||||
home = "/Users/admin";
|
||||
description = "admin";
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,23 +57,25 @@
|
||||
# Noto 系列字体是 Google 主导的,名字的含义是「没有豆腐」(no tofu),因为缺字时显示的方框或者方框被叫作 tofu
|
||||
# Noto 系列字族名只支持英文,命名规则是 Noto + Sans 或 Serif + 文字名称。
|
||||
# 其中汉字部分叫 Noto Sans/Serif CJK SC/TC/HK/JP/KR,最后一个词是地区变种。
|
||||
noto-fonts # 大部分文字的常见样式,不包含汉字
|
||||
noto-fonts-cjk # 汉字部分
|
||||
noto-fonts-emoji # 彩色的表情符号字体
|
||||
noto-fonts-extra # 提供额外的字重和宽度变种
|
||||
noto-fonts # 大部分文字的常见样式,不包含汉字
|
||||
noto-fonts-cjk # 汉字部分
|
||||
noto-fonts-emoji # 彩色的表情符号字体
|
||||
noto-fonts-extra # 提供额外的字重和宽度变种
|
||||
|
||||
# 思源系列字体是 Adobe 主导的。其中汉字部分被称为「思源黑体」和「思源宋体」,是由 Adobe + Google 共同开发的
|
||||
source-sans # 无衬线字体,不含汉字。字族名叫 Source Sans 3 和 Source Sans Pro,以及带字重的变体,加上 Source Sans 3 VF
|
||||
source-serif # 衬线字体,不含汉字。字族名叫 Source Code Pro,以及带字重的变体
|
||||
source-han-sans # 思源黑体
|
||||
source-han-serif # 思源宋体
|
||||
source-sans # 无衬线字体,不含汉字。字族名叫 Source Sans 3 和 Source Sans Pro,以及带字重的变体,加上 Source Sans 3 VF
|
||||
source-serif # 衬线字体,不含汉字。字族名叫 Source Code Pro,以及带字重的变体
|
||||
source-han-sans # 思源黑体
|
||||
source-han-serif # 思源宋体
|
||||
|
||||
# nerdfonts
|
||||
(nerdfonts.override { fonts = [
|
||||
"FiraCode"
|
||||
"JetBrainsMono"
|
||||
"Iosevka"
|
||||
];})
|
||||
(nerdfonts.override {
|
||||
fonts = [
|
||||
"FiraCode"
|
||||
"JetBrainsMono"
|
||||
"Iosevka"
|
||||
];
|
||||
})
|
||||
|
||||
(pkgs.callPackage ../../fonts/icomoon-feather-icon-font.nix { })
|
||||
|
||||
@@ -105,7 +107,7 @@
|
||||
enable = true;
|
||||
settings = {
|
||||
X11Forwarding = true;
|
||||
PermitRootLogin = "no"; # disable root login
|
||||
PermitRootLogin = "no"; # disable root login
|
||||
PasswordAuthentication = false; # disable password login
|
||||
};
|
||||
openFirewall = true;
|
||||
@@ -122,8 +124,8 @@
|
||||
neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||
wget
|
||||
curl
|
||||
git # used by nix flakes
|
||||
git-lfs # used by huggingface models
|
||||
git # used by nix flakes
|
||||
git-lfs # used by huggingface models
|
||||
|
||||
devenv.packages."${pkgs.system}".devenv
|
||||
|
||||
@@ -143,14 +145,16 @@
|
||||
}))
|
||||
|
||||
# create a fhs environment by command `fhs`, so we can run non-nixos packages in nixos!
|
||||
(let base = pkgs.appimageTools.defaultFhsEnvArgs; in
|
||||
pkgs.buildFHSUserEnv (base // {
|
||||
name = "fhs";
|
||||
targetPkgs = pkgs: (base.targetPkgs pkgs) ++ [pkgs.pkg-config];
|
||||
profile = "export FHS=1";
|
||||
runScript = "bash";
|
||||
extraOutputsToInstall = ["dev"];
|
||||
}))
|
||||
(
|
||||
let base = pkgs.appimageTools.defaultFhsEnvArgs; in
|
||||
pkgs.buildFHSUserEnv (base // {
|
||||
name = "fhs";
|
||||
targetPkgs = pkgs: (base.targetPkgs pkgs) ++ [ pkgs.pkg-config ];
|
||||
profile = "export FHS=1";
|
||||
runScript = "bash";
|
||||
extraOutputsToInstall = [ "dev" ];
|
||||
})
|
||||
)
|
||||
];
|
||||
|
||||
# replace default editor with neovim
|
||||
@@ -182,16 +186,16 @@
|
||||
|
||||
# enable bluetooth & gui paring tools - blueman
|
||||
# or you can use cli:
|
||||
# $ bluetoothctl
|
||||
# [bluetooth] # power on
|
||||
# [bluetooth] # agent on
|
||||
# [bluetooth] # default-agent
|
||||
# [bluetooth] # scan on
|
||||
# ...put device in pairing mode and wait [hex-address] to appear here...
|
||||
# [bluetooth] # pair [hex-address]
|
||||
# [bluetooth] # connect [hex-address]
|
||||
# Bluetooth devices automatically connect with bluetoothctl as well:
|
||||
# [bluetooth] # trust [hex-address]
|
||||
# $ bluetoothctl
|
||||
# [bluetooth] # power on
|
||||
# [bluetooth] # agent on
|
||||
# [bluetooth] # default-agent
|
||||
# [bluetooth] # scan on
|
||||
# ...put device in pairing mode and wait [hex-address] to appear here...
|
||||
# [bluetooth] # pair [hex-address]
|
||||
# [bluetooth] # connect [hex-address]
|
||||
# Bluetooth devices automatically connect with bluetoothctl as well:
|
||||
# [bluetooth] # trust [hex-address]
|
||||
hardware.bluetooth.enable = true;
|
||||
services.blueman.enable = true;
|
||||
|
||||
@@ -212,9 +216,9 @@
|
||||
|
||||
geoclue2.enable = true;
|
||||
|
||||
udev.packages = with pkgs; [
|
||||
udev.packages = with pkgs; [
|
||||
gnome.gnome-settings-daemon
|
||||
platformio # udev rules for platformio
|
||||
platformio # udev rules for platformio
|
||||
android-udev-rules
|
||||
];
|
||||
};
|
||||
@@ -235,8 +239,8 @@
|
||||
# and vscode has open like `External Uri Openers`
|
||||
xdgOpenUsePortal = false;
|
||||
extraPortals = with pkgs; [
|
||||
xdg-desktop-portal-wlr # for wlroots based compositors(hyprland/sway)
|
||||
xdg-desktop-portal-gtk # for gtk
|
||||
xdg-desktop-portal-wlr # for wlroots based compositors(hyprland/sway)
|
||||
xdg-desktop-portal-gtk # for gtk
|
||||
# xdg-desktop-portal-kde # for kde
|
||||
];
|
||||
};
|
||||
@@ -251,4 +255,4 @@
|
||||
|
||||
# for power management
|
||||
services.upower.enable = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,15 +51,17 @@
|
||||
font-awesome
|
||||
|
||||
# 思源系列字体是 Adobe 主导的。其中汉字部分被称为「思源黑体」和「思源宋体」,是由 Adobe + Google 共同开发的
|
||||
source-sans # 无衬线字体,不含汉字。字族名叫 Source Sans 3 和 Source Sans Pro,以及带字重的变体,加上 Source Sans 3 VF
|
||||
source-han-sans # 思源黑体
|
||||
source-sans # 无衬线字体,不含汉字。字族名叫 Source Sans 3 和 Source Sans Pro,以及带字重的变体,加上 Source Sans 3 VF
|
||||
source-han-sans # 思源黑体
|
||||
|
||||
# nerdfonts
|
||||
(nerdfonts.override { fonts = [
|
||||
"FiraCode"
|
||||
"JetBrainsMono"
|
||||
"Iosevka"
|
||||
];})
|
||||
(nerdfonts.override {
|
||||
fonts = [
|
||||
"FiraCode"
|
||||
"JetBrainsMono"
|
||||
"Iosevka"
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
# user defined fonts
|
||||
@@ -82,7 +84,7 @@
|
||||
enable = true;
|
||||
settings = {
|
||||
X11Forwarding = true;
|
||||
PermitRootLogin = "no"; # disable root login
|
||||
PermitRootLogin = "no"; # disable root login
|
||||
PasswordAuthentication = false; # disable password login
|
||||
};
|
||||
openFirewall = true;
|
||||
@@ -95,8 +97,8 @@
|
||||
wget
|
||||
curl
|
||||
aria2
|
||||
git # used by nix flakes
|
||||
git-lfs # used by huggingface models
|
||||
git # used by nix flakes
|
||||
git-lfs # used by huggingface models
|
||||
];
|
||||
|
||||
# replace default editor with neovim
|
||||
@@ -107,4 +109,4 @@
|
||||
enable = true;
|
||||
};
|
||||
services.upower.enable = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,20 +7,22 @@
|
||||
|
||||
{
|
||||
system.fsPackages = [ pkgs.bindfs ];
|
||||
fileSystems = let
|
||||
mkRoSymBind = path: {
|
||||
device = path;
|
||||
fsType = "fuse.bindfs";
|
||||
options = [ "ro" "resolve-symlinks" "x-gvfs-hide" ];
|
||||
fileSystems =
|
||||
let
|
||||
mkRoSymBind = path: {
|
||||
device = path;
|
||||
fsType = "fuse.bindfs";
|
||||
options = [ "ro" "resolve-symlinks" "x-gvfs-hide" ];
|
||||
};
|
||||
aggregatedFonts = pkgs.buildEnv {
|
||||
name = "system-fonts";
|
||||
paths = config.fonts.fonts;
|
||||
pathsToLink = [ "/share/fonts" ];
|
||||
};
|
||||
in
|
||||
{
|
||||
# Create an FHS mount to support flatpak host icons/fonts
|
||||
"/usr/share/icons" = mkRoSymBind (config.system.path + "/share/icons");
|
||||
"/usr/share/fonts" = mkRoSymBind (aggregatedFonts + "/share/fonts");
|
||||
};
|
||||
aggregatedFonts = pkgs.buildEnv {
|
||||
name = "system-fonts";
|
||||
paths = config.fonts.fonts;
|
||||
pathsToLink = [ "/share/fonts" ];
|
||||
};
|
||||
in {
|
||||
# Create an FHS mount to support flatpak host icons/fonts
|
||||
"/usr/share/icons" = mkRoSymBind (config.system.path + "/share/icons");
|
||||
"/usr/share/fonts" = mkRoSymBind (aggregatedFonts + "/share/fonts");
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
];
|
||||
|
||||
# flatpack is recommended to install other apps such as netease-cloud-music/qqmusic/...
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{pkgs, ...}:
|
||||
{ pkgs, ... }:
|
||||
|
||||
|
||||
{
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
nvidiaPatches = true;
|
||||
};
|
||||
programs.light.enable = true; # monitor backlight control
|
||||
programs.light.enable = true; # monitor backlight control
|
||||
|
||||
|
||||
# thunar file manager(part of xfce) related options
|
||||
@@ -48,29 +48,29 @@
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
waybar # the status bar
|
||||
swaybg # the wallpaper
|
||||
swayidle # the idle timeout
|
||||
swaylock # locking the screen
|
||||
wlogout # logout menu
|
||||
wl-clipboard # copying and pasting
|
||||
waybar # the status bar
|
||||
swaybg # the wallpaper
|
||||
swayidle # the idle timeout
|
||||
swaylock # locking the screen
|
||||
wlogout # logout menu
|
||||
wl-clipboard # copying and pasting
|
||||
|
||||
wf-recorder # creen recording
|
||||
grim # taking screenshots
|
||||
slurp # selecting a region to screenshot
|
||||
wf-recorder # creen recording
|
||||
grim # taking screenshots
|
||||
slurp # selecting a region to screenshot
|
||||
# TODO replace by `flameshot gui --raw | wl-copy`
|
||||
|
||||
wofi # A rofi inspired launcher for wlroots compositors such as sway/hyprland
|
||||
mako # the notification daemon, the same as dunst
|
||||
wofi # A rofi inspired launcher for wlroots compositors such as sway/hyprland
|
||||
mako # the notification daemon, the same as dunst
|
||||
|
||||
yad # a fork of zenity, for creating dialogs
|
||||
yad # a fork of zenity, for creating dialogs
|
||||
|
||||
# 用于播放系统音效
|
||||
mpd # for playing system sounds
|
||||
mpc-cli # command-line mpd client
|
||||
ncmpcpp # a mpd client with a UI
|
||||
networkmanagerapplet # provide GUI app: nm-connection-editor
|
||||
mpd # for playing system sounds
|
||||
mpc-cli # command-line mpd client
|
||||
ncmpcpp # a mpd client with a UI
|
||||
networkmanagerapplet # provide GUI app: nm-connection-editor
|
||||
|
||||
xfce.thunar # xfce4's file manager
|
||||
xfce.thunar # xfce4's file manager
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{pkgs, ...}:
|
||||
{ pkgs, ... }:
|
||||
|
||||
|
||||
{
|
||||
@@ -21,26 +21,26 @@
|
||||
windowManager.i3 = {
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [
|
||||
rofi # application launcher, the same as dmenu
|
||||
dunst # notification daemon
|
||||
i3blocks # status bar
|
||||
i3lock # default i3 screen locker
|
||||
xautolock # lock screen after some time
|
||||
i3status # provide information to i3bar
|
||||
i3-gaps # i3 with gaps
|
||||
picom # transparency and shadows
|
||||
feh # set wallpaper
|
||||
acpi # battery information
|
||||
arandr # screen layout manager
|
||||
dex # autostart applications
|
||||
xbindkeys # bind keys to commands
|
||||
xorg.xbacklight # control screen brightness, the same as light
|
||||
xorg.xdpyinfo # get screen information
|
||||
scrot # minimal screen capture tool, used by i3 blur lock to take a screenshot
|
||||
sysstat # get system information
|
||||
rofi # application launcher, the same as dmenu
|
||||
dunst # notification daemon
|
||||
i3blocks # status bar
|
||||
i3lock # default i3 screen locker
|
||||
xautolock # lock screen after some time
|
||||
i3status # provide information to i3bar
|
||||
i3-gaps # i3 with gaps
|
||||
picom # transparency and shadows
|
||||
feh # set wallpaper
|
||||
acpi # battery information
|
||||
arandr # screen layout manager
|
||||
dex # autostart applications
|
||||
xbindkeys # bind keys to commands
|
||||
xorg.xbacklight # control screen brightness, the same as light
|
||||
xorg.xdpyinfo # get screen information
|
||||
scrot # minimal screen capture tool, used by i3 blur lock to take a screenshot
|
||||
sysstat # get system information
|
||||
|
||||
xfce.thunar # xfce4's file manager
|
||||
];
|
||||
xfce.thunar # xfce4's file manager
|
||||
];
|
||||
};
|
||||
|
||||
# Configure keymap in X11
|
||||
@@ -55,4 +55,4 @@
|
||||
];
|
||||
services.gvfs.enable = true; # Mount, trash, and other functionalities
|
||||
services.tumbler.enable = true; # Thumbnail support for images
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{config, pkgs, ...}:
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
users.groups = {
|
||||
ryan = {};
|
||||
docker = {};
|
||||
wireshark = {};
|
||||
ryan = { };
|
||||
docker = { };
|
||||
wireshark = { };
|
||||
};
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.users.ryan = {
|
||||
@@ -13,7 +13,7 @@
|
||||
description = "ryan";
|
||||
extraGroups = [ "ryan" "users" "networkmanager" "wheel" "docker" "wireshark" "adbusers" ];
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJx3Sk20pLL1b2PPKZey2oTyioODrErq83xG78YpFBoj"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJx3Sk20pLL1b2PPKZey2oTyioODrErq83xG78YpFBoj"
|
||||
];
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user