mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 04:39:23 +08:00
整理 packages
This commit is contained in:
@@ -35,7 +35,7 @@ inputs:
|
||||
networking.hostname = "surface";
|
||||
};
|
||||
hardware = { cpus = [ "intel" ]; gpu.type = "intel"; };
|
||||
packages.packageSet = "desktop-fat";
|
||||
packages.packageSet = "desktop-extra";
|
||||
virtualization = { docker.enable = true; waydroid.enable = true; };
|
||||
services =
|
||||
{
|
||||
|
||||
39
modules/packages/chromium.nix
Normal file
39
modules/packages/chromium.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
inputs:
|
||||
{
|
||||
config = inputs.lib.mkIf (builtins.elem "desktop-extra" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
programs.chromium = { enable = true; extraOpts.PasswordManagerEnabled = false; };
|
||||
nixos.user.sharedModules =
|
||||
[{
|
||||
config.programs.chromium =
|
||||
{
|
||||
enable = true;
|
||||
extensions =
|
||||
# TODO: declartive way to install extensions, with fixed xpi file
|
||||
# TODO: declartively config
|
||||
[
|
||||
{ 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
|
||||
{ id = "bpoadfkcbjbfhfodiogcnhhhpibjhbnh"; } # 沉浸式翻译
|
||||
];
|
||||
};
|
||||
}];
|
||||
};
|
||||
}
|
||||
@@ -8,9 +8,10 @@ inputs:
|
||||
[
|
||||
# no gui, only used for specific purpose
|
||||
"server"
|
||||
"server-extra"
|
||||
# gui, for daily use, but not install large programs such as matlab
|
||||
"desktop"
|
||||
"desktop-fat"
|
||||
"desktop-extra"
|
||||
# nearly everything
|
||||
"workstation"
|
||||
];
|
||||
@@ -35,32 +36,31 @@ inputs:
|
||||
_prebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
|
||||
};
|
||||
config =
|
||||
let
|
||||
inherit (builtins) concatLists map;
|
||||
in
|
||||
{
|
||||
environment.systemPackages = let inherit (inputs.lib.lists) subtractLists; in with inputs.config.nixos.packages;
|
||||
(subtractLists excludePackages (_packages ++ extraPackages))
|
||||
++ [
|
||||
(inputs.pkgs.python3.withPackages (pythonPackages:
|
||||
subtractLists
|
||||
(concatLists (map (packageFunction: packageFunction pythonPackages) excludePythonPackages))
|
||||
(concatLists (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
|
||||
'';
|
||||
}) {})
|
||||
];
|
||||
};
|
||||
{
|
||||
environment.systemPackages = let inherit (inputs.lib.lists) subtractLists; in with inputs.config.nixos.packages;
|
||||
(inputs.lib.lists.subtractLists excludePackages (_packages ++ extraPackages))
|
||||
++ [
|
||||
(inputs.pkgs.python3.withPackages (pythonPackages:
|
||||
inputs.lib.lists.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 = inputs.lib.lists.subtractLists excludePrebuildPackages
|
||||
(_prebuildPackages ++ extraPrebuildPackages);
|
||||
phases = [ "installPhase" ];
|
||||
installPhase =
|
||||
''
|
||||
runHook preInstall
|
||||
mkdir -p $out
|
||||
runHook postInstall
|
||||
'';
|
||||
}) {})
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
# programs.firejail =
|
||||
|
||||
46
modules/packages/desktop-extra.nix
Normal file
46
modules/packages/desktop-extra.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
inputs:
|
||||
{
|
||||
config = inputs.lib.mkIf (builtins.elem "desktop-extra" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
nixos =
|
||||
{
|
||||
packages = with inputs.pkgs;
|
||||
{
|
||||
_packages =
|
||||
[
|
||||
# system management
|
||||
etcher btrfs-assistant snapper-gui libsForQt5.qtstyleplugin-kvantum ventoy-full cpu-x
|
||||
# password and key management
|
||||
yubikey-manager yubikey-manager-qt yubikey-personalization yubikey-personalization-gui bitwarden
|
||||
# download
|
||||
qbittorrent nur-xddxdd.baidupcs-go wgetpaste
|
||||
# development
|
||||
scrcpy weston cage openbox krita
|
||||
# media
|
||||
spotify yesplaymusic simplescreenrecorder imagemagick gimp netease-cloud-music-gtk vlc obs-studio
|
||||
waifu2x-converter-cpp inkscape blender
|
||||
# editor
|
||||
unstablePackages.typora
|
||||
# themes
|
||||
orchis-theme plasma-overdose-kde-theme materia-kde-theme graphite-kde-theme arc-kde-theme materia-theme
|
||||
# news
|
||||
fluent-reader
|
||||
# nix tools
|
||||
deploy-rs.deploy-rs 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
|
||||
# office
|
||||
crow-translate zotero pandoc ydict libreoffice-qt texstudio poppler_utils pdftk gnuplot pdfchain hdfview
|
||||
(texlive.combine { inherit (texlive) scheme-full; inherit (localPackages) citation-style-language; })
|
||||
nextcloud-client
|
||||
# math, physics and chemistry
|
||||
octaveFull root ovito localPackages.vesta localPackages.vaspkit localPackages.v-sim
|
||||
] ++ (with inputs.lib; filter isDerivation (attrValues plasma5Packages.kdeGear));
|
||||
};
|
||||
};
|
||||
programs.kdeconnect.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
inputs:
|
||||
{
|
||||
imports = inputs.localLib.findModules ./.;
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkIf;
|
||||
in mkIf (builtins.elem "desktop-fat" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
nixos =
|
||||
{
|
||||
packages = with inputs.pkgs;
|
||||
{
|
||||
_packages =
|
||||
[
|
||||
# system management
|
||||
etcher btrfs-assistant snapper-gui libsForQt5.qtstyleplugin-kvantum ventoy-full cpu-x
|
||||
# password and key management
|
||||
yubikey-manager yubikey-manager-qt yubikey-personalization yubikey-personalization-gui bitwarden
|
||||
# download
|
||||
qbittorrent nur-xddxdd.baidupcs-go wgetpaste
|
||||
# development
|
||||
scrcpy weston cage openbox krita
|
||||
# media
|
||||
spotify yesplaymusic simplescreenrecorder imagemagick gimp netease-cloud-music-gtk vlc obs-studio
|
||||
waifu2x-converter-cpp inkscape blender
|
||||
# editor
|
||||
unstablePackages.typora
|
||||
# themes
|
||||
orchis-theme plasma-overdose-kde-theme materia-kde-theme graphite-kde-theme arc-kde-theme materia-theme
|
||||
# news
|
||||
fluent-reader
|
||||
# nix tools
|
||||
deploy-rs.deploy-rs 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
|
||||
# office
|
||||
crow-translate zotero pandoc ydict libreoffice-qt texstudio poppler_utils pdftk gnuplot pdfchain hdfview
|
||||
(texlive.combine { inherit (texlive) scheme-full; inherit (localPackages) citation-style-language; })
|
||||
nextcloud-client
|
||||
# math, physics and chemistry
|
||||
octaveFull root ovito localPackages.vesta localPackages.vaspkit localPackages.v-sim
|
||||
] ++ (with inputs.lib; filter isDerivation (attrValues plasma5Packages.kdeGear));
|
||||
};
|
||||
};
|
||||
programs.kdeconnect.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
inputs:
|
||||
{
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkIf;
|
||||
in mkIf (builtins.elem "desktop-fat" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
programs.steam =
|
||||
{
|
||||
enable = true;
|
||||
package = inputs.pkgs.steam.override (prev:
|
||||
{
|
||||
steam = prev.steam.overrideAttrs (prev:
|
||||
{
|
||||
postInstall = prev.postInstall +
|
||||
''
|
||||
sed -i 's#Comment\[zh_CN\]=.*$#Comment\[zh_CN\]=思题慕®学习平台#' $out/share/applications/steam.desktop
|
||||
'';
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
inputs:
|
||||
{
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkIf;
|
||||
in mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
programs.chromium = { enable = true; extraOpts.PasswordManagerEnabled = false; };
|
||||
nixos.user.sharedModules =
|
||||
[{
|
||||
config.programs.chromium =
|
||||
{
|
||||
enable = true;
|
||||
extensions =
|
||||
# TODO: declartive way to install extensions, with fixed xpi file
|
||||
# TODO: declartively config
|
||||
[
|
||||
{ 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
|
||||
{ id = "bpoadfkcbjbfhfodiogcnhhhpibjhbnh"; } # 沉浸式翻译
|
||||
];
|
||||
};
|
||||
}];
|
||||
};
|
||||
}
|
||||
@@ -1,60 +1,56 @@
|
||||
inputs:
|
||||
{
|
||||
imports = inputs.localLib.findModules ./.;
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkIf;
|
||||
in mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
|
||||
config = inputs.lib.mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
nixos =
|
||||
{
|
||||
nixos =
|
||||
{
|
||||
packages._packages = with inputs.pkgs;
|
||||
[
|
||||
# system management
|
||||
gparted kio-fuse wayland-utils clinfo glxinfo vulkan-tools dracut
|
||||
(
|
||||
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
|
||||
tela-circle-icon-theme localPackages.win11os-kde localPackages.fluent-kde localPackages.blurred-wallpaper
|
||||
localPackages.slate utterly-nord-plasma
|
||||
# terminal
|
||||
unstablePackages.warp-terminal
|
||||
# development
|
||||
adb-sync
|
||||
# virtual keyboard
|
||||
localPackages.kylin-virtual-keyboard
|
||||
];
|
||||
};
|
||||
programs =
|
||||
{
|
||||
adb.enable = true;
|
||||
wireshark = { enable = true; package = inputs.pkgs.wireshark; };
|
||||
vim.package = inputs.pkgs.vim-full;
|
||||
yubikey-touch-detector.enable = true;
|
||||
};
|
||||
nixpkgs.config.packageOverrides = pkgs:
|
||||
{
|
||||
telegram-desktop = pkgs.telegram-desktop.overrideAttrs (attrs:
|
||||
{
|
||||
patches = (if (attrs ? patches) then attrs.patches else []) ++ [ ./telegram.patch ];
|
||||
});
|
||||
};
|
||||
services.pcscd.enable = true;
|
||||
packages._packages = with inputs.pkgs;
|
||||
[
|
||||
# system management
|
||||
gparted kio-fuse wayland-utils clinfo glxinfo vulkan-tools dracut
|
||||
(
|
||||
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
|
||||
tela-circle-icon-theme localPackages.win11os-kde localPackages.fluent-kde localPackages.blurred-wallpaper
|
||||
localPackages.slate utterly-nord-plasma
|
||||
# terminal
|
||||
unstablePackages.warp-terminal
|
||||
# development
|
||||
adb-sync
|
||||
# virtual keyboard
|
||||
localPackages.kylin-virtual-keyboard
|
||||
];
|
||||
};
|
||||
programs =
|
||||
{
|
||||
adb.enable = true;
|
||||
wireshark = { enable = true; package = inputs.pkgs.wireshark; };
|
||||
vim.package = inputs.pkgs.vim-full;
|
||||
yubikey-touch-detector.enable = true;
|
||||
};
|
||||
nixpkgs.config.packageOverrides = pkgs:
|
||||
{
|
||||
telegram-desktop = pkgs.telegram-desktop.overrideAttrs (attrs:
|
||||
{
|
||||
patches = (if (attrs ? patches) then attrs.patches else []) ++ [ ./telegram.patch ];
|
||||
});
|
||||
};
|
||||
services.pcscd.enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
inputs:
|
||||
{
|
||||
imports = inputs.localLib.findModules ./.;
|
||||
config.nixos.user.sharedModules = inputs.lib.mkIf inputs.config.nixos.system.gui.enable
|
||||
[{
|
||||
config.programs.plasma = inputs.lib.mkMerge
|
||||
[
|
||||
# TODO: autostart, panel, discard user changed settings
|
||||
# general
|
||||
{
|
||||
enable = true;
|
||||
configFile.plasma-localerc = { Formats.LANG.value = "en_US.UTF-8"; Translations.LANGUAGE.value = "zh_CN"; };
|
||||
}
|
||||
# kwin
|
||||
{
|
||||
kwin.titlebarButtons =
|
||||
{
|
||||
right = [ "help" "keep-below-windows" "keep-above-windows" "minimize" "maximize" "close" ];
|
||||
left = [ "more-window-actions" ];
|
||||
};
|
||||
windows.allowWindowsToRememberPositions = false;
|
||||
configFile =
|
||||
{
|
||||
plasmanotifyrc.Notifications.PopupPosition.value = "BottomRight";
|
||||
kwinrc =
|
||||
{
|
||||
Tiling.padding.value = 4;
|
||||
Wayland."InputMethod[$e]".value = "/run/current-system/sw/share/applications/org.fcitx.Fcitx5.desktop";
|
||||
Windows.RollOverDesktops.value = true;
|
||||
Compositing = { AllowTearing.value = false; WindowsBlockCompositing.value = false; };
|
||||
};
|
||||
};
|
||||
}
|
||||
# baloo
|
||||
{ configFile.baloofilerc."Basic Settings".Indexing-Enabled.value = false; }
|
||||
# dolphin and file chooser
|
||||
{
|
||||
configFile =
|
||||
{
|
||||
dolphinrc =
|
||||
{
|
||||
General = { ShowFullPath.value = true; FilterBar.value = true; RememberOpenedTabs.value = false; };
|
||||
PreviewSettings.Plugins.value = builtins.concatStringsSep ","
|
||||
[
|
||||
"blenderthumbnail"
|
||||
"comicbookthumbnail"
|
||||
"djvuthumbnail"
|
||||
"ebookthumbnail"
|
||||
"exrthumbnail"
|
||||
"marble_thumbnail_geojson"
|
||||
"marble_thumbnail_gpx"
|
||||
"jpegthumbnail"
|
||||
"marble_thumbnail_kmz"
|
||||
"marble_thumbnail_kml"
|
||||
"kraorathumbnail"
|
||||
"windowsimagethumbnail"
|
||||
"windowsexethumbnail"
|
||||
"mltpreview"
|
||||
"mobithumbnail"
|
||||
"opendocumentthumbnail"
|
||||
"marble_thumbnail_osm"
|
||||
"palathumbcreator"
|
||||
"gsthumbnail"
|
||||
"rawthumbnail"
|
||||
"svgthumbnail"
|
||||
"imagethumbnail"
|
||||
"fontthumbnail"
|
||||
"directorythumbnail"
|
||||
"textthumbnail"
|
||||
"webarchivethumbnail"
|
||||
"ffmpegthumbs"
|
||||
"audiothumbnail"
|
||||
];
|
||||
};
|
||||
kdeglobals."KFileDialog Settings" =
|
||||
{
|
||||
"Allow Expansion".value = true;
|
||||
"Automatically select filename extension".value = true;
|
||||
"Show Bookmarks".value = true;
|
||||
"Show Full Path".value = true;
|
||||
"Show Inline Previews".value = true;
|
||||
"Show Preview".value = true;
|
||||
"Show Speedbar".value = true;
|
||||
"Show hidden files".value = true;
|
||||
"Sort by".value = "Name";
|
||||
"Sort directories first".value = true;
|
||||
"Sort hidden files last".value = true;
|
||||
"View Style".value = "DetailTree";
|
||||
};
|
||||
};
|
||||
}
|
||||
# krunner
|
||||
{ configFile.krunnerrc = { General.FreeFloating.value = true; Plugins.baloosearchEnabled.value = false; }; }
|
||||
# lock screen
|
||||
{ configFile.kscreenlockerrc.Daemon.Autolock.value = false; }
|
||||
];
|
||||
}];
|
||||
}
|
||||
7
modules/packages/emacs/default.nix
Normal file
7
modules/packages/emacs/default.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
inputs:
|
||||
{
|
||||
config = inputs.lib.mkIf (builtins.elem "workstation" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
nixos.user.sharedModules = [{ config.programs.doom-emacs = { enable = true; doomPrivateDir = ./doom.d; }; }];
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
inputs:
|
||||
{
|
||||
config = inputs.lib.mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
|
||||
config = inputs.lib.mkIf (builtins.elem "desktop-extra" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
services.flatpak =
|
||||
{
|
||||
|
||||
7
modules/packages/gpg.nix
Normal file
7
modules/packages/gpg.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
inputs:
|
||||
{
|
||||
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
programs.gnupg.agent = { enable = true; pinentryFlavor = "tty"; };
|
||||
};
|
||||
}
|
||||
101
modules/packages/plasma/default.nix
Normal file
101
modules/packages/plasma/default.nix
Normal file
@@ -0,0 +1,101 @@
|
||||
inputs:
|
||||
{
|
||||
imports = inputs.localLib.findModules ./.;
|
||||
config = inputs.lib.mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
nixos.user.sharedModules =
|
||||
[{
|
||||
config.programs.plasma = inputs.lib.mkMerge
|
||||
[
|
||||
# TODO: autostart, panel, discard user changed settings
|
||||
# general
|
||||
{
|
||||
enable = true;
|
||||
configFile.plasma-localerc = { Formats.LANG.value = "en_US.UTF-8"; Translations.LANGUAGE.value = "zh_CN"; };
|
||||
}
|
||||
# kwin
|
||||
{
|
||||
kwin.titlebarButtons =
|
||||
{
|
||||
right = [ "help" "keep-below-windows" "keep-above-windows" "minimize" "maximize" "close" ];
|
||||
left = [ "more-window-actions" ];
|
||||
};
|
||||
windows.allowWindowsToRememberPositions = false;
|
||||
configFile =
|
||||
{
|
||||
plasmanotifyrc.Notifications.PopupPosition.value = "BottomRight";
|
||||
kwinrc =
|
||||
{
|
||||
Tiling.padding.value = 4;
|
||||
Wayland."InputMethod[$e]".value = "/run/current-system/sw/share/applications/org.fcitx.Fcitx5.desktop";
|
||||
Windows.RollOverDesktops.value = true;
|
||||
Compositing = { AllowTearing.value = false; WindowsBlockCompositing.value = false; };
|
||||
};
|
||||
};
|
||||
}
|
||||
# baloo
|
||||
{ configFile.baloofilerc."Basic Settings".Indexing-Enabled.value = false; }
|
||||
# dolphin and file chooser
|
||||
{
|
||||
configFile =
|
||||
{
|
||||
dolphinrc =
|
||||
{
|
||||
General = { ShowFullPath.value = true; FilterBar.value = true; RememberOpenedTabs.value = false; };
|
||||
PreviewSettings.Plugins.value = builtins.concatStringsSep ","
|
||||
[
|
||||
"blenderthumbnail"
|
||||
"comicbookthumbnail"
|
||||
"djvuthumbnail"
|
||||
"ebookthumbnail"
|
||||
"exrthumbnail"
|
||||
"marble_thumbnail_geojson"
|
||||
"marble_thumbnail_gpx"
|
||||
"jpegthumbnail"
|
||||
"marble_thumbnail_kmz"
|
||||
"marble_thumbnail_kml"
|
||||
"kraorathumbnail"
|
||||
"windowsimagethumbnail"
|
||||
"windowsexethumbnail"
|
||||
"mltpreview"
|
||||
"mobithumbnail"
|
||||
"opendocumentthumbnail"
|
||||
"marble_thumbnail_osm"
|
||||
"palathumbcreator"
|
||||
"gsthumbnail"
|
||||
"rawthumbnail"
|
||||
"svgthumbnail"
|
||||
"imagethumbnail"
|
||||
"fontthumbnail"
|
||||
"directorythumbnail"
|
||||
"textthumbnail"
|
||||
"webarchivethumbnail"
|
||||
"ffmpegthumbs"
|
||||
"audiothumbnail"
|
||||
];
|
||||
};
|
||||
kdeglobals."KFileDialog Settings" =
|
||||
{
|
||||
"Allow Expansion".value = true;
|
||||
"Automatically select filename extension".value = true;
|
||||
"Show Bookmarks".value = true;
|
||||
"Show Full Path".value = true;
|
||||
"Show Inline Previews".value = true;
|
||||
"Show Preview".value = true;
|
||||
"Show Speedbar".value = true;
|
||||
"Show hidden files".value = true;
|
||||
"Sort by".value = "Name";
|
||||
"Sort directories first".value = true;
|
||||
"Sort hidden files last".value = true;
|
||||
"View Style".value = "DetailTree";
|
||||
};
|
||||
};
|
||||
}
|
||||
# krunner
|
||||
{ configFile.krunnerrc = { General.FreeFloating.value = true; Plugins.baloosearchEnabled.value = false; }; }
|
||||
# lock screen
|
||||
{ configFile.kscreenlockerrc.Daemon.Autolock.value = false; }
|
||||
];
|
||||
}];
|
||||
};
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
inputs:
|
||||
{
|
||||
config = inputs.lib.mkIf inputs.config.nixos.system.gui.enable
|
||||
config = inputs.lib.mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
nixos.user.sharedModules =
|
||||
[(hmInputs: {
|
||||
[{
|
||||
config =
|
||||
{
|
||||
programs.plasma =
|
||||
@@ -69,7 +69,7 @@ inputs:
|
||||
[ "Opacity=1" ] [ "Opacity=0.9\nBlur=true" ]
|
||||
(builtins.readFile "${inputs.pkgs.konsole}/share/konsole/Breeze.colorscheme");
|
||||
};
|
||||
})];
|
||||
}];
|
||||
environment.persistence =
|
||||
let impermanence = inputs.config.nixos.system.impermanence;
|
||||
in inputs.lib.mkIf impermanence.enable (inputs.lib.mkMerge (builtins.map
|
||||
143
modules/packages/server.nix
Normal file
143
modules/packages/server.nix
Normal file
@@ -0,0 +1,143 @@
|
||||
inputs:
|
||||
{
|
||||
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
nixos =
|
||||
{
|
||||
packages = with inputs.pkgs;
|
||||
{
|
||||
_packages =
|
||||
[
|
||||
# shell
|
||||
ksh
|
||||
# basic tools
|
||||
beep dos2unix gnugrep pv tmux screen parallel tldr cowsay jq zellij neofetch ipfetch localPackages.pslist
|
||||
fastfetch reptyr
|
||||
# lsxx
|
||||
pciutils usbutils lshw util-linux lsof dmidecode
|
||||
# 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}" {})
|
||||
inputs.topInputs.nix-inspect.packages."${inputs.config.nixos.system.nixpkgs.arch}-linux".default
|
||||
# office
|
||||
todo-txt-cli pdfgrep
|
||||
# development
|
||||
gdb try inputs.topInputs.plasma-manager.packages.${inputs.pkgs.system}.rc2nix hexo-cli gh
|
||||
# install per project
|
||||
# stdenv gfortran nodejs
|
||||
# library
|
||||
# fmt fmt.dev localPackages.nameof localPackages.matplotplusplus highfive hdf5 hdf5.dev
|
||||
# localPackages.concurrencpp localPackages.biu localPackages.magik-enum
|
||||
# (
|
||||
# runCommand "concurrencpp" {}
|
||||
# "mkdir $out; ln -s ${localPackages.concurrencpp}/include/concurrencpp-* $out/include"
|
||||
# )
|
||||
# eigen (runCommand "eigen" {} "mkdir $out; ln -s ${eigen}/include/eigen3 $out/include")
|
||||
# stupid things
|
||||
toilet lolcat
|
||||
]
|
||||
++ (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
|
||||
])];
|
||||
};
|
||||
user.sharedModules = [(home-inputs:
|
||||
{
|
||||
config.programs =
|
||||
{
|
||||
direnv = { enable = true; nix-direnv.enable = true; };
|
||||
git =
|
||||
{
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
extraConfig =
|
||||
{
|
||||
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 =
|
||||
{
|
||||
enable = true;
|
||||
options =
|
||||
{
|
||||
side-by-side = true;
|
||||
navigate = true;
|
||||
syntax-theme = "GitHub";
|
||||
light = true;
|
||||
zero-style = "syntax white";
|
||||
line-numbers-zero-style = "#ffffff";
|
||||
};
|
||||
};
|
||||
};
|
||||
vim =
|
||||
{
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
packageConfigurable = inputs.config.programs.vim.package;
|
||||
settings =
|
||||
{
|
||||
number = true;
|
||||
expandtab = false;
|
||||
shiftwidth = 2;
|
||||
tabstop = 2;
|
||||
};
|
||||
extraConfig =
|
||||
''
|
||||
set clipboard=unnamedplus
|
||||
colorscheme evening
|
||||
'';
|
||||
};
|
||||
};
|
||||
})];
|
||||
};
|
||||
programs =
|
||||
{
|
||||
nix-index-database.comma.enable = true;
|
||||
nix-index.enable = true;
|
||||
command-not-found.enable = false;
|
||||
autojump.enable = true;
|
||||
git =
|
||||
{
|
||||
enable = true;
|
||||
package = inputs.pkgs.gitFull;
|
||||
lfs.enable = true;
|
||||
config =
|
||||
{
|
||||
init.defaultBranch = "main";
|
||||
core = { quotepath = false; editor = "vim"; };
|
||||
};
|
||||
};
|
||||
yazi.enable = true;
|
||||
mosh.enable = true;
|
||||
};
|
||||
services =
|
||||
{
|
||||
fwupd.enable = true;
|
||||
udev.packages = with inputs.pkgs; [ yubikey-personalization libfido2 ];
|
||||
};
|
||||
home-manager = { useGlobalPkgs = true; useUserPackages = true; };
|
||||
};
|
||||
}
|
||||
@@ -1,149 +0,0 @@
|
||||
inputs:
|
||||
{
|
||||
imports = inputs.localLib.findModules ./.;
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkIf;
|
||||
inherit (builtins) concatLists map listToAttrs;
|
||||
inherit (inputs.localLib) attrsToList;
|
||||
in mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
nixos =
|
||||
{
|
||||
packages = with inputs.pkgs;
|
||||
{
|
||||
_packages =
|
||||
[
|
||||
# shell
|
||||
ksh
|
||||
# basic tools
|
||||
beep dos2unix gnugrep pv tmux screen parallel tldr cowsay jq zellij neofetch ipfetch localPackages.pslist
|
||||
fastfetch reptyr
|
||||
# lsxx
|
||||
pciutils usbutils lshw util-linux lsof dmidecode
|
||||
# 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}" {})
|
||||
inputs.topInputs.nix-inspect.packages."${inputs.config.nixos.system.nixpkgs.arch}-linux".default
|
||||
# office
|
||||
todo-txt-cli pdfgrep
|
||||
# development
|
||||
gdb try inputs.topInputs.plasma-manager.packages.${inputs.pkgs.system}.rc2nix hexo-cli gh
|
||||
# install per project
|
||||
# stdenv gfortran nodejs
|
||||
# library
|
||||
# fmt fmt.dev localPackages.nameof localPackages.matplotplusplus highfive hdf5 hdf5.dev
|
||||
# localPackages.concurrencpp localPackages.biu localPackages.magik-enum
|
||||
# (
|
||||
# runCommand "concurrencpp" {}
|
||||
# "mkdir $out; ln -s ${localPackages.concurrencpp}/include/concurrencpp-* $out/include"
|
||||
# )
|
||||
# eigen (runCommand "eigen" {} "mkdir $out; ln -s ${eigen}/include/eigen3 $out/include")
|
||||
# stupid things
|
||||
toilet lolcat
|
||||
]
|
||||
++ (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
|
||||
])];
|
||||
};
|
||||
user.sharedModules = [(home-inputs:
|
||||
{
|
||||
config.programs =
|
||||
{
|
||||
direnv = { enable = true; nix-direnv.enable = true; };
|
||||
git =
|
||||
{
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
extraConfig =
|
||||
{
|
||||
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 =
|
||||
{
|
||||
enable = true;
|
||||
options =
|
||||
{
|
||||
side-by-side = true;
|
||||
navigate = true;
|
||||
syntax-theme = "GitHub";
|
||||
light = true;
|
||||
zero-style = "syntax white";
|
||||
line-numbers-zero-style = "#ffffff";
|
||||
};
|
||||
};
|
||||
};
|
||||
vim =
|
||||
{
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
packageConfigurable = inputs.config.programs.vim.package;
|
||||
settings =
|
||||
{
|
||||
number = true;
|
||||
expandtab = false;
|
||||
shiftwidth = 2;
|
||||
tabstop = 2;
|
||||
};
|
||||
extraConfig =
|
||||
''
|
||||
set clipboard=unnamedplus
|
||||
colorscheme evening
|
||||
'';
|
||||
};
|
||||
};
|
||||
})];
|
||||
};
|
||||
programs =
|
||||
{
|
||||
nix-index-database.comma.enable = true;
|
||||
nix-index.enable = true;
|
||||
command-not-found.enable = false;
|
||||
autojump.enable = true;
|
||||
git =
|
||||
{
|
||||
enable = true;
|
||||
package = inputs.pkgs.gitFull;
|
||||
lfs.enable = true;
|
||||
config =
|
||||
{
|
||||
init.defaultBranch = "main";
|
||||
core = { quotepath = false; editor = "vim"; };
|
||||
};
|
||||
};
|
||||
yazi.enable = true;
|
||||
mosh.enable = true;
|
||||
};
|
||||
services =
|
||||
{
|
||||
fwupd.enable = true;
|
||||
udev.packages = with inputs.pkgs; [ yubikey-personalization libfido2 ];
|
||||
};
|
||||
home-manager = { useGlobalPkgs = true; useUserPackages = true; };
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
inputs:
|
||||
{
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkIf;
|
||||
in mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
programs.gnupg.agent = { enable = true; pinentryFlavor = "tty"; };
|
||||
};
|
||||
}
|
||||
@@ -1,195 +0,0 @@
|
||||
inputs:
|
||||
{
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkIf;
|
||||
inherit (builtins) concatLists map listToAttrs;
|
||||
inherit (inputs.localLib) attrsToList;
|
||||
in mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
services.openssh.knownHosts =
|
||||
let
|
||||
servers =
|
||||
{
|
||||
vps6 =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO5ZcvyRyOnUCuRtqrM/Qf+AdUe3a5bhbnfyhw2FSLDZ";
|
||||
hostnames = [ "vps6.chn.moe" "wireguard.vps6.chn.moe" "74.211.99.69" "192.168.83.1" ];
|
||||
};
|
||||
"initrd.vps6" =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB4DKB/zzUYco5ap6k9+UxeO04LL12eGvkmQstnYxgnS";
|
||||
hostnames = [ "initrd.vps6.chn.moe" "74.211.99.69" ];
|
||||
};
|
||||
vps7 =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF5XkdilejDAlg5hZZD0oq69k8fQpe9hIJylTo/aLRgY";
|
||||
hostnames = [ "vps7.chn.moe" "wireguard.vps7.chn.moe" "ssh.git.chn.moe" "95.111.228.40" "192.168.83.2" ];
|
||||
};
|
||||
"initrd.vps7" =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGZyQpdQmEZw3nLERFmk2tS1gpSvXwW0Eish9UfhrRxC";
|
||||
hostnames = [ "initrd.vps7.chn.moe" "95.111.228.40" ];
|
||||
};
|
||||
nas =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIktNbEcDMKlibXg54u7QOLt0755qB/P4vfjwca8xY6V";
|
||||
hostnames = [ "wireguard.nas.chn.moe" "[office.chn.moe]:5440" "192.168.1.185" "192.168.83.4" ];
|
||||
};
|
||||
"initrd.nas" =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAoMu0HEaFQsnlJL0L6isnkNZdRq0OiDXyaX3+fl3NjT";
|
||||
hostnames = [ "initrd.nas.chn.moe" "[office.chn.moe]:5440" "192.168.1.185" ];
|
||||
};
|
||||
surface =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFdm3DcfHdcLP0oSpVrWwIZ/b9lZuakBSPwCFz2BdTJ7";
|
||||
hostnames = [ "192.168.1.166" "wireguard.surface.chn.moe" "192.168.83.5" ];
|
||||
};
|
||||
pc =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMSfREi19OSwQnhdsE8wiNwGSFFJwNGN0M5gN+sdrrLJ";
|
||||
hostnames = [ "wireguard.pc.chn.moe" "192.168.83.3" ];
|
||||
};
|
||||
hpc =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDVpsQW3kZt5alHC6mZhay3ZEe2fRGziG4YJWCv2nn/O";
|
||||
hostnames = [ "hpc.xmu.edu.cn" ];
|
||||
};
|
||||
github =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl";
|
||||
hostnames = [ "github.com" ];
|
||||
};
|
||||
xmupc1 =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINTvfywkKRwMrVp73HfHTfjhac2Tn9qX/lRjLr09ycHp";
|
||||
hostnames = [ "[office.chn.moe]:6007" "[xmupc1.chn.moe]:6007" "wireguard.xmupc1.chn.moe" "192.168.83.6" ];
|
||||
};
|
||||
xmupc2 =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJZ/+divGnDr0x+UlknA84Tfu6TPD+zBGmxWZY4Z38P6";
|
||||
hostnames = [ "[xmupc2.chn.moe]:6394" "wireguard.xmupc2.chn.moe" "192.168.83.7" ];
|
||||
};
|
||||
};
|
||||
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)));
|
||||
programs.ssh =
|
||||
{
|
||||
startAgent = true;
|
||||
enableAskPassword = true;
|
||||
askPassword = "${inputs.pkgs.systemd}/bin/systemd-ask-password";
|
||||
extraConfig = "AddKeysToAgent yes";
|
||||
};
|
||||
environment.sessionVariables.SSH_ASKPASS_REQUIRE = "prefer";
|
||||
nixos.user.sharedModules =
|
||||
[(hmInputs: {
|
||||
config.programs.ssh =
|
||||
{
|
||||
enable = true;
|
||||
controlMaster = "auto";
|
||||
controlPersist = "1m";
|
||||
compression = true;
|
||||
matchBlocks = builtins.listToAttrs
|
||||
(
|
||||
(builtins.map
|
||||
(host: { name = host; value = { inherit host; hostname = "${host}.chn.moe"; }; })
|
||||
[
|
||||
"vps6" "wireguard.vps6" "vps7" "wireguard.vps7" "wireguard.pc" "wireguard.nas" "wireguard.surface"
|
||||
"wireguard.xmupc1" "wireguard.xmupc2"
|
||||
])
|
||||
++ (builtins.map
|
||||
(host:
|
||||
{
|
||||
name = host;
|
||||
value =
|
||||
{
|
||||
host = host;
|
||||
hostname = "hpc.xmu.edu.cn";
|
||||
user = host;
|
||||
extraOptions.SetEnv = "TERM=chn_unset_ls_colors:xterm-256color";
|
||||
};
|
||||
})
|
||||
[ "wlin" "hwang" ])
|
||||
)
|
||||
// {
|
||||
xmupc1 = { host = "xmupc1"; hostname = "xmupc1.chn.moe"; port = 6007; };
|
||||
xmupc2 = { host = "xmupc2"; hostname = "xmupc2.chn.moe"; port = 6394; };
|
||||
nas = { host = "nas"; hostname = "office.chn.moe"; port = 5440; };
|
||||
surface = { host = "surface"; hostname = "192.168.1.166"; };
|
||||
gitea = { host = "gitea"; hostname = "ssh.git.chn.moe"; };
|
||||
jykang =
|
||||
{
|
||||
host = "jykang";
|
||||
hostname = "hpc.xmu.edu.cn";
|
||||
user = "jykang";
|
||||
forwardAgent = true;
|
||||
extraOptions.SetEnv =
|
||||
# in .bash_profile:
|
||||
# if [[ $TERM == chn_unset_ls_colors* ]]; then
|
||||
# export TERM=${TERM#*:}
|
||||
# export CHN_LS_USE_COLOR=1
|
||||
# fi
|
||||
# if [[ $TERM == chn_cd* ]]; then
|
||||
# export TERM=${TERM#*:}
|
||||
# cd ~/${TERM%%:*}
|
||||
# export TERM=${TERM#*:}
|
||||
# fi
|
||||
# in .bashrc
|
||||
# [ -n "$CHN_LS_USE_COLOR" ] && alias ls="ls --color=auto"
|
||||
let
|
||||
usernameMap =
|
||||
{
|
||||
chn = "linwei/chn";
|
||||
xll = "linwei/Xll";
|
||||
yjq = "linwei/yjq";
|
||||
gb = "kangjunyong/gongbin";
|
||||
};
|
||||
cdString =
|
||||
if usernameMap ? ${hmInputs.config.home.username} then
|
||||
":chn_cd:${usernameMap.${hmInputs.config.home.username}}"
|
||||
else "";
|
||||
in "TERM=chn_unset_ls_colors${cdString}:xterm-256color";
|
||||
};
|
||||
};
|
||||
};
|
||||
})];
|
||||
};
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
inputs:
|
||||
{
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkIf;
|
||||
in mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
nixos.user.sharedModules = [(home-inputs: { config.programs =
|
||||
{
|
||||
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 = "65bb5ac49190beda263aae552a9369127961632d";
|
||||
hash = "sha256-JSNsfpgiqWhtmGQkC3B0R1Y1QnDKp9n0Zaqzjhwt7Xk=";
|
||||
};
|
||||
}
|
||||
];
|
||||
history =
|
||||
{
|
||||
path = "${home-inputs.config.xdg.dataHome}/zsh/zsh_history";
|
||||
extended = true;
|
||||
save = 100000000;
|
||||
size = 100000000;
|
||||
};
|
||||
};
|
||||
# set bash history file path, avoid overwriting zsh history
|
||||
bash = { enable = true; historyFile = "${home-inputs.config.xdg.dataHome}/bash/bash_history"; };
|
||||
};})];
|
||||
programs.zsh =
|
||||
{
|
||||
enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
autosuggestions.enable = true;
|
||||
enableCompletion = true;
|
||||
ohMyZsh =
|
||||
{
|
||||
enable = true;
|
||||
plugins = [ "git" "colored-man-pages" "extract" "history-substring-search" "autojump" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
190
modules/packages/ssh/default.nix
Normal file
190
modules/packages/ssh/default.nix
Normal file
@@ -0,0 +1,190 @@
|
||||
inputs:
|
||||
{
|
||||
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
services.openssh.knownHosts =
|
||||
let
|
||||
servers =
|
||||
{
|
||||
vps6 =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO5ZcvyRyOnUCuRtqrM/Qf+AdUe3a5bhbnfyhw2FSLDZ";
|
||||
hostnames = [ "vps6.chn.moe" "wireguard.vps6.chn.moe" "74.211.99.69" "192.168.83.1" ];
|
||||
};
|
||||
"initrd.vps6" =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB4DKB/zzUYco5ap6k9+UxeO04LL12eGvkmQstnYxgnS";
|
||||
hostnames = [ "initrd.vps6.chn.moe" "74.211.99.69" ];
|
||||
};
|
||||
vps7 =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF5XkdilejDAlg5hZZD0oq69k8fQpe9hIJylTo/aLRgY";
|
||||
hostnames = [ "vps7.chn.moe" "wireguard.vps7.chn.moe" "ssh.git.chn.moe" "95.111.228.40" "192.168.83.2" ];
|
||||
};
|
||||
"initrd.vps7" =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGZyQpdQmEZw3nLERFmk2tS1gpSvXwW0Eish9UfhrRxC";
|
||||
hostnames = [ "initrd.vps7.chn.moe" "95.111.228.40" ];
|
||||
};
|
||||
nas =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIktNbEcDMKlibXg54u7QOLt0755qB/P4vfjwca8xY6V";
|
||||
hostnames = [ "wireguard.nas.chn.moe" "[office.chn.moe]:5440" "192.168.1.185" "192.168.83.4" ];
|
||||
};
|
||||
"initrd.nas" =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAoMu0HEaFQsnlJL0L6isnkNZdRq0OiDXyaX3+fl3NjT";
|
||||
hostnames = [ "initrd.nas.chn.moe" "[office.chn.moe]:5440" "192.168.1.185" ];
|
||||
};
|
||||
surface =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFdm3DcfHdcLP0oSpVrWwIZ/b9lZuakBSPwCFz2BdTJ7";
|
||||
hostnames = [ "192.168.1.166" "wireguard.surface.chn.moe" "192.168.83.5" ];
|
||||
};
|
||||
pc =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMSfREi19OSwQnhdsE8wiNwGSFFJwNGN0M5gN+sdrrLJ";
|
||||
hostnames = [ "wireguard.pc.chn.moe" "192.168.83.3" ];
|
||||
};
|
||||
hpc =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDVpsQW3kZt5alHC6mZhay3ZEe2fRGziG4YJWCv2nn/O";
|
||||
hostnames = [ "hpc.xmu.edu.cn" ];
|
||||
};
|
||||
github =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl";
|
||||
hostnames = [ "github.com" ];
|
||||
};
|
||||
xmupc1 =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINTvfywkKRwMrVp73HfHTfjhac2Tn9qX/lRjLr09ycHp";
|
||||
hostnames = [ "[office.chn.moe]:6007" "[xmupc1.chn.moe]:6007" "wireguard.xmupc1.chn.moe" "192.168.83.6" ];
|
||||
};
|
||||
xmupc2 =
|
||||
{
|
||||
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJZ/+divGnDr0x+UlknA84Tfu6TPD+zBGmxWZY4Z38P6";
|
||||
hostnames = [ "[xmupc2.chn.moe]:6394" "wireguard.xmupc2.chn.moe" "192.168.83.7" ];
|
||||
};
|
||||
};
|
||||
in builtins.listToAttrs (builtins.concatLists (builtins.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 []
|
||||
))
|
||||
(inputs.localLib.attrsToList servers)));
|
||||
programs.ssh =
|
||||
{
|
||||
startAgent = true;
|
||||
enableAskPassword = true;
|
||||
askPassword = "${inputs.pkgs.systemd}/bin/systemd-ask-password";
|
||||
extraConfig = "AddKeysToAgent yes";
|
||||
};
|
||||
environment.sessionVariables.SSH_ASKPASS_REQUIRE = "prefer";
|
||||
nixos.user.sharedModules =
|
||||
[(hmInputs: {
|
||||
config.programs.ssh =
|
||||
{
|
||||
enable = true;
|
||||
controlMaster = "auto";
|
||||
controlPersist = "1m";
|
||||
compression = true;
|
||||
matchBlocks = builtins.listToAttrs
|
||||
(
|
||||
(builtins.map
|
||||
(host: { name = host; value = { inherit host; hostname = "${host}.chn.moe"; }; })
|
||||
[
|
||||
"vps6" "wireguard.vps6" "vps7" "wireguard.vps7" "wireguard.pc" "wireguard.nas" "wireguard.surface"
|
||||
"wireguard.xmupc1" "wireguard.xmupc2"
|
||||
])
|
||||
++ (builtins.map
|
||||
(host:
|
||||
{
|
||||
name = host;
|
||||
value =
|
||||
{
|
||||
host = host;
|
||||
hostname = "hpc.xmu.edu.cn";
|
||||
user = host;
|
||||
extraOptions.SetEnv = "TERM=chn_unset_ls_colors:xterm-256color";
|
||||
};
|
||||
})
|
||||
[ "wlin" "hwang" ])
|
||||
)
|
||||
// {
|
||||
xmupc1 = { host = "xmupc1"; hostname = "xmupc1.chn.moe"; port = 6007; };
|
||||
xmupc2 = { host = "xmupc2"; hostname = "xmupc2.chn.moe"; port = 6394; };
|
||||
nas = { host = "nas"; hostname = "office.chn.moe"; port = 5440; };
|
||||
surface = { host = "surface"; hostname = "192.168.1.166"; };
|
||||
gitea = { host = "gitea"; hostname = "ssh.git.chn.moe"; };
|
||||
jykang =
|
||||
{
|
||||
host = "jykang";
|
||||
hostname = "hpc.xmu.edu.cn";
|
||||
user = "jykang";
|
||||
forwardAgent = true;
|
||||
extraOptions.SetEnv =
|
||||
# in .bash_profile:
|
||||
# if [[ $TERM == chn_unset_ls_colors* ]]; then
|
||||
# export TERM=${TERM#*:}
|
||||
# export CHN_LS_USE_COLOR=1
|
||||
# fi
|
||||
# if [[ $TERM == chn_cd* ]]; then
|
||||
# export TERM=${TERM#*:}
|
||||
# cd ~/${TERM%%:*}
|
||||
# export TERM=${TERM#*:}
|
||||
# fi
|
||||
# in .bashrc
|
||||
# [ -n "$CHN_LS_USE_COLOR" ] && alias ls="ls --color=auto"
|
||||
let
|
||||
usernameMap =
|
||||
{
|
||||
chn = "linwei/chn";
|
||||
xll = "linwei/Xll";
|
||||
yjq = "linwei/yjq";
|
||||
gb = "kangjunyong/gongbin";
|
||||
};
|
||||
cdString =
|
||||
if usernameMap ? ${hmInputs.config.home.username} then
|
||||
":chn_cd:${usernameMap.${hmInputs.config.home.username}}"
|
||||
else "";
|
||||
in "TERM=chn_unset_ls_colors${cdString}:xterm-256color";
|
||||
};
|
||||
};
|
||||
};
|
||||
})];
|
||||
};
|
||||
}
|
||||
20
modules/packages/steam.nix
Normal file
20
modules/packages/steam.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
inputs:
|
||||
{
|
||||
config = inputs.lib.mkIf (builtins.elem "desktop-extra" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
programs.steam =
|
||||
{
|
||||
enable = true;
|
||||
package = inputs.pkgs.steam.override (prev:
|
||||
{
|
||||
steam = prev.steam.overrideAttrs (prev:
|
||||
{
|
||||
postInstall = prev.postInstall +
|
||||
''
|
||||
sed -i 's#Comment\[zh_CN\]=.*$#Comment\[zh_CN\]=思题慕®学习平台#' $out/share/applications/steam.desktop
|
||||
'';
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
60
modules/packages/workstation.nix
Normal file
60
modules/packages/workstation.nix
Normal file
@@ -0,0 +1,60 @@
|
||||
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 nvtop
|
||||
# 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 cling fprettify aircrack-ng
|
||||
# install per project
|
||||
# clang-tools_16 ccls
|
||||
# media
|
||||
nur-xddxdd.svp
|
||||
# virtualization
|
||||
wineWowPackages.stagingFull virt-viewer bottles # wine64
|
||||
# text editor
|
||||
appflowy notion-app-enhanced joplin-desktop standardnotes logseq
|
||||
# math, physics and chemistry
|
||||
mathematica paraview jmol mpi quantum-espresso # localPackages.mumax
|
||||
# encryption and password management
|
||||
john crunch hashcat
|
||||
# container and vm
|
||||
genymotion davinci-resolve playonlinux
|
||||
# browser
|
||||
microsoft-edge tor-browser
|
||||
# news
|
||||
rssguard newsflash newsboat
|
||||
];
|
||||
_pythonPackages = [(pythonPackages: with pythonPackages;
|
||||
[
|
||||
phonopy tensorflow keras scipy scikit-learn jupyterlab autograd # localPackages.pix2tex
|
||||
])];
|
||||
};
|
||||
user.sharedModules =
|
||||
[{
|
||||
config.programs.obs-studio =
|
||||
{
|
||||
enable = true;
|
||||
plugins = with inputs.pkgs.obs-studio-plugins; [ wlrobs obs-vaapi obs-nvfbc droidcam-obs obs-vkcapture ];
|
||||
};
|
||||
}];
|
||||
};
|
||||
programs =
|
||||
{
|
||||
anime-game-launcher = { enable = true; package = inputs.pkgs.anime-game-launcher; };
|
||||
honkers-railway-launcher = { enable = true; package = inputs.pkgs.honkers-railway-launcher; };
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
inputs:
|
||||
{
|
||||
config =
|
||||
let
|
||||
inherit (inputs.lib) mkIf;
|
||||
in 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 nvtop
|
||||
# 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 cling fprettify aircrack-ng
|
||||
# install per project
|
||||
# clang-tools_16 ccls
|
||||
# media
|
||||
nur-xddxdd.svp
|
||||
# virtualization
|
||||
wineWowPackages.stagingFull virt-viewer bottles # wine64
|
||||
# text editor
|
||||
appflowy notion-app-enhanced joplin-desktop standardnotes logseq
|
||||
# math, physics and chemistry
|
||||
mathematica paraview jmol mpi quantum-espresso # localPackages.mumax
|
||||
# encryption and password management
|
||||
john crunch hashcat
|
||||
# container and vm
|
||||
genymotion davinci-resolve playonlinux
|
||||
# browser
|
||||
microsoft-edge tor-browser
|
||||
# news
|
||||
rssguard newsflash newsboat
|
||||
];
|
||||
_pythonPackages = [(pythonPackages: with pythonPackages;
|
||||
[
|
||||
phonopy tensorflow keras scipy scikit-learn jupyterlab autograd # localPackages.pix2tex
|
||||
])];
|
||||
};
|
||||
user.sharedModules =
|
||||
[{
|
||||
config.programs =
|
||||
{
|
||||
obs-studio =
|
||||
{
|
||||
enable = true;
|
||||
plugins = with inputs.pkgs.obs-studio-plugins;
|
||||
[ wlrobs obs-vaapi obs-nvfbc droidcam-obs obs-vkcapture ];
|
||||
};
|
||||
doom-emacs = { enable = true; doomPrivateDir = ./doom.d; };
|
||||
};
|
||||
}];
|
||||
};
|
||||
programs =
|
||||
{
|
||||
anime-game-launcher = { enable = true; package = inputs.pkgs.anime-game-launcher; };
|
||||
honkers-railway-launcher = { enable = true; package = inputs.pkgs.honkers-railway-launcher; };
|
||||
};
|
||||
};
|
||||
}
|
||||
80
modules/packages/zsh/default.nix
Normal file
80
modules/packages/zsh/default.nix
Normal file
@@ -0,0 +1,80 @@
|
||||
inputs:
|
||||
{
|
||||
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
|
||||
{
|
||||
nixos.user.sharedModules = [(home-inputs: { config.programs =
|
||||
{
|
||||
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 = "65bb5ac49190beda263aae552a9369127961632d";
|
||||
hash = "sha256-JSNsfpgiqWhtmGQkC3B0R1Y1QnDKp9n0Zaqzjhwt7Xk=";
|
||||
};
|
||||
}
|
||||
];
|
||||
history =
|
||||
{
|
||||
path = "${home-inputs.config.xdg.dataHome}/zsh/zsh_history";
|
||||
extended = true;
|
||||
save = 100000000;
|
||||
size = 100000000;
|
||||
};
|
||||
};
|
||||
# set bash history file path, avoid overwriting zsh history
|
||||
bash = { enable = true; historyFile = "${home-inputs.config.xdg.dataHome}/bash/bash_history"; };
|
||||
};})];
|
||||
programs.zsh =
|
||||
{
|
||||
enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
autosuggestions.enable = true;
|
||||
enableCompletion = true;
|
||||
ohMyZsh =
|
||||
{
|
||||
enable = true;
|
||||
plugins = [ "git" "colored-man-pages" "extract" "history-substring-search" "autojump" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user