feat: add comments, format all nix files

This commit is contained in:
Ryan Yin
2023-06-13 01:05:13 +08:00
parent 86114a4db1
commit dc0fc97cb9
47 changed files with 438 additions and 420 deletions

View File

@@ -7,4 +7,4 @@
xdg.configFile."alacritty/alacritty.yml".source = ./alacritty.yml;
xdg.configFile."alacritty/theme_github_dark.yml".source = ./theme_github_dark.yml;
}
}

View File

@@ -1,11 +1,11 @@
{config, pkgs, nil, ...}:
{ config, pkgs, nil, ... }:
{
home.packages = with pkgs; [
nil.packages."${pkgs.system}".default # nix language server
nil.packages."${pkgs.system}".default # nix language server
# GUI IDE
insomnia # REST client
insomnia # REST client
# need to run `conda-install` before using it
# need to run `conda-shell` before using command `conda`
@@ -33,4 +33,4 @@
programs.gh = {
enable = true;
};
}
}

View File

@@ -1,10 +1,11 @@
{config, ...}:
{ config, ... }:
let
d = config.xdg.dataHome;
c = config.xdg.configHome;
cache = config.xdg.cacheHome;
in rec {
in
rec {
# add environment variables
systemd.user.sessionVariables = {
# clean up ~
@@ -29,4 +30,4 @@ in rec {
};
home.sessionVariables = systemd.user.sessionVariables;
}
}

View File

@@ -1,6 +1,5 @@
{
pkgs,
...
{ pkgs
, ...
}: {
programs.ssh = {
enable = true;
@@ -36,4 +35,4 @@
# check imported keys by `ssh-add -l`
# TODO `ssh-add` can only add keys temporary, use gnome-keyring to unlock all keys after login.
};
}
}

View File

@@ -1,31 +1,31 @@
{pkgs, config, ...}:
{ pkgs, config, ... }:
{
# Linux Only Packages, not available on Darwin
home.packages = with pkgs; [
btop # replacement of htop/nmon
btop # replacement of htop/nmon
htop
iotop
nmon
## networking tools
wireguard-tools # manage wireguard vpn manually, via wg-quick
wireguard-tools # manage wireguard vpn manually, via wg-quick
iftop
# misc
libnotify
# system call monitoring
strace # system call monitoring
ltrace # library call monitoring
lsof # list open files
strace # system call monitoring
ltrace # library call monitoring
lsof # list open files
# system tools
ethtool
sysstat
lm_sensors # for `sensors` command
cifs-utils # for mounting windows shares
lm_sensors # for `sensors` command
cifs-utils # for mounting windows shares
];
# auto mount usb drives

View File

@@ -2,10 +2,10 @@
# It's a bunch of specifications from freedesktop.org intended to standardize desktops and
# other GUI applications on various systems (primarily Unix-like) to be interoperable:
# https://www.freedesktop.org/wiki/Specifications/
{config, pkgs, ...}:
{ config, pkgs, ... }:
{
home.packages = with pkgs; [
xdg-utils # provides cli tools such as `xdg-mime` `xdg-open`
xdg-utils # provides cli tools such as `xdg-mime` `xdg-open`
xdg-user-dirs
];
@@ -22,13 +22,13 @@
# ls /etc/profiles/per-user/ryan/share/applications/
mimeApps = {
enable = true;
defaultApplications =
defaultApplications =
let
browser = ["firefox.desktop"];
browser = [ "firefox.desktop" ];
in
{
"application/json" = browser;
"application/pdf" = browser; # TODO: pdf viewer
"application/pdf" = browser; # TODO: pdf viewer
"text/html" = browser;
"text/xml" = browser;
@@ -48,18 +48,18 @@
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/unknown" = browser;
"x-scheme-handler/discord" = ["discord.desktop"];
"x-scheme-handler/tg" = ["telegramdesktop.desktop"];
"audio/*" = ["mpv.desktop"];
"video/*" = ["mpv.dekstop"];
"image/*" = ["imv.desktop"];
"x-scheme-handler/discord" = [ "discord.desktop" ];
"x-scheme-handler/tg" = [ "telegramdesktop.desktop" ];
"audio/*" = [ "mpv.desktop" ];
"video/*" = [ "mpv.dekstop" ];
"image/*" = [ "imv.desktop" ];
};
associations.removed =
let
browser = ["google-chrome.desktop"];
browser = [ "google-chrome.desktop" ];
in
{
"text/html" = browser;

View File

@@ -1,17 +1,16 @@
{
pkgs,
config,
...
{ pkgs
, config
, ...
}:
{
home.packages = with pkgs; [
# creative
# blender # 3d modeling
# gimp # image editing, I prefer using figma in browser instead of this one
inkscape # vector graphics
krita # digital painting
inkscape # vector graphics
krita # digital painting
musescore # music notation
reaper # audio production
reaper # audio production
# this app consumes a lot of storage, so do not install it currently
# kicad # 3d printing, eletrical engineering
@@ -21,4 +20,4 @@
# live streaming
obs-studio.enable = true;
};
}
}

View File

@@ -16,13 +16,13 @@
# instant messaging
telegram-desktop
discord
qq # https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/networking/instant-messengers/qq
qq # https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/networking/instant-messengers/qq
# remote desktop(rdp connect)
remmina
freerdp # required by remmina
freerdp # required by remmina
# misc
flameshot
];
}
}

View File

@@ -1,7 +1,6 @@
{
pkgs,
config,
...
{ pkgs
, config
, ...
}:
# media - control and enjoy audio/video
{
@@ -10,7 +9,7 @@
pavucontrol
playerctl
pulsemixer
imv # simple image viewer
imv # simple image viewer
nvtop
@@ -24,12 +23,12 @@
programs = {
mpv = {
enable = true;
defaultProfiles = ["gpu-hq"];
scripts = [pkgs.mpvScripts.mpris];
defaultProfiles = [ "gpu-hq" ];
scripts = [ pkgs.mpvScripts.mpris ];
};
};
services = {
playerctld.enable = true;
};
}
}

View File

@@ -1,24 +1,24 @@
{pkgs, config, lib, ... }: {
{ pkgs, config, lib, ... }: {
home.file.".config/fcitx5/profile".source = ./profile;
home.file.".config/fcitx5/profile-bak".source = ./profile; # used for backup
home.file.".config/fcitx5/profile-bak".source = ./profile; # used for backup
# fcitx5 每次切换输入法,就会修改 ~/.config/fcitx5/profile 文件,导致我用 hm 管理的配置被覆盖
# 解决方法是通过如下内置,每次 rebuild 前都先删除下 profile 文件
home.activation.removeExistingFcitx5Profile = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
home.activation.removeExistingFcitx5Profile = lib.hm.dag.entryBefore [ "checkLinkTargets" ] ''
rm -f "${config.xdg.configHome}/fcitx5/profile"
'';
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [
# for flypy chinese input method
fcitx5-rime
# needed enable rime using configtool after installed
fcitx5-configtool
fcitx5-chinese-addons
# fcitx5-mozc # japanese input method
fcitx5-gtk # gtk im module
];
# for flypy chinese input method
fcitx5-rime
# needed enable rime using configtool after installed
fcitx5-configtool
fcitx5-chinese-addons
# fcitx5-mozc # japanese input method
fcitx5-gtk # gtk im module
];
};
systemd.user.sessionVariables = {
@@ -28,6 +28,6 @@
QT_IM_MODULE = "fcitx";
XMODIFIERS = "@im=fcitx";
INPUT_METHOD = "fcitx";
IMSETTINGS_MODULE = "fcitx";
IMSETTINGS_MODULE = "fcitx";
};
}
}

