整理 packages

This commit is contained in:
2024-08-03 17:40:11 +08:00
parent 0187a236bb
commit db8d826825
34 changed files with 251 additions and 324 deletions

View File

@@ -76,7 +76,6 @@ inputs:
};
legion = {};
};
packages.packageSet = "workstation";
virtualization =
{
waydroid.enable = true;

View File

@@ -26,7 +26,6 @@ inputs:
initrd.sshd.enable = true;
};
hardware.cpus = [ "amd" ];
packages.packageSet = "server";
services.sshd = {};
};
};

View File

@@ -31,7 +31,7 @@ inputs:
initrd.unl0kr = {};
};
hardware = { cpus = [ "amd" ]; gpu.type = "amd"; steamdeck = {}; };
packages.packageSet = "desktop-extra";
packages.vasp = null;
virtualization = { docker.enable = true; waydroid.enable = true; };
services =
{

View File

@@ -52,7 +52,6 @@ inputs:
nix.remote.slave.enable = true;
};
hardware = { cpus = [ "amd" ]; gpu.type = "nvidia"; };
packages.packageSet = "workstation";
virtualization = { waydroid.enable = true; docker.enable = true; kvmHost = { enable = true; gui = true; }; };
services =
{

View File

@@ -46,7 +46,6 @@ inputs:
nix.remote.slave.enable = true;
};
hardware = { cpus = [ "intel" ]; gpu.type = "nvidia"; };
packages.packageSet = "workstation";
virtualization = { waydroid.enable = true; docker.enable = true; kvmHost = { enable = true; gui = true; }; };
services =
{

View File

@@ -1,6 +1,11 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop-extra" inputs.config.nixos.packages._packageSets)
options.nixos.packages.chromium = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config = let inherit (inputs.config.nixos.packages) chromium; in inputs.lib.mkIf (chromium != null)
{
programs.chromium = { enable = true; extraOpts.PasswordManagerEnabled = false; };
};

View File

@@ -1,47 +1,21 @@
inputs:
{
imports = inputs.localLib.findModules ./.;
options.nixos.packages =
let
inherit (inputs.lib) mkOption types;
packageSets =
[
# no gui, only used for specific purpose
"server"
"server-extra"
# gui, for daily use, but not install large programs such as matlab
"desktop"
"desktop-extra"
# nearly everything
"workstation"
];
in
{
packageSet = mkOption
{
type = types.enum packageSets;
default = if inputs.config.nixos.system.gui.enable then "desktop" else "server";
};
extraPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePackages = mkOption { type = types.listOf types.unspecified; default = []; };
extraPythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
extraPrebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePrebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
_packageSets = mkOption
{
type = types.listOf types.nonEmptyStr;
readOnly = true;
default = builtins.genList (i: builtins.elemAt packageSets i)
((inputs.localLib.findIndex inputs.config.nixos.packages.packageSet packageSets) + 1);
};
_packages = mkOption { type = types.listOf types.unspecified; default = []; };
_pythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
_prebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
};
options.nixos.packages.packages = let inherit (inputs.lib) mkOption types; in
{
extraPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePackages = mkOption { type = types.listOf types.unspecified; default = []; };
extraPythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
extraPrebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePrebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
_packages = mkOption { type = types.listOf types.unspecified; default = []; };
_pythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
_prebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
};
config =
{
environment.systemPackages = let inherit (inputs.lib.lists) subtractLists; in with inputs.config.nixos.packages;
environment.systemPackages = with inputs.config.nixos.packages.packages;
(inputs.lib.lists.subtractLists excludePackages (_packages ++ extraPackages))
++ [
(inputs.pkgs.python3.withPackages (pythonPackages:

View File

@@ -1,56 +0,0 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop-extra" inputs.config.nixos.packages._packageSets)
{
nixos =
{
packages = with inputs.pkgs;
{
_packages =
[
# system management
btrfs-assistant snapper-gui kdePackages.qtstyleplugin-kvantum ventoy-full cpu-x
inputs.pkgs."pkgs-23.11".etcher
# password and key management
yubikey-manager yubikey-manager-qt yubikey-personalization yubikey-personalization-gui bitwarden
# download
qbittorrent nur-xddxdd.baidupcs-go wgetpaste onedrive onedrivegui rclone
# development
scrcpy weston cage openbox krita
# media
spotify yesplaymusic simplescreenrecorder imagemagick gimp netease-cloud-music-gtk vlc obs-studio
waifu2x-converter-cpp inkscape blender whalebird paraview
# editor
typora
# news
fluent-reader
# nix tools
nixpkgs-fmt appimage-run nixd nix-serve node2nix nix-prefetch-github prefetch-npm-deps
nix-prefetch-docker
# instant messager
element-desktop telegram-desktop discord fluffychat zoom-us signal-desktop slack nur-linyinfeng.wemeet
# browser
google-chrome tor-browser
# office
crow-translate zotero pandoc ydict libreoffice-qt texstudio poppler_utils pdftk gnuplot pdfchain hdfview
texliveFull
# math, physics and chemistry
octaveFull root ovito localPackages.vesta localPackages.vaspkit localPackages.v-sim
# virtualization
wineWowPackages.stagingFull virt-viewer bottles
# media
nur-xddxdd.svp
]
++ (builtins.filter (p: !((p.meta.broken or false) || (builtins.elem p.pname or null [ "falkon" "kalzium" ])))
(builtins.filter inputs.lib.isDerivation (builtins.attrValues kdePackages.kdeGear)));
};
};
programs =
{
kdeconnect.enable = true;
anime-game-launcher = { enable = true; package = inputs.pkgs.anime-game-launcher; };
honkers-railway-launcher = { enable = true; package = inputs.pkgs.honkers-railway-launcher; };
sleepy-launcher = { enable = true; package = inputs.pkgs.sleepy-launcher; };
};
};
}

View File

@@ -1,48 +1,125 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
options.nixos.packages.desktop = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config = let inherit (inputs.config.nixos.packages) desktop; in inputs.lib.mkIf (desktop != null)
{
nixos =
{
packages._packages = with inputs.pkgs;
[
# system management
# TODO: module should add yubikey-touch-detector into path
gparted wayland-utils clinfo glxinfo vulkan-tools dracut yubikey-touch-detector
(
writeShellScriptBin "xclip"
''
#!${bash}/bin/bash
if [ "$XDG_SESSION_TYPE" = "x11" ]; then
exec ${xclip}/bin/xclip -sel clip "$@"
else
exec ${wl-clipboard-x11}/bin/xclip "$@"
fi
''
)
# color management
argyllcms xcalib
# networking
remmina putty mtr-gui
# media
mpv nomacs
# themes
catppuccin catppuccin-sddm catppuccin-cursors catppuccinifier-gui catppuccinifier-cli catppuccin-plymouth
(catppuccin-kde.override { flavour = [ "latte" ]; }) (catppuccin-kvantum.override { variant = "latte"; })
localPackages.slate localPackages.blurred-wallpaper tela-circle-icon-theme
# terminal
warp-terminal
# development
adb-sync
# desktop sharing
rustdesk-flutter
];
packages.packages =
{
_packages = with inputs.pkgs;
[
# system management
# TODO: module should add yubikey-touch-detector into path
gparted wayland-utils clinfo glxinfo vulkan-tools dracut yubikey-touch-detector btrfs-assistant snapper-gui
kdePackages.qtstyleplugin-kvantum ventoy-full cpu-x inputs.pkgs."pkgs-23.11".etcher wl-mirror
nvtopPackages.full
(
writeShellScriptBin "xclip"
''
#!${bash}/bin/bash
if [ "$XDG_SESSION_TYPE" = "x11" ]; then
exec ${xclip}/bin/xclip -sel clip "$@"
else
exec ${wl-clipboard-x11}/bin/xclip "$@"
fi
''
)
# color management
argyllcms xcalib
# networking
remmina putty mtr-gui
# media
mpv nomacs spotify yesplaymusic simplescreenrecorder imagemagick gimp netease-cloud-music-gtk vlc obs-studio
waifu2x-converter-cpp inkscape blender whalebird paraview
# themes
catppuccin catppuccin-sddm catppuccin-cursors catppuccinifier-gui catppuccinifier-cli catppuccin-plymouth
(catppuccin-kde.override { flavour = [ "latte" ]; }) (catppuccin-kvantum.override { variant = "latte"; })
localPackages.slate localPackages.blurred-wallpaper tela-circle-icon-theme
# terminal
warp-terminal
# development
adb-sync scrcpy weston cage openbox krita jetbrains.clion android-studio dbeaver-bin cling fprettify
aircrack-ng
# desktop sharing
rustdesk-flutter
# password and key management
yubikey-manager yubikey-manager-qt yubikey-personalization yubikey-personalization-gui bitwarden electrum
jabref
john crunch hashcat
# download
qbittorrent nur-xddxdd.baidupcs-go wgetpaste onedrive onedrivegui rclone
# editor
typora appflowy notion-app-enhanced joplin-desktop standardnotes logseq
# news
fluent-reader rssguard newsflash newsboat
# nix tools
nixpkgs-fmt appimage-run nixd nix-serve node2nix nix-prefetch-github prefetch-npm-deps nix-prefetch-docker
nix-template nil pnpm-lock-export bundix
# instant messager
element-desktop telegram-desktop discord fluffychat zoom-us signal-desktop slack nur-linyinfeng.wemeet
cinny-desktop nheko # qq nur-xddxdd.wechat-uos
# browser
google-chrome tor-browser microsoft-edge
# office
crow-translate zotero pandoc ydict libreoffice-qt texstudio poppler_utils pdftk gnuplot pdfchain hdfview
davinci-resolve
texliveFull
# math, physics and chemistry
octaveFull root ovito localPackages.vesta localPackages.vaspkit localPackages.v-sim
(mathematica.overrideAttrs (prev: { postInstall = prev.postInstall or "" + "ln -s ${src} $out/src"; }))
(quantum-espresso.override { stdenv = gcc14Stdenv; gfortran = gfortran14; }) jmol mpi
# virtualization
# TODO: broken on python 3.12: playonlinux
wineWowPackages.stagingFull virt-viewer bottles genymotion
# media
nur-xddxdd.svp
]
++ (builtins.filter (p: !((p.meta.broken or false) || (builtins.elem p.pname or null [ "falkon" "kalzium" ])))
(builtins.filter inputs.lib.isDerivation (builtins.attrValues kdePackages.kdeGear)));
# TODO: fix it
# ++ inputs.lib.optional (inputs.config.nixos.system.nixpkgs.march != null) localPackages.mumax;
_pythonPackages = [(pythonPackages: with pythonPackages;
[
phonopy scipy scikit-learn jupyterlab autograd # localPackages.pix2tex
# TODO: broken on python 3.12: tensorflow keras
])];
};
user.sharedModules =
[{
config.programs =
{
plasma =
{
enable = true;
configFile =
{
plasma-localerc = { Formats.LANG.value = "en_US.UTF-8"; Translations.LANGUAGE.value = "zh_CN"; };
baloofilerc."Basic Settings".Indexing-Enabled.value = false;
};
powerdevil.autoSuspend.action = "nothing";
};
obs-studio =
{
enable = true;
plugins = with inputs.pkgs.obs-studio-plugins; [ wlrobs obs-vaapi obs-nvfbc droidcam-obs obs-vkcapture ];
};
};
}];
};
programs =
{
adb.enable = true;
wireshark = { enable = true; package = inputs.pkgs.wireshark; };
yubikey-touch-detector.enable = true;
kdeconnect.enable = true;
anime-game-launcher = { enable = true; package = inputs.pkgs.anime-game-launcher; };
honkers-railway-launcher = { enable = true; package = inputs.pkgs.honkers-railway-launcher; };
sleepy-launcher = { enable = true; package = inputs.pkgs.sleepy-launcher; };
};
nixpkgs.overlays = [(final: prev:
{

View File

@@ -1,6 +1,11 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
options.nixos.packages.firefox = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config = let inherit (inputs.config.nixos.packages) firefox; in inputs.lib.mkIf (firefox != null)
{
# still enable global firefox, to install language packs
programs.firefox =

View File

@@ -1,11 +1,12 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop-extra" inputs.config.nixos.packages._packageSets)
options.nixos.packages.flatpak = let inherit (inputs.lib) mkOption types; in mkOption
{
services.flatpak =
{
enable = true;
uninstallUnmanaged = true;
};
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config = let inherit (inputs.config.nixos.packages) flatpak; in inputs.lib.mkIf (flatpak != null)
{
services.flatpak = { enable = true; uninstallUnmanaged = true; };
};
}

View File

@@ -1,6 +1,8 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
options.nixos.packages.git = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
config = let inherit (inputs.config.nixos.packages) git; in inputs.lib.mkIf (git != null)
{
programs.git =
{
@@ -15,6 +17,6 @@ inputs:
receive.denyCurrentBranch = "warn"; # 允许 push 到非 bare 的仓库
};
};
nixos.packages._packages = [ inputs.pkgs.localPackages.git-lfs-transfer ]; # make pure ssh lfs work
nixos.packages.packages._packages = [ inputs.pkgs.localPackages.git-lfs-transfer ]; # make pure ssh lfs work
};
}

View File

@@ -1,6 +1,8 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
options.nixos.packages.gpg = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
config = let inherit (inputs.config.nixos.packages) gpg; in inputs.lib.mkIf (gpg != null)
{
programs.gnupg.agent.enable = true;
};

View File

@@ -1,19 +0,0 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
{
nixos.user.sharedModules =
[{
config.programs.plasma =
{
enable = true;
configFile =
{
plasma-localerc = { Formats.LANG.value = "en_US.UTF-8"; Translations.LANGUAGE.value = "zh_CN"; };
baloofilerc."Basic Settings".Indexing-Enabled.value = false;
};
powerdevil.autoSuspend.action = "nothing";
};
}];
};
}

View File

@@ -1,32 +0,0 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "server-extra" inputs.config.nixos.packages._packageSets)
{
nixos =
{
packages = with inputs.pkgs;
{
_packages =
[
# shell
ksh
# basic tools
neofetch
# office
todo-txt-cli pdfgrep ffmpeg-full
# development
hexo-cli gh nix-init
]
++ (with inputs.config.boot.kernelPackages; [ cpupower usbip ])
++ (inputs.lib.optional (inputs.config.nixos.system.nixpkgs.arch == "x86_64") rar);
_pythonPackages = [(pythonPackages: with pythonPackages;
[
openai python-telegram-bot fastapi pypdf2 pandas matplotlib plotly gunicorn redis jinja2
certifi charset-normalizer idna orjson psycopg2 inquirerpy requests tqdm pydbus
])];
};
};
programs.yazi.enable = true;
services.fwupd.enable = true;
};
}

View File

@@ -1,41 +1,53 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
options.nixos.packages.server = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
config = let inherit (inputs.config.nixos.packages) server; in inputs.lib.mkIf (server != null)
{
nixos.packages._packages = with inputs.pkgs;
[
# basic tools
beep dos2unix gnugrep pv tmux screen parallel tldr cowsay jq zellij ipfetch localPackages.pslist
fastfetch reptyr nushell duc ncdu progress libva-utils
# lsxx
pciutils usbutils lshw util-linux lsof dmidecode lm_sensors
# top
iotop iftop htop btop powertop s-tui
# editor
nano bat
# downloader
wget aria2 curl yt-dlp
# file manager
tree eza trash-cli lsd broot file xdg-ninja mlocate
# compress
pigz upx unzip zip lzip p7zip
# file system management
sshfs e2fsprogs duperemove compsize exfatprogs
# disk management
smartmontools hdparm
# encryption and authentication
apacheHttpd openssl ssh-to-age gnupg age sops pam_u2f yubico-piv-tool
# networking
ipset iptables iproute2 dig nettools traceroute tcping-go whois tcpdump nmap inetutils wireguard-tools
# nix tools
nix-output-monitor nix-tree ssh-to-age (callPackage "${inputs.topInputs.nix-fast-build}" {}) nix-inspect
# development
gdb try inputs.topInputs.plasma-manager.packages.${inputs.pkgs.system}.rc2nix rr
# stupid things
toilet lolcat
]
++ (with inputs.config.boot.kernelPackages; [ cpupower usbip ])
++ (inputs.lib.optional (inputs.config.nixos.system.nixpkgs.arch == "x86_64") rar);
nixos.packages.packages =
{
_packages = with inputs.pkgs;
[
# basic tools
beep dos2unix gnugrep pv tmux screen parallel tldr cowsay jq zellij ipfetch localPackages.pslist
fastfetch reptyr nushell duc ncdu progress libva-utils ksh neofetch
# lsxx
pciutils usbutils lshw util-linux lsof dmidecode lm_sensors
# top
iotop iftop htop btop powertop s-tui
# editor
nano bat
# downloader
wget aria2 curl yt-dlp
# file manager
tree eza trash-cli lsd broot file xdg-ninja mlocate
# compress
pigz upx unzip zip lzip p7zip
# file system management
sshfs e2fsprogs duperemove compsize exfatprogs
# disk management
smartmontools hdparm
# encryption and authentication
apacheHttpd openssl ssh-to-age gnupg age sops pam_u2f yubico-piv-tool
# networking
ipset iptables iproute2 dig nettools traceroute tcping-go whois tcpdump nmap inetutils wireguard-tools
# nix tools
nix-output-monitor nix-tree ssh-to-age (callPackage "${inputs.topInputs.nix-fast-build}" {}) nix-inspect
# development
gdb try inputs.topInputs.plasma-manager.packages.${inputs.pkgs.system}.rc2nix rr hexo-cli gh nix-init
# stupid things
toilet lolcat
# office
todo-txt-cli pdfgrep ffmpeg-full
]
++ (with inputs.config.boot.kernelPackages; [ cpupower usbip ])
++ (inputs.lib.optional (inputs.config.nixos.system.nixpkgs.arch == "x86_64") rar);
_pythonPackages = [(pythonPackages: with pythonPackages;
[
openai python-telegram-bot fastapi pypdf2 pandas matplotlib plotly gunicorn redis jinja2
certifi charset-normalizer idna orjson psycopg2 inquirerpy requests tqdm pydbus
])];
};
programs =
{
nix-index-database.comma.enable = true;
@@ -44,8 +56,13 @@ inputs:
autojump.enable = true;
direnv = { enable = true; nix-direnv.enable = true; };
mosh.enable = true;
yazi.enable = true;
};
services =
{
udev.packages = with inputs.pkgs; [ yubikey-personalization libfido2 ];
fwupd.enable = true;
};
services.udev.packages = with inputs.pkgs; [ yubikey-personalization libfido2 ];
home-manager = { useGlobalPkgs = true; useUserPackages = true; };
};
}

View File

@@ -1,6 +1,8 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
options.nixos.packages.ssh = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
config = let inherit (inputs.config.nixos.packages) ssh; in inputs.lib.mkIf (ssh != null)
{
services.openssh.knownHosts =
let servers =

View File

@@ -1,6 +1,11 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop-extra" inputs.config.nixos.packages._packageSets)
options.nixos.packages.steam = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config = let inherit (inputs.config.nixos.packages) steam; in inputs.lib.mkIf (steam != null)
{
programs.steam =
{

View File

@@ -1,8 +1,14 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "workstation" inputs.config.nixos.packages._packageSets)
options.nixos.packages.vasp = let inherit (inputs.lib) mkOption types; in mkOption
{
nixos.packages._packages = inputs.lib.optionals (inputs.config.nixos.system.nixpkgs.march != null)
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
# TODO: add more options to correctly configure VASP
config = let inherit (inputs.config.nixos.packages) vasp; in inputs.lib.mkIf (vasp != null)
{
nixos.packages.packages._packages = inputs.lib.optionals (inputs.config.nixos.system.nixpkgs.march != null)
(with inputs.pkgs.localPackages.vasp; [ intel nvidia vtstscripts ]);
};
}

View File

@@ -1,6 +1,8 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
options.nixos.packages.vim = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
config = let inherit (inputs.config.nixos.packages) vim; in inputs.lib.mkIf (vim != null)
{
nixos.user.sharedModules =
[{

View File

@@ -1,8 +1,13 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
options.nixos.packages.vscode = let inherit (inputs.lib) mkOption types; in mkOption
{
nixos.packages = with inputs.pkgs;
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config = let inherit (inputs.config.nixos.packages) vscode; in inputs.lib.mkIf (vscode != null)
{
nixos.packages.packages = with inputs.pkgs;
{
_packages =
[(

View File

@@ -1,57 +0,0 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "workstation" inputs.config.nixos.packages._packageSets)
{
nixos =
{
packages = with inputs.pkgs;
{
_packages =
[
# password and key management
electrum jabref
# system management
wl-mirror nvtopPackages.full
# nix tools
nix-template nil pnpm-lock-export bundix
# instant messager
cinny-desktop nheko # qq nur-xddxdd.wechat-uos
# development
jetbrains.clion android-studio dbeaver-bin cling fprettify aircrack-ng
# install per project
# clang-tools_16 ccls
# text editor
appflowy notion-app-enhanced joplin-desktop standardnotes logseq
# math, physics and chemistry
(mathematica.overrideAttrs (prev: { postInstall = prev.postInstall or "" + "ln -s ${src} $out/src"; }))
(quantum-espresso.override { stdenv = gcc14Stdenv; gfortran = gfortran14; })
jmol mpi
# encryption and password management
john crunch hashcat
# container and vm
genymotion davinci-resolve
# TODO: broken on python 3.12
# playonlinux
# browser
microsoft-edge
# news
rssguard newsflash newsboat
] ++ inputs.lib.optional (inputs.config.nixos.system.nixpkgs.march != null) localPackages.mumax;
_pythonPackages = [(pythonPackages: with pythonPackages;
[
phonopy scipy scikit-learn jupyterlab autograd # localPackages.pix2tex
# TODO: broken on python 3.12
# tensorflow keras
])];
};
user.sharedModules =
[{
config.programs.obs-studio =
{
enable = true;
plugins = with inputs.pkgs.obs-studio-plugins; [ wlrobs obs-vaapi obs-nvfbc droidcam-obs obs-vkcapture ];
};
}];
};
};
}

View File

@@ -1,6 +1,8 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
options.nixos.packages.zsh = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
config = let inherit (inputs.config.nixos.packages) zsh; in inputs.lib.mkIf (zsh != null)
{
nixos.user.sharedModules = [(home-inputs: { config.programs =
{
@@ -37,11 +39,7 @@ inputs:
name = "powerlevel10k";
src = "${inputs.pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
}
{
file = "p10k.zsh";
name = "powerlevel10k-config";
src = ./p10k-config;
}
{ file = "p10k.zsh"; name = "powerlevel10k-config"; src = ./p10k-config; }
{
name = "zsh-lsd";
src = inputs.pkgs.fetchFromGitHub
@@ -71,10 +69,7 @@ inputs:
autosuggestions.enable = true;
enableCompletion = true;
ohMyZsh =
{
enable = true;
plugins = [ "git" "colored-man-pages" "extract" "history-substring-search" "autojump" ];
};
{ enable = true; plugins = [ "git" "colored-man-pages" "extract" "history-substring-search" "autojump" ]; };
};
};
}

View File

@@ -3,7 +3,7 @@ inputs:
options.nixos.services.nixseparatedebuginfo = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default = if builtins.elem "desktop-extra" inputs.config.nixos.packages._packageSets then {} else null;
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config =
let inherit (inputs.config.nixos.services) nixseparatedebuginfo; in inputs.lib.mkIf (nixseparatedebuginfo != {})

View File

@@ -116,7 +116,7 @@ inputs:
};
nixos =
{
packages._packages = [(inputs.pkgs.localPackages.sbatch-tui.override { sbatchConfig =
packages.packages._packages = [(inputs.pkgs.localPackages.sbatch-tui.override { sbatchConfig =
{
cpuMpiThreads = slurm.cpu.mpiThreads;
cpuOpenmpThreads = slurm.cpu.openmpThreads;

View File

@@ -1,10 +1,11 @@
inputs:
{
options.nixos.system.binfmt = let inherit (inputs.lib) mkOption types; in
options.nixos.system.binfmt = let inherit (inputs.lib) mkOption types; in mkOption
{
enable = mkOption { type = types.bool; default = inputs.config.nixos.packages.packageSet == "workstation"; };
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config = inputs.lib.mkIf inputs.config.nixos.system.binfmt.enable
config = let inherit (inputs.config.nixos.system) binfmt; in inputs.lib.mkIf (binfmt != null)
{
programs.java = { enable = true; binfmt = true; };
boot.binfmt.emulatedSystems = [ "aarch64-linux" "x86_64-windows" ];

View File

@@ -3,7 +3,7 @@ inputs:
options.nixos.system.envfs = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.packages.packageSet == "workstation" then {} else null;
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config = let inherit (inputs.config.nixos.system) envfs; in inputs.lib.mkIf (envfs != null) (inputs.lib.mkMerge
[

View File

@@ -94,12 +94,8 @@ inputs:
};
}
(
inputs.lib.mkIf
(
inputs.lib.strings.hasPrefix "cachyos" kernel.variant
&& builtins.elem "server-extra" inputs.config.nixos.packages._packageSets
)
{ environment.systemPackages = [ inputs.pkgs.scx ]; }
inputs.lib.mkIf (inputs.lib.strings.hasPrefix "cachyos" kernel.variant)
{ nixos.packages.packages._packages = [ inputs.pkgs.scx ]; }
)
(
inputs.lib.mkIf (kernel.variant == "rpi3")

View File

@@ -3,7 +3,7 @@ inputs:
options.nixos.system.nix-ld = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.packages.packageSet == "workstation" then {} else null;
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config = let inherit (inputs.config.nixos.system) nix-ld; in inputs.lib.mkIf (nix-ld != null)
{

View File

@@ -1,6 +1,6 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop-extra" inputs.config.nixos.packages._packageSets)
config = inputs.lib.mkIf (inputs.config.nixos.packages.chromium != null)
{
home-manager.users.chn.config.programs.chromium =
{

View File

@@ -1,6 +1,6 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
config = inputs.lib.mkIf (inputs.config.nixos.packages.firefox != null)
{
home-manager.users.chn.config =
{

View File

@@ -1,6 +1,6 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
config = inputs.lib.mkIf (inputs.config.nixos.packages.git != null)
{
home-manager.users.chn.config.programs.git =
{

View File

@@ -1,7 +1,7 @@
inputs:
{
imports = inputs.localLib.findModules ./.;
config = inputs.lib.mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
config = inputs.lib.mkIf (inputs.config.nixos.packages.desktop != null)
{
home-manager.users.chn.config.programs.plasma = inputs.lib.mkMerge
[

View File

@@ -1,6 +1,6 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
config = inputs.lib.mkIf (inputs.config.nixos.packages.desktop != null)
{
home-manager.users.chn.config =
{