nixos/modules/packages/default.nix

721 lines
28 KiB
Nix
Raw Normal View History

2023-07-18 13:55:24 +08:00
inputs:
{
2023-09-01 21:05:26 +08:00
options.nixos.packages = let inherit (inputs.lib) mkOption types; in
{
packageSet = mkOption
{
type = types.enum
[
# no gui, only used for specific purpose
"server"
# gui, for daily use, but not install large programs such as matlab
"desktop"
2023-11-16 16:06:52 +08:00
"desktop-fat"
2023-09-01 21:05:26 +08:00
# nearly everything
"workstation"
];
default = "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 = []; };
_packages = mkOption { type = types.listOf types.unspecified; default = []; };
_pythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
_prebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
};
2023-10-22 13:28:15 +08:00
config =
let
inherit (inputs.lib) mkMerge mkIf;
inherit (builtins) concatLists map listToAttrs;
inherit (inputs.localLib) attrsToList;
in mkMerge
[
# >= server
2023-09-01 21:05:26 +08:00
{
2023-10-22 13:28:15 +08:00
nixos =
2023-10-04 00:35:59 +08:00
{
2023-10-22 13:28:15 +08:00
packages = with inputs.pkgs;
2023-09-12 16:31:20 +08:00
{
2023-10-22 13:28:15 +08:00
_packages =
[
# shell
ksh
# basic tools
beep dos2unix gnugrep pv tmux screen parallel tldr cowsay jq zellij neofetch ipfetch localPackages.pslist
2023-11-22 11:41:36 +08:00
fastfetch reptyr
2023-10-22 13:28:15 +08:00
# lsxx
pciutils usbutils lshw util-linux lsof
# top
iotop iftop htop btop powertop s-tui
# editor
nano bat
# downloader
2023-11-22 10:48:00 +08:00
wget aria2 curl yt-dlp
2023-10-22 13:28:15 +08:00
# file manager
2023-11-22 16:42:31 +08:00
tree eza trash-cli lsd broot file xdg-ninja mlocate
2023-10-22 13:28:15 +08:00
# compress
pigz rar upx unzip zip lzip p7zip
# file system management
sshfs e2fsprogs adb-sync duperemove compsize
# 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
# nix tools
2023-11-10 20:47:05 +08:00
nix-output-monitor nix-tree ssh-to-age
2023-10-22 13:28:15 +08:00
# office
todo-txt-cli
# development
2023-11-22 11:41:36 +08:00
gdb try inputs.topInputs.plasma-manager.packages.x86_64-linux.rc2nix
2023-10-22 13:28:15 +08:00
] ++ (with inputs.config.boot.kernelPackages; [ cpupower usbip ]);
_pythonPackages = [(pythonPackages: with pythonPackages;
[
inquirerpy requests python-telegram-bot tqdm fastapi pypdf2 pandas matplotlib plotly gunicorn redis jinja2
certifi charset-normalizer idna orjson psycopg2 localPackages.eigengdb
])];
};
users.sharedModules = [(home-inputs:
{
config.programs =
2023-09-12 16:31:20 +08:00
{
2023-10-22 13:28:15 +08:00
zsh =
{
enable = true;
initExtraBeforeCompInit =
''
# p10k instant prompt
P10K_INSTANT_PROMPT="$XDG_CACHE_HOME/p10k-instant-prompt-''${(%):-%n}.zsh"
[[ ! -r "$P10K_INSTANT_PROMPT" ]] || source "$P10K_INSTANT_PROMPT"
HYPHEN_INSENSITIVE="true"
export PATH=~/bin:$PATH
function br
{
local cmd cmd_file code
cmd_file=$(mktemp)
if broot --outcmd "$cmd_file" "$@"; then
cmd=$(<"$cmd_file")
command rm -f "$cmd_file"
eval "$cmd"
else
code=$?
command rm -f "$cmd_file"
return "$code"
fi
}
alias todo="todo.sh"
'';
plugins =
[
{
file = "powerlevel10k.zsh-theme";
name = "powerlevel10k";
src = "${inputs.pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
}
{
file = "p10k.zsh";
name = "powerlevel10k-config";
src = ./p10k-config;
}
{
name = "zsh-lsd";
src = inputs.pkgs.fetchFromGitHub
{
owner = "z-shell";
repo = "zsh-lsd";
rev = "029a9cb0a9b39c9eb6c5b5100dd9182813332250";
sha256 = "sha256-oWjWnhiimlGBMaZlZB+OM47jd9hporKlPNwCx6524Rk=";
};
}
];
history =
2023-09-12 16:31:20 +08:00
{
2023-10-22 13:28:15 +08:00
path = "${home-inputs.config.xdg.dataHome}/zsh/zsh_history";
extended = true;
save = 100000000;
size = 100000000;
};
};
direnv = { enable = true; nix-direnv.enable = true; };
git =
{
enable = true;
lfs.enable = true;
extraConfig =
2023-09-12 16:31:20 +08:00
{
2023-10-22 13:28:15 +08:00
core.editor = if inputs.config.nixos.system.gui.preferred then "code --wait" else "vim";
advice.detachedHead = false;
merge.conflictstyle = "diff3";
diff.colorMoved = "default";
};
package = inputs.pkgs.gitFull;
delta =
2023-09-12 16:31:20 +08:00
{
2023-10-22 13:28:15 +08:00
enable = true;
options =
2023-09-12 16:31:20 +08:00
{
2023-10-22 13:28:15 +08:00
side-by-side = true;
navigate = true;
syntax-theme = "GitHub";
light = true;
zero-style = "syntax white";
line-numbers-zero-style = "#ffffff";
2023-09-12 16:31:20 +08:00
};
2023-10-22 13:28:15 +08:00
};
2023-09-12 16:31:20 +08:00
};
2023-10-22 13:28:15 +08:00
ssh =
2023-09-12 16:31:20 +08:00
{
2023-10-22 13:28:15 +08:00
enable = true;
controlMaster = "auto";
controlPersist = "1m";
compression = true;
2023-09-12 16:31:20 +08:00
};
2023-10-22 13:28:15 +08:00
vim =
2023-09-12 16:31:20 +08:00
{
enable = true;
2023-10-22 13:28:15 +08:00
defaultEditor = true;
packageConfigurable = inputs.config.programs.vim.package;
settings =
2023-09-12 16:31:20 +08:00
{
2023-10-22 13:28:15 +08:00
number = true;
expandtab = false;
shiftwidth = 2;
tabstop = 2;
2023-09-12 16:31:20 +08:00
};
2023-10-22 13:28:15 +08:00
extraConfig =
''
set clipboard=unnamedplus
colorscheme evening
'';
2023-09-12 16:31:20 +08:00
};
};
2023-10-22 13:28:15 +08:00
})];
};
programs =
{
nix-index-database.comma.enable = true;
nix-index.enable = true;
zsh =
{
enable = true;
syntaxHighlighting.enable = true;
autosuggestions.enable = true;
enableCompletion = true;
ohMyZsh =
2023-09-12 16:31:20 +08:00
{
enable = true;
2023-10-22 13:28:15 +08:00
plugins = [ "git" "colored-man-pages" "extract" "history-substring-search" "autojump" ];
customPkgs = with inputs.pkgs; [ zsh-nix-shell ];
2023-09-12 16:31:20 +08:00
};
2023-10-22 13:28:15 +08:00
};
command-not-found.enable = false;
adb.enable = true;
gnupg.agent = { enable = true; enableSSHSupport = true; };
autojump.enable = true;
git =
{
enable = true;
package = inputs.pkgs.gitFull;
lfs.enable = true;
config =
2023-09-12 16:31:20 +08:00
{
2023-10-22 13:28:15 +08:00
init.defaultBranch = "main";
core = { quotepath = false; editor = "vim"; };
};
};
2023-11-04 12:43:30 +08:00
# yazi.enable = true;
2023-10-22 13:28:15 +08:00
};
services =
{
fwupd.enable = true;
udev.packages = with inputs.pkgs; [ yubikey-personalization libfido2 ];
openssh.knownHosts =
let
2023-11-16 11:27:01 +08:00
servers =
2023-09-12 16:31:20 +08:00
{
2023-10-22 13:28:15 +08:00
vps6 =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO5ZcvyRyOnUCuRtqrM/Qf+AdUe3a5bhbnfyhw2FSLDZ";
2023-11-16 11:27:01 +08:00
hostnames = [ "internal.vps6.chn.moe" "vps6.chn.moe" "74.211.99.69" "192.168.82.1" ];
2023-10-22 13:28:15 +08:00
};
"initrd.vps6" =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB4DKB/zzUYco5ap6k9+UxeO04LL12eGvkmQstnYxgnS";
hostnames = [ "initrd.vps6.chn.moe" "74.211.99.69" ];
};
vps7 =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF5XkdilejDAlg5hZZD0oq69k8fQpe9hIJylTo/aLRgY";
2023-11-16 11:27:01 +08:00
hostnames = [ "internal.vps7.chn.moe" "vps7.chn.moe" "95.111.228.40" "192.168.82.2" ];
2023-10-22 13:28:15 +08:00
};
"initrd.vps7" =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGZyQpdQmEZw3nLERFmk2tS1gpSvXwW0Eish9UfhrRxC";
hostnames = [ "initrd.vps7.chn.moe" "95.111.228.40" ];
};
nas =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIktNbEcDMKlibXg54u7QOLt0755qB/P4vfjwca8xY6V";
2023-11-16 11:27:01 +08:00
hostnames = [ "internal.nas.chn.moe" "[office.chn.moe]:5440" "192.168.82.4" "192.168.1.185" ];
2023-10-22 13:28:15 +08:00
};
"initrd.nas" =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAoMu0HEaFQsnlJL0L6isnkNZdRq0OiDXyaX3+fl3NjT";
2023-11-16 11:27:01 +08:00
hostnames = [ "[office.chn.moe]:5440" "192.168.1.185" ];
2023-10-22 13:28:15 +08:00
};
pc =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMSfREi19OSwQnhdsE8wiNwGSFFJwNGN0M5gN+sdrrLJ";
2023-11-16 11:27:01 +08:00
hostnames = [ "internal.pc.chn.moe" "192.168.8.2.3" ];
2023-10-22 13:28:15 +08:00
};
hpc =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDVpsQW3kZt5alHC6mZhay3ZEe2fRGziG4YJWCv2nn/O";
hostnames = [ "hpc.xmu.edu.cn" ];
};
github =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl";
hostnames = [ "github.com" ];
};
2023-09-12 16:31:20 +08:00
};
2023-10-22 13:28:15 +08:00
in listToAttrs (concatLists (map
(server:
(
if builtins.pathExists ./ssh/${server.name}_rsa.pub then
[{
name = "${server.name}-rsa";
value =
{
publicKey = builtins.readFile ./ssh/${server.name}_rsa.pub;
hostNames = server.value.hostnames;
};
}]
else []
)
++ (
if builtins.pathExists ./ssh/${server.name}_ecdsa.pub then
[{
name = "${server.name}-ecdsa";
value =
{
publicKey = builtins.readFile ./ssh/${server.name}_ecdsa.pub;
hostNames = server.value.hostnames;
};
}]
else []
)
++ (
if server.value ? ed25519 then
[{
name = "${server.name}-ed25519";
value =
{
publicKey = server.value.ed25519;
hostNames = server.value.hostnames;
};
}]
else []
))
(attrsToList servers)));
};
nixpkgs.config =
{
permittedInsecurePackages = with inputs.pkgs;
[
2023-11-22 20:12:41 +08:00
openssl_1_1.name electron_19.name python2.name electron_12.name electron_24.name
2023-10-28 12:07:46 +08:00
zotero.name
2023-10-22 13:28:15 +08:00
];
allowUnfree = true;
};
home-manager =
{
useGlobalPkgs = true;
useUserPackages = true;
};
}
# >= desktop
(
2023-11-10 20:47:05 +08:00
mkIf (builtins.elem inputs.config.nixos.packages.packageSet [ "desktop" "desktop-fat" "workstation" ] )
2023-10-22 13:28:15 +08:00
{
nixos =
{
packages = with inputs.pkgs;
{
_packages =
[
# system management
gparted snapper-gui libsForQt5.qtstyleplugin-kvantum wl-clipboard-x11 kio-fuse wl-mirror
2023-11-10 20:47:05 +08:00
wayland-utils clinfo glxinfo vulkan-tools dracut
2023-10-22 13:28:15 +08:00
# networking
remmina putty mtr-gui
# password and key management
2023-11-22 10:48:00 +08:00
bitwarden
2023-10-22 13:28:15 +08:00
# office
2023-11-22 11:41:36 +08:00
crow-translate zotero pandoc ydict
2023-10-22 13:28:15 +08:00
# media
2023-11-22 10:48:00 +08:00
mpv nomacs
2023-10-22 13:28:15 +08:00
# themes
2023-11-22 10:48:00 +08:00
tela-circle-icon-theme
2023-10-22 13:28:15 +08:00
(
vscode-with-extensions.override
{
vscodeExtensions = with nix-vscode-extensions.vscode-marketplace;
(with equinusocio; [ vsc-community-material-theme vsc-material-theme-icons ])
++ (with github; [ copilot copilot-chat copilot-labs github-vscode-theme ])
++ (with intellsmi; [ comment-translate deepl-translate ])
++ (with ms-python; [ isort python vscode-pylance ])
++ (with ms-toolsai;
[
jupyter jupyter-keymap jupyter-renderers vscode-jupyter-cell-tags vscode-jupyter-slideshow
])
++ (with ms-vscode;
[
cmake-tools cpptools cpptools-extension-pack cpptools-themes hexeditor remote-explorer
test-adapter-converter
])
++ (with ms-vscode-remote; [ remote-ssh remote-containers remote-ssh-edit ])
++ [
donjayamanne.githistory genieai.chatgpt-vscode fabiospampinato.vscode-diff cschlosser.doxdocgen
llvm-vs-code-extensions.vscode-clangd ms-ceintl.vscode-language-pack-zh-hans
oderwat.indent-rainbow
twxs.cmake guyutongxue.cpp-reference znck.grammarly thfriedrich.lammps leetcode.vscode-leetcode
james-yu.latex-workshop gimly81.matlab affenwiesel.matlab-formatter ckolkman.vscode-postgres
yzhang.markdown-all-in-one pkief.material-icon-theme bbenoist.nix ms-ossdata.vscode-postgresql
redhat.vscode-xml dotjoshjohnson.xml jnoortheen.nix-ide xdebug.php-debug
hbenl.vscode-test-explorer
jeff-hykin.better-cpp-syntax fredericbonnet.cmake-test-adapter mesonbuild.mesonbuild
hirse.vscode-ungit fortran-lang.linter-gfortran tboox.xmake-vscode ccls-project.ccls
feiskyer.chatgpt-copilot yukiuuh2936.vscode-modern-fortran-formatter wolframresearch.wolfram
njpipeorgan.wolfram-language-notebook brettm12345.nixfmt-vscode webfreak.debug
gruntfuggly.todo-tree
2023-12-02 15:34:07 +08:00
# restrctured text
lextudio.restructuredtext trond-snekvik.simple-rst
2023-10-22 13:28:15 +08:00
];
}
)
];
2023-12-02 15:34:07 +08:00
_pythonPackages = [(pythonPackages: with pythonPackages;
[
# required by vscode extensions restrucuredtext
esbonio
])];
2023-09-12 16:31:20 +08:00
};
2023-10-22 13:28:15 +08:00
users.sharedModules =
[{
config.home.file.".config/baloofilerc".text =
''
[Basic Settings]
Indexing-Enabled=false
'';
2023-10-22 13:28:15 +08:00
}];
2023-09-12 16:31:20 +08:00
};
2023-10-22 13:28:15 +08:00
programs =
2023-09-18 05:28:02 +08:00
{
2023-10-22 13:28:15 +08:00
wireshark = { enable = true; package = inputs.pkgs.wireshark; };
firefox =
{
enable = true;
languagePacks = [ "zh-CN" "en-US" ];
};
vim.package = inputs.pkgs.genericPackages.vim-full;
2023-09-18 05:28:02 +08:00
};
2023-10-22 13:28:15 +08:00
nixpkgs.config.packageOverrides = pkgs:
2023-09-18 05:28:02 +08:00
{
2023-10-22 13:28:15 +08:00
telegram-desktop = pkgs.telegram-desktop.overrideAttrs (attrs:
{
patches = (if (attrs ? patches) then attrs.patches else []) ++ [ ./telegram.patch ];
});
2023-09-18 05:28:02 +08:00
};
2023-10-22 13:28:15 +08:00
services.pcscd.enable = true;
}
)
2023-11-10 20:47:05 +08:00
# >= desktop-fat
(
mkIf (builtins.elem inputs.config.nixos.packages.packageSet [ "desktop-fat" "workstation" ] )
{
nixos =
{
packages = with inputs.pkgs;
{
_packages =
[
# system management
2023-11-22 11:41:36 +08:00
etcher btrfs-assistant
2023-11-22 10:48:00 +08:00
# password and key management
yubikey-manager yubikey-manager-qt yubikey-personalization yubikey-personalization-gui electrum jabref
# download
qbittorrent nur-xddxdd.baidupcs-go wgetpaste
# development
scrcpy weston cage openbox krita
# media
spotify yesplaymusic simplescreenrecorder imagemagick gimp netease-cloud-music-gtk vlc
# editor
localPackages.typora hdfview
# themes
orchis-theme plasma-overdose-kde-theme materia-kde-theme graphite-kde-theme arc-kde-theme materia-theme
# news
fluent-reader rssguard newsflash newsboat
2023-11-10 20:47:05 +08:00
# nix tools
deploy-rs.deploy-rs nixpkgs-fmt
# instant messager
element-desktop telegram-desktop discord inputs.config.nur.repos.linyinfeng.wemeet # native
cinny-desktop # nur-xddxdd.wine-wechat thunder
# browser
2023-11-22 10:48:00 +08:00
google-chrome microsoft-edge
] ++ (with inputs.lib; filter isDerivation (attrValues plasma5Packages.kdeGear));
2023-11-10 20:47:05 +08:00
};
users.sharedModules =
[{
config.programs =
{
chromium =
{
enable = true;
extensions =
[
{ id = "mpkodccbngfoacfalldjimigbofkhgjn"; } # Aria2 Explorer
{ id = "nngceckbapebfimnlniiiahkandclblb"; } # Bitwarden
{ id = "kbfnbcaeplbcioakkpcpgfkobkghlhen"; } # Grammarly
{ id = "ihnfpdchjnmlehnoeffgcbakfmdjcckn"; } # Pixiv Fanbox Downloader
{ id = "cimiefiiaegbelhefglklhhakcgmhkai"; } # Plasma Integration
{ id = "dkndmhgdcmjdmkdonmbgjpijejdcilfh"; } # Powerful Pixiv Downloader
{ id = "padekgcemlokbadohgkifijomclgjgif"; } # Proxy SwitchyOmega
{ id = "kefjpfngnndepjbopdmoebkipbgkggaa"; } # RSSHub Radar
{ id = "abpdnfjocnmdomablahdcfnoggeeiedb"; } # Save All Resources
{ id = "nbokbjkabcmbfdlbddjidfmibcpneigj"; } # SmoothScroll
{ id = "onepmapfbjohnegdmfhndpefjkppbjkm"; } # SuperCopy 超级复制
{ id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; } # uBlock Origin
{ id = "gppongmhjkpfnbhagpmjfkannfbllamg"; } # Wappalyzer
{ id = "hkbdddpiemdeibjoknnofflfgbgnebcm"; } # YouTube™ 双字幕
{ id = "ekhagklcjbdpajgpjgmbionohlpdbjgc"; } # Zotero Connector
{ id = "ikhdkkncnoglghljlkmcimlnlhkeamad"; } # 划词翻译
{ id = "dhdgffkkebhmkfjojejmpbldmpobfkfo"; } # 篡改猴
{ id = "hipekcciheckooncpjeljhnekcoolahp"; } # Tabliss
{ id = "nkbihfbeogaeaoehlefnkodbefgpgknn"; } # MetaMask
];
};
obs-studio =
{
enable = true;
plugins = with inputs.pkgs.obs-studio-plugins;
[ wlrobs obs-vaapi obs-nvfbc droidcam-obs obs-vkcapture ];
};
2023-11-25 23:05:24 +08:00
doom-emacs = { enable = true; doomPrivateDir = ./doom.d; };
};
}];
2023-11-10 20:47:05 +08:00
};
programs = { steam.enable = true; kdeconnect.enable = true; };
2023-11-10 20:47:05 +08:00
}
)
2023-10-22 13:28:15 +08:00
# >= workstation
(
mkIf (inputs.config.nixos.packages.packageSet == "workstation")
2023-09-01 21:05:26 +08:00
{
2023-10-22 13:28:15 +08:00
nixos.packages = with inputs.pkgs;
2023-09-18 05:28:02 +08:00
{
_packages =
[
# nix tools
2023-10-22 13:28:15 +08:00
nix-template appimage-run nil nixd nix-alien nix-serve node2nix nix-prefetch-github prefetch-npm-deps
nix-prefetch-docker pnpm-lock-export bundix
2023-09-18 05:28:02 +08:00
# instant messager
2023-10-22 13:28:15 +08:00
zoom-us signal-desktop qq nur-xddxdd.wechat-uos slack # jail
2023-09-18 05:28:02 +08:00
# office
libreoffice-qt texstudio poppler_utils pdftk gnuplot pdfchain
(texlive.combine
{
inherit (texlive) scheme-full;
inherit (localPackages) latex-citation-style-language;
})
2023-09-18 05:28:02 +08:00
# development
2023-11-23 23:53:13 +08:00
jetbrains.clion android-studio dbeaver cling clang-tools_16 ccls fprettify aircrack-ng
2023-09-18 05:28:02 +08:00
# media
2023-10-22 13:28:15 +08:00
nur-xddxdd.svp obs-studio waifu2x-converter-cpp inkscape blender
# virtualization
wineWowPackages.stagingFull virt-viewer bottles # wine64
2023-09-18 05:28:02 +08:00
# text editor
2023-10-22 13:28:15 +08:00
appflowy notion-app-enhanced joplin-desktop standardnotes
# math, physics and chemistry
mathematica octaveFull root ovito paraview localPackages.vesta qchem.quantum-espresso
2023-11-26 01:07:18 +08:00
localPackages.vasp localPackages.vaspkit jmol localPackages.v_sim
2023-11-22 10:48:00 +08:00
# encryption and password management
john crunch hashcat
# container and vm
genymotion # davinci-resolve playonlinux
2023-10-22 13:28:15 +08:00
];
_pythonPackages = [(pythonPackages: with pythonPackages;
[
phonopy tensorflow keras openai scipy scikit-learn jupyterlab
])];
_prebuildPackages =
[
httplib magic-enum xtensor boost cereal cxxopts ftxui yaml-cpp gfortran gcc10 python2
2023-11-22 11:41:36 +08:00
gcc13Stdenv
2023-10-22 13:28:15 +08:00
];
2023-09-18 05:28:02 +08:00
};
2023-10-22 13:28:15 +08:00
programs =
{
anime-game-launcher = { enable = true; package = inputs.pkgs.anime-game-launcher; };
honkers-railway-launcher = { enable = true; package = inputs.pkgs.honkers-railway-launcher; };
nix-ld.enable = true;
gamemode =
2023-09-18 05:28:02 +08:00
{
2023-10-22 13:28:15 +08:00
enable = true;
settings =
2023-09-01 21:05:26 +08:00
{
2023-10-22 13:28:15 +08:00
general.renice = 10;
gpu =
2023-09-18 14:02:05 +08:00
{
2023-10-22 13:28:15 +08:00
apply_gpu_optimisations = "accept-responsibility";
nv_powermizer_mode = 1;
2023-09-18 14:02:05 +08:00
};
2023-10-22 13:28:15 +08:00
custom = let notify-send = "${inputs.pkgs.libnotify}/bin/notify-send"; in
2023-09-18 14:02:05 +08:00
{
2023-10-22 13:28:15 +08:00
start = "${notify-send} 'GameMode started'";
end = "${notify-send} 'GameMode ended'";
2023-09-18 14:02:05 +08:00
};
2023-09-18 05:28:02 +08:00
};
};
2023-10-22 13:28:15 +08:00
chromium =
2023-09-01 21:05:26 +08:00
{
2023-10-22 13:28:15 +08:00
enable = true;
extraOpts.PasswordManagerEnabled = false;
2023-09-01 21:05:26 +08:00
};
};
2023-10-22 13:28:15 +08:00
}
)
# apply package configs
{
environment.systemPackages = let inherit (inputs.lib.lists) subtractLists; in with inputs.config.nixos.packages;
(subtractLists excludePackages (_packages ++ extraPackages))
++ [
(inputs.pkgs.python3.withPackages (pythonPackages:
subtractLists
(builtins.concatLists (builtins.map (packageFunction: packageFunction pythonPackages)
excludePythonPackages))
(builtins.concatLists (builtins.map (packageFunction: packageFunction pythonPackages)
(_pythonPackages ++ extraPythonPackages)))))
(inputs.pkgs.callPackage ({ stdenv }: stdenv.mkDerivation
{
name = "prebuild-packages";
propagateBuildInputs = subtractLists excludePrebuildPackages (_prebuildPackages ++ extraPrebuildPackages);
phases = [ "installPhase" ];
installPhase =
''
runHook preInstall
mkdir -p $out
runHook postInstall
'';
}) {})
];
2023-09-01 21:05:26 +08:00
}
2023-10-22 13:28:15 +08:00
];
2023-07-18 13:55:24 +08:00
}
2023-07-25 18:04:29 +08:00
2023-09-01 21:05:26 +08:00
# programs.firejail =
# {
# enable = true;
# wrappedBinaries =
# {
# qq =
# {
# executable = "${inputs.pkgs.qq}/bin/qq";
# profile = "${inputs.pkgs.firejail}/etc/firejail/linuxqq.profile";
# };
# };
# };
2023-07-25 18:04:29 +08:00
# config.nixpkgs.config.replaceStdenv = { pkgs }: pkgs.ccacheStdenv;
2023-09-01 21:05:26 +08:00
# only replace stdenv for large and tested packages
# config.programs.ccache.packageNames = [ "webkitgtk" "libreoffice" "tensorflow" "linux" "chromium" ];
# config.nixpkgs.overlays = [(final: prev:
# {
# libreoffice-qt = prev.libreoffice-qt.override (prev: { unwrapped = prev.unwrapped.override
# (prev: { stdenv = final.ccacheStdenv.override { stdenv = prev.stdenv; }; }); });
# python3 = prev.python3.override { packageOverrides = python-final: python-prev:
# {
# tensorflow = python-prev.tensorflow.override
# { stdenv = final.ccacheStdenv.override { stdenv = python-prev.tensorflow.stdenv; }; };
# };};
# # webkitgtk = prev.webkitgtk.override (prev:
# # { stdenv = final.ccacheStdenv.override { stdenv = prev.stdenv; }; enableUnifiedBuilds = false; });
# wxGTK31 = prev.wxGTK31.override { stdenv = final.ccacheStdenv.override { stdenv = prev.wxGTK31.stdenv; }; };
# wxGTK32 = prev.wxGTK32.override { stdenv = final.ccacheStdenv.override { stdenv = prev.wxGTK32.stdenv; }; };
# # firefox-unwrapped = prev.firefox-unwrapped.override
# # { stdenv = final.ccacheStdenv.override { stdenv = prev.firefox-unwrapped.stdenv; }; };
# # chromium = prev.chromium.override
# # { stdenv = final.ccacheStdenv.override { stdenv = prev.chromium.stdenv; }; };
# # linuxPackages_xanmod_latest = prev.linuxPackages_xanmod_latest.override
# # {
# # kernel = prev.linuxPackages_xanmod_latest.kernel.override
# # {
# # stdenv = final.ccacheStdenv.override { stdenv = prev.linuxPackages_xanmod_latest.kernel.stdenv; };
# # buildPackages = prev.linuxPackages_xanmod_latest.kernel.buildPackages //
# # { stdenv = prev.linuxPackages_xanmod_latest.kernel.buildPackages.stdenv; };
# # };
# # };
# })];
# config.programs.ccache.packageNames = [ "libreoffice-unwrapped" ];
2023-07-25 18:04:29 +08:00
# cross-x86_64-pc-linux-musl/gcc
# dev-cpp/cpp-httplib ? how to use
# dev-cpp/cppcoro
# dev-cpp/date
# dev-cpp/nameof
# dev-cpp/scnlib
# dev-cpp/tgbot-cpp
# dev-libs/pocketfft
# dev-util/intel-hpckit
# dev-util/nvhpc
# kde-misc/wallpaper-engine-kde-plugin
# media-fonts/arphicfonts
# media-fonts/sarasa-gothic
# media-gfx/flameshot
# media-libs/libva-intel-driver
# media-libs/libva-intel-media-driver
# media-sound/netease-cloud-music
# net-vpn/frp
# net-wireless/bluez-tools
# sci-libs/mkl
# sci-libs/openblas
# sci-libs/pfft
# sci-libs/scalapack
# sci-libs/wannier90
# sci-mathematics/ginac
# sci-mathematics/mathematica
# sci-mathematics/octave
# sci-physics/lammps::touchfish-os
# sci-physics/vsim
# sci-visualization/scidavis
# sys-apps/flatpak
# sys-cluster/modules
# sys-devel/distcc
# sys-fs/btrfs-progs
# sys-fs/compsize
# sys-fs/dosfstools
# sys-fs/duperemove
# sys-fs/exfatprogs
# sys-fs/mdadm
# sys-fs/ntfs3g
# sys-kernel/dracut
# sys-kernel/linux-firmware
# sys-kernel/xanmod-sources
# sys-kernel/xanmod-sources:6.1.12
# sys-kernel/xanmod-sources::touchfish-os
# sys-libs/libbacktrace
# sys-libs/libselinux
# x11-apps/xinput
# x11-base/xorg-apps
# x11-base/xorg-fonts
# x11-base/xorg-server
# x11-misc/imwheel
# x11-misc/optimus-manager
# x11-misc/unclutter-xfixes
2023-09-19 18:44:03 +08:00
# ++ ( with inputs.pkgs.pkgsCross.mingwW64.buildPackages; [ gcc ] );