View File

@@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
imports = [
./wayland-apps.nix
@@ -25,8 +24,8 @@
fonts.fontconfig.enable = true;
systemd.user.sessionVariables = {
"NIXOS_OZONE_WL" = "1"; # for any ozone-based browser & electron apps to run on wayland
"MOZ_ENABLE_WAYLAND" = "1"; # for firefox to run on wayland
"NIXOS_OZONE_WL" = "1"; # for any ozone-based browser & electron apps to run on wayland
"MOZ_ENABLE_WAYLAND" = "1"; # for firefox to run on wayland
"MOZ_WEBRENDER" = "1";
# for hyprland with nvidia gpu, ref https://wiki.hyprland.org/Nvidia/

View File

@@ -1,8 +1,7 @@
{
pkgs,
pkgs-stable,
...
}:
{ pkgs
, pkgs-stable
, ...
}:
{
# TODO vscode & chrome both have wayland support, but they don't work with fcitx5, need to fix it.
@@ -31,7 +30,7 @@
firefox = {
enable = true;
enableGnomeExtensions = false;
package = pkgs-stable.firefox-wayland; # firefox with wayland support
package = pkgs-stable.firefox-wayland; # firefox with wayland support
};
vscode = {

View File

@@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
# i3 配置,基于 https://github.com/endeavouros-team/endeavouros-i3wm-setup
# 直接从当前文件夹中读取配置文件作为配置内容
@@ -20,7 +19,7 @@
source = ./scripts;
# copy the scripts directory recursively
recursive = true;
executable = true; # make all scripts executable
executable = true; # make all scripts executable
};
# rofi is a application launcher and dmenu replacement
@@ -56,4 +55,4 @@
package = pkgs.qogir-theme;
size = 64;
};
}
}

View File

@@ -1,6 +1,5 @@
{
pkgs,
...
{ pkgs
, ...
}: {
home.packages = with pkgs; [
firefox