Merge branch 'production' into next

This commit is contained in:
2025-12-04 19:31:45 +08:00
14 changed files with 106 additions and 377 deletions

View File

@@ -78,8 +78,7 @@ inputs:
extraInterfaces = [ "wlo1" ];
};
nix-serve = {};
beesd =
{ "/" = { hashTableSizeMB = 2 * 128; threads = 4; }; "/nix" = { hashTableSizeMB = 128; threads = 4; }; };
beesd = { "/".hashTableSizeMB = 2 * 128; "/nix".hashTableSizeMB = 128; };
slurm =
{
enable = true;
@@ -111,15 +110,10 @@ inputs:
services.colord.enable = true;
services.udev.extraRules =
''
#
ACTION=="add", ATTR{power/wakeup}="disabled"
# CPU
SUBSYSTEM=="power_supply", KERNEL=="BAT0", ACTION=="*", RUN+="${inputs.pkgs.ryzenadj}/bin/ryzenadj --set-coall=0x0fff10"
#
KERNEL=="mmcblk0", ENV{UDISKS_IGNORE}="1"
'';
# 解决有时蓝牙不能使用的问题
boot.kernelParams = [ "mt7925e.disable_aspm=1" ];
specialisation.kde.configuration.nixos.system.gui.implementation = "kde";
};
}

24
flake.lock generated
View File

@@ -1138,29 +1138,6 @@
"type": "github"
}
},
"plasma-manager": {
"inputs": {
"home-manager": [
"home-manager"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1763909441,
"narHash": "sha256-56LwV51TX/FhgX+5LCG6akQ5KrOWuKgcJa+eUsRMxsc=",
"owner": "pjones",
"repo": "plasma-manager",
"rev": "b24ed4b272256dfc1cc2291f89a9821d5f9e14b4",
"type": "github"
},
"original": {
"owner": "pjones",
"repo": "plasma-manager",
"type": "github"
}
},
"pocketfft": {
"flake": false,
"locked": {
@@ -1276,7 +1253,6 @@
"nur-xddxdd": "nur-xddxdd",
"openxlsx": "openxlsx",
"phono3py": "phono3py",
"plasma-manager": "plasma-manager",
"pocketfft": "pocketfft",
"py4vasp": "py4vasp",
"pybinding": "pybinding",

View File

@@ -13,11 +13,6 @@
nix-index-database = { url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; };
nur-xddxdd = { url = "github:xddxdd/nur-packages"; inputs.nixpkgs.follows = "nixpkgs"; };
impermanence.url = "github:CHN-beta/impermanence";
plasma-manager =
{
url = "github:pjones/plasma-manager";
inputs = { nixpkgs.follows = "nixpkgs"; home-manager.follows = "home-manager"; };
};
nur-linyinfeng = { url = "github:linyinfeng/nur-packages"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-flatpak.url = "github:gmodena/nix-flatpak";
chaotic =

View File

@@ -16,7 +16,6 @@ inputs: let inherit (inputs) topInputs; in
{ config.niri-flake.cache.enable = false; }
{ config.home-manager.sharedModules =
[
topInputs.plasma-manager.homeModules.plasma-manager
topInputs.catppuccin.homeModules.catppuccin
topInputs.dankmaterialshell.homeModules.dankMaterialShell.default
topInputs.dankmaterialshell.homeModules.dankMaterialShell.niri

View File

@@ -16,7 +16,7 @@ inputs:
# system management
# TODO: module should add yubikey-touch-detector into path
gparted wayland-utils clinfo mesa-demos vulkan-tools dracut yubikey-touch-detector btrfs-assistant snapper-gui
kdePackages.qtstyleplugin-kvantum cpu-x wl-mirror geekbench xpra
cpu-x wl-mirror geekbench xpra
(
writeShellScriptBin "xclip"
''
@@ -33,7 +33,7 @@ inputs:
waifu2x-converter-cpp blender paraview vlc whalebird spotify obs-studio subtitlecomposer
(inkscape-with-extensions.override { inkscapeExtensions = [ inkscape-extensions.textext ]; })
# development
adb-sync scrcpy dbeaver-bin cling aircrack-ng kitty
adb-sync scrcpy dbeaver-bin cling aircrack-ng
weston cage openbox krita fprettify # jetbrains.clion
# password and key management
yubikey-manager bitwarden-desktop hashcat yubikey-personalization
@@ -69,58 +69,21 @@ inputs:
openai-whisper
# daily management
activitywatch super-productivity
]
++ (builtins.filter
(p: (inputs.lib.isDerivation p) && !(p.meta.broken or false)
&& !(builtins.elem p.pname or null [ "falkon" "kalzium" "calligra" "kamoso" ]))
(builtins.attrValues kdePackages.kdeGear))
++ (inputs.lib.optionals (inputs.config.nixos.system.gui.implementation == "kde")
[ inputs.topInputs.plasma-manager.packages.${inputs.pkgs.system}.rc2nix ]);
];
_pythonPackages = [(pythonPackages: with pythonPackages;
[ phonopy scipy scikit-learn jupyterlab autograd inputs.pkgs.localPackages.phono3py numpy ])];
};
user.sharedModules =
[{
config.programs =
config =
{
plasma = inputs.lib.mkIf (inputs.config.nixos.system.gui.implementation == "kde")
{
enable = true;
configFile =
{
plasma-localerc = { Formats.LANG.value = "en_US.UTF-8"; Translations.LANGUAGE.value = "zh_CN"; };
baloofilerc."Basic Settings".Indexing-Enabled.value = false;
plasmarc.Wallpapers.usersWallpapers.value =
let
inherit (inputs.topInputs) nixos-wallpaper;
isPicture = f: builtins.elem (inputs.lib.last (inputs.lib.splitString "." f))
[ "png" "jpg" "jpeg" "webp" ];
listDirRecursive =
let listDir = dir:
if dir.value == "directory" then builtins.concatLists
(builtins.map (f: listDir f) (inputs.localLib.attrsToList (builtins.readDir dir.name)))
else [ dir ];
in dir: listDir { name = dir; value = "directory"; };
in builtins.concatStringsSep "," (builtins.map (f: "${nixos-wallpaper}/${f.name}")
(builtins.filter (f: (isPicture f.name) && (f.value == "regular"))
(listDirRecursive nixos-wallpaper)));
};
powerdevil =
let config =
{
autoSuspend.action = "nothing";
dimDisplay.enable = false;
powerButtonAction = "turnOffScreen";
turnOffDisplay.idleTimeout = "never";
whenLaptopLidClosed = "turnOffScreen";
};
in { AC = config; battery = config; lowBattery = config; };
};
obs-studio =
programs.obs-studio =
{
enable = true;
plugins = with inputs.pkgs.obs-studio-plugins; [ wlrobs obs-vaapi droidcam-obs obs-vkcapture ];
};
xdg.configFile."typora-flags.conf".text =
"--ozone-platform-hint=auto --enable-wayland-ime --wayland-text-input-version=3";
};
}];
};
@@ -130,7 +93,6 @@ inputs:
wireshark = { enable = true; package = inputs.pkgs.wireshark; };
yubikey-touch-detector.enable = true;
kdeconnect.enable = true;
kde-pim.enable = false;
alvr = { enable = true; openFirewall = true; };
localsend.enable = true;
thunderbird.enable = true;

View File

@@ -12,7 +12,7 @@ inputs:
{
enable = true;
languagePacks = [ "zh-CN" "en-US" ];
nativeMessagingHosts.packages = with inputs.pkgs; [ uget-integrator ];
nativeMessagingHosts.packages = [ inputs.pkgs.uget-integrator ];
};
nixos =
{
@@ -23,12 +23,7 @@ inputs:
programs.firefox =
{
enable = true;
nativeMessagingHosts = with inputs.pkgs;
(
[ uget-integrator ]
++ (inputs.lib.optionals (inputs.config.nixos.system.gui.implementation == "kde")
[ kdePackages.plasma-browser-integration ])
);
nativeMessagingHosts = [ inputs.pkgs.uget-integrator ];
# TODO: use fixed-version of plugins
policies.DefaultDownloadDirectory = "\${home}/Downloads";
profiles.default =
@@ -38,8 +33,7 @@ inputs:
tampermonkey bitwarden cookies-txt dualsub firefox-color i-dont-care-about-cookies
metamask pakkujs rsshub-radar rsspreview tabliss tree-style-tab ublock-origin
wappalyzer grammarly zotero-connector smartproxy kiss-translator
] ++ (inputs.lib.optionals (inputs.config.nixos.system.gui.implementation == "kde")
[ plasma-integration ]);
];
search = { default = "google"; force = true; };
userChrome = builtins.readFile "${inputs.topInputs.lepton}/userChrome.css";
userContent = builtins.readFile "${inputs.topInputs.lepton}/userContent.css";

View File

@@ -43,6 +43,8 @@ inputs:
(octodns.withProviders (_: with octodns-providers; [ cloudflare ]))
# stupid things
toilet lolcat localPackages.stickerpicker graph-easy
# shell
kitty ghostty
]
++ (with inputs.config.boot.kernelPackages; [ cpupower usbip ]);
};
@@ -54,7 +56,6 @@ inputs:
autojump.enable = true;
direnv = { enable = true; nix-direnv.enable = true; };
mosh.enable = true;
yazi.enable = true;
};
services =
{

View File

@@ -0,0 +1,8 @@
inputs:
{
config =
{
programs.yazi.enable = true;
nixos.user.sharedModules = [{ config.programs.yazi.enable = true; }];
};
}

View File

@@ -1,86 +1,98 @@
inputs:
{
options.nixos.system.gui = let inherit (inputs.lib) mkOption types; in
config = inputs.lib.mkIf (inputs.config.nixos.model.type == "desktop")
{
implementation = mkOption { type = types.enum [ "kde" "niri" ]; default = "niri"; };
};
config = let inherit (inputs.config.nixos.system) gui; in inputs.lib.mkMerge
[
# enable gui
(inputs.lib.mkIf (inputs.config.nixos.model.type == "desktop")
services =
{
services =
{
desktopManager.plasma6.enable = inputs.lib.mkIf (gui.implementation == "kde") true;
greetd =
{
enable = true;
settings.default_session.command =
let sessionData = "${inputs.config.services.displayManager.sessionData.desktops}/share";
in builtins.concatStringsSep " "
[
"${inputs.pkgs.tuigreet}/bin/tuigreet"
"--sessions ${sessionData}/wayland-sessions --xsessions ${sessionData}/xsessions"
"--time --asterisks --remember --remember-user-session"
(inputs.lib.optionalString (gui.implementation == "kde") "--cmd startplasma-wayland")
];
};
};
environment =
{
sessionVariables.GTK_USE_PORTAL = "1";
persistence."/nix/persistent".directories =
[{ directory = "/var/cache/tuigreet"; user = "greeter"; group = "greeter"; mode = "0700"; }];
};
xdg.portal.extraPortals = (builtins.map (p: inputs.pkgs."xdg-desktop-portal-${p}") [ "gtk" "wlr" ])
++ [ inputs.pkgs.kdePackages.xdg-desktop-portal-kde ];
i18n.inputMethod =
greetd =
{
enable = true;
type = "fcitx5";
fcitx5.addons = with inputs.pkgs;
[ qt6Packages.fcitx5-chinese-addons fcitx5-mozc fcitx5-material-color fcitx5-gtk ];
settings.default_session.command =
let sessionData = "${inputs.config.services.displayManager.sessionData.desktops}/share";
in builtins.concatStringsSep " "
[
"${inputs.pkgs.tuigreet}/bin/tuigreet"
"--sessions ${sessionData}/wayland-sessions --xsessions ${sessionData}/xsessions"
"--time --asterisks --remember --remember-user-session"
];
};
programs.dconf.enable = true;
nixos.user.sharedModules = [(hmInputs:
{
config =
{
gtk =
{
enable = true;
theme.name = "Breeze";
gtk2 =
{
extraConfig = ''gtk-im-module="fcitx"'';
configLocation = "${hmInputs.config.xdg.configHome}/gtk-2.0/gtkrc";
force = true;
};
gtk3.extraConfig.gtk-im-module = "fcitx";
gtk4.extraConfig.gtk-im-module = "fcitx";
};
};
})];
})
# niri
(inputs.lib.mkIf (gui.implementation == "niri")
# niri module will auto enable this, disable it to avoid conflict with system ssh-agent
gnome.gcr-ssh-agent.enable = false;
};
environment =
{
programs.niri.enable = true;
nixos.user.sharedModules = [(hmInputs:
sessionVariables =
{
config.programs.dankMaterialShell =
GTK_USE_PORTAL = "1";
# let electron use gnome keyring https://github.com/electron/electron/issues/39789#issuecomment-3433810585
GNOME_DESKTOP_SESSION_ID = "this-is-deprecated";
};
persistence."/nix/persistent".directories =
[{ directory = "/var/cache/tuigreet"; user = "greeter"; group = "greeter"; mode = "0700"; }];
systemPackages =
[
# nautilus is needed before we use implementation from nixpkgs
inputs.pkgs.nautilus
# needed for xwayland
inputs.pkgs.xwayland-satellite
];
};
xdg.portal.extraPortals = (builtins.map (p: inputs.pkgs."xdg-desktop-portal-${p}") [ "gtk" "wlr" "gnome" ]);
i18n.inputMethod =
{
enable = true;
type = "fcitx5";
fcitx5.addons = with inputs.pkgs;
[ qt6Packages.fcitx5-chinese-addons fcitx5-mozc fcitx5-material-color fcitx5-gtk ];
};
programs = { dconf.enable = true; niri.enable = true; };
nixos.user.sharedModules = [(hmInputs:
{
config =
{
gtk =
{
enable = true;
niri.enableKeybinds = true;
systemd = { enable = true; restartIfChanged = true; };
theme.name = "Breeze";
gtk2 =
{
extraConfig = ''gtk-im-module="fcitx"'';
configLocation = "${hmInputs.config.xdg.configHome}/gtk-2.0/gtkrc";
force = true;
};
gtk3.extraConfig.gtk-im-module = "fcitx";
gtk4.extraConfig.gtk-im-module = "fcitx";
};
})];
# niri module will auto enable this, disable it to avoid conflict with system ssh-agent
services.gnome.gcr-ssh-agent.enable = false;
# use polkit from dms
systemd.user.services.niri-flake-polkit.enable = false;
# let electron use gnome keyring https://github.com/electron/electron/issues/39789#issuecomment-3433810585
environment.sessionVariables.GNOME_DESKTOP_SESSION_ID = "this-is-deprecated";
})
];
programs =
{
dankMaterialShell =
{
enable = true;
niri.enableKeybinds = true;
systemd = { enable = true; restartIfChanged = true; };
};
niri.settings =
{
binds =
{
"Mod+WheelScrollDown" = { action.focus-column-right = {}; cooldown-ms = 50; };
"Mod+WheelScrollUp" = { action.focus-column-left = {}; cooldown-ms = 50; };
"Mod+Left".action.focus-column-left = {};
"Mod+Right".action.focus-column-right = {};
"Mod+MouseMiddle".action.close-window = {};
"Mod+L".action.spawn = [ "dms" "ipc" "lock" "lock" ];
};
outputs =
{
"Tianma Microelectronics Ltd. TL134ADXP03 Unknown" = { scale = 1; position = { x = 0; y = 0; }; };
"Xiaomi Corporation Mi Monitor 0x00000001" = { scale = 1; position = { x = 0; y = -2160; }; };
};
input.touchpad.dwt = true;
};
};
};
})];
# use polkit from dms
systemd.user.services.niri-flake-polkit.enable = false;
};
}

View File

@@ -13,7 +13,6 @@ inputs:
{ 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

View File

@@ -1,7 +0,0 @@
inputs:
{
config = inputs.lib.mkIf (inputs.config.nixos.model.type == "desktop")
{
environment.persistence."/nix/rootfs/current".users.chn.directories = [ ".config/autostart" ];
};
}

View File

@@ -1,98 +0,0 @@
inputs:
{
imports = inputs.localLib.findModules ./.;
config = inputs.lib.mkIf
(inputs.config.nixos.packages.desktop != null && inputs.config.nixos.system.gui.implementation == "kde")
{
home-manager.users.chn.config.programs.plasma = inputs.lib.mkMerge
[
# TODO: panel, discard user changed settings
# kwin
{
kwin =
{
titlebarButtons =
{
right = [ "help" "keep-below-windows" "keep-above-windows" "minimize" "maximize" "close" ];
left = [ "more-window-actions" ];
};
virtualDesktops = inputs.lib.mkIf (inputs.config.nixos.model.hostname == "pc") { rows = 2; number = 6; };
effects = { shakeCursor.enable = true; desktopSwitching.animation = "slide"; };
};
windows.allowWindowsToRememberPositions = false;
configFile =
{
plasmanotifyrc.Notifications.PopupPosition.value = "BottomRight";
kwinrc =
{
Tiling.padding.value = 4;
Wayland.InputMethod.value = "/run/current-system/sw/share/applications/fcitx5-wayland-launcher.desktop";
Windows.RollOverDesktops.value = true;
Compositing = { AllowTearing.value = false; WindowsBlockCompositing.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";
};
};
workspace.clickItemTo = "open";
}
# krunner
{ configFile.krunnerrc = { General.FreeFloating.value = true; Plugins.baloosearchEnabled.value = false; }; }
# lock screen
{ configFile.kscreenlockerrc.Daemon.Autolock.value = false; }
];
};
}

View File

@@ -1,99 +0,0 @@
inputs:
{
config = inputs.lib.mkIf
(inputs.config.nixos.model.type == "desktop" && inputs.config.nixos.system.gui.implementation == "kde")
{
home-manager.users.chn.config.programs.plasma =
{
overrideConfig = true;
resetFiles = [ "kglobalshortcutsrc" "khotkeysrc" ];
spectacle.shortcuts.captureRectangularRegion = "Print";
shortcuts = inputs.lib.mkMerge
[
# firefox
{ "firefox.desktop"._launch = "Meta+B"; }
# crow translate
{ "io.crow_translate.CrowTranslate.desktop".TranslateSelectedText = "Ctrl+Alt+E"; }
# display
{
kded5.display = [ "Display" "Meta+P" ];
kwin = { view_actual_size = "Meta+0"; view_zoom_in = [ "Meta++" "Meta+=" ]; view_zoom_out = "Meta+-"; };
org_kde_powerdevil =
{
"Decrease Screen Brightness" = "Monitor Brightness Down";
"Increase Screen Brightness" = "Monitor Brightness Up";
};
}
# volume
{
kmix =
{
decrease_volume = "Volume Down";
increase_volume = "Volume Up";
mic_mute = [ "Meta+Volume Mute" ];
mute = "Volume Mute";
};
}
# session
{
ksmserver = { "Lock Session" = [ "Meta+L" "Screensaver" ]; "Log Out" = "Ctrl+Alt+Del"; };
org_kde_powerdevil."Turn Off Screen" = "Meta+Ctrl+L";
}
# window
{
kwin =
{
ExposeAll = "Meta+Tab";
"Show Desktop" = "Meta+D";
"Suspend Compositing" = "Alt+Shift+F12";
"Walk Through Windows" = "Alt+Tab";
"Walk Through Windows (Reverse)" = "Alt+Shift+Backtab";
"Window Above Other Windows" = "Meta+Shift+Up";
"Window Below Other Windows" = "Meta+Shift+Down";
"Window Close" = "Alt+F4";
"Window Maximize" = "Meta+Ctrl+Up";
"Window Minimize" = "Meta+Ctrl+Down";
"Window Operations Menu" = "Alt+F3";
"Window Quick Tile Bottom" = "Meta+Down";
"Window Quick Tile Left" = "Meta+Left";
"Window Quick Tile Right" = "Meta+Right";
"Window Quick Tile Top" = "Meta+Up";
};
}
# virtual desktop
{
kwin =
{
"Switch to Previous Desktop" = [ "Ctrl+PgUp" "Ctrl+Num+PgUp" ];
"Switch to Next Desktop" = [ "Ctrl+PgDown" "Ctrl+Num+PgDown" ];
"Window to Previous Desktop" = [ "Meta+Ctrl+PgUp" "Meta+Ctrl+Num+PgUp" ];
"Window to Next Desktop" = [ "Meta+Ctrl+PgDown" "Meta+Ctrl+Num+PgDown" ];
};
}
# media
{
mediacontrol =
{
nextmedia = "Media Next";
pausemedia = "Media Pause";
playpausemedia = [ "Pause" "Media Play" ];
previousmedia = "Media Previous";
stopmedia = "Media Stop";
};
}
# dolphin
{ "org.kde.dolphin.desktop"._launch = "Meta+E"; }
# konsole
{ "org.kde.konsole.desktop"._launch = "Ctrl+Alt+T"; }
# krunner
{ "org.kde.krunner.desktop"._launch = "Alt+Space"; }
# settings
{ "systemsettings.desktop"._launch = "Meta+I"; }
# virt-manager
{ "virt-manager.desktop"._launch = "Meta+V"; }
# system monitor
{ "org.kde.plasma-systemmonitor.desktop"._launch = "Meta+Esc"; }
];
};
};
}

View File

@@ -1,7 +0,0 @@
inputs:
{
config = inputs.lib.mkIf (inputs.config.nixos.system.gui.implementation == "kde")
{
home-manager.users.chn.config.programs.plasma.configFile.kdeglobals.General.accentColorFromWallpaper.value = true;
};
}