Init:start-nix

This commit is contained in:
dichgrem
2025-07-22 12:18:15 +08:00
parent 7ce7214a74
commit e57cdd246c
178 changed files with 22667 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
{hostname, ...}: let
inherit (import ../../hosts/${hostname}/env.nix) Bluetooth;
in {
services.blueman-applet.enable = Bluetooth;
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
brightnessctl
];
}

View File

@@ -0,0 +1,3 @@
_: {
services.easyeffects.enable = true;
}

25
home/wayland/fcitx5.nix Normal file
View File

@@ -0,0 +1,25 @@
{pkgs, ...}: {
home.file.".local/share/fcitx5/rime" = {
force = true;
recursive = true;
source = pkgs.fetchFromGitHub {
hash = "sha256-s3r8cdEliiPnKWs64Wgi0rC9Ngl1mkIrLnr2tIcyXWw=";
owner = "iDvel";
repo = "rime-ice";
tag = "2025.04.06";
};
};
i18n.inputMethod = {
enable = true;
fcitx5 = {
addons = with pkgs; [
fcitx5-gtk
fcitx5-rime
libsForQt5.fcitx5-qt
];
waylandFrontend = true;
};
type = "fcitx5";
};
}

5
home/wayland/fuzzel.nix Normal file
View File

@@ -0,0 +1,5 @@
_: {
programs.fuzzel = {
enable = true;
};
}

60
home/wayland/hyprland.nix Normal file
View File

@@ -0,0 +1,60 @@
{
hostname,
lib,
pkgs,
...
}:
let
inherit (import ../../hosts/${hostname}/env.nix)
GPU-Nvidia
MonitorSettings
KeyboardLayout
ScaleLevel
WM
;
in
with lib;
mkIf (WM == "Hyprland") {
home.packages = with pkgs; [
xorg.xprop
];
wayland.windowManager.hyprland = {
enable = true;
plugins = [
pkgs.hyprlandPlugins.hy3
];
systemd = {
enable = true;
variables = [ "--all" ];
};
xwayland.enable = true;
extraConfig = concatStrings [
''
${MonitorSettings}
$KEYBOARDLAYOUT = ${KeyboardLayout}
$SCALE = ${ScaleLevel}
source = ~/.config/hypr/hyprland/*
''
];
settings = mkIf GPU-Nvidia {
env = [
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
"GBM_BACKEND,nvidia-drm"
"LIBVA_DRIVER_NAME,nvidia"
"NVD_BACKEND,direct"
"WLR_NO_HARDWARE_CURSORS,1"
];
};
};
xdg.portal = {
config = {
common = {
default = [ "gtk" ];
};
};
extraPortals = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-hyprland
];
};
}

View File

@@ -0,0 +1,5 @@
_: {
programs.hyprlock = {
enable = true;
};
}

View File

@@ -0,0 +1,3 @@
_: {
services.hyprpolkitagent.enable = true;
}

View File

@@ -0,0 +1,15 @@
{
hostname,
lib,
pkgs,
...
}: let
inherit (import ../../hosts/${hostname}/env.nix) HotSpot-Use-Case;
in
with lib;
mkIf HotSpot-Use-Case
{
home.packages = with pkgs; [
linux-wifi-hotspot
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
networkmanagerapplet
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
playerctl
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
pwvucontrol
];
}

View File

@@ -0,0 +1,8 @@
{pkgs, ...}: {
home.packages = with pkgs; [
grim
jq
slurp
swappy
];
}

3
home/wayland/swaync.nix Normal file
View File

@@ -0,0 +1,3 @@
_: {
services.swaync.enable = true;
}

5
home/wayland/swayosd.nix Normal file
View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
swayosd
];
}

5
home/wayland/swww.nix Normal file
View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
swww
];
}

51
home/wayland/theme.nix Normal file
View File

@@ -0,0 +1,51 @@
{pkgs, ...}: {
fonts.fontconfig = {
defaultFonts = {
emoji = ["Noto Color Emoji"];
monospace = ["JetBrainsMono Nerd Font Mono"];
sansSerif = ["Sarasa Gothic SC"];
serif = ["Sarasa Gothic SC"];
};
enable = true;
};
gtk = {
gtk3.extraConfig = {
gtk-application-prefer-dark-theme = true;
};
gtk4.extraConfig = {
gtk-application-prefer-dark-theme = true;
};
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
};
home.packages = with pkgs; [
libsForQt5.qtstyleplugin-kvantum
libsForQt5.qt5ct
qt6ct
];
qt = {
enable = true;
style.name = "kvantum";
};
stylix = {
autoEnable = true;
targets = {
fcitx5.enable = false;
floorp.enable = false;
hyprland.enable = false;
kde.enable = false;
mpv.enable = false;
nixvim.enable = false;
sway.enable = false;
waybar.enable = false;
yazi.enable = false;
zed.enable = false;
};
};
}

5
home/wayland/waybar.nix Normal file
View File

@@ -0,0 +1,5 @@
_: {
programs.waybar = {
enable = true;
};
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
waytrogen
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
wl-clipboard-rs
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
wl-gammarelay-rs
];
}

5
home/wayland/wlogout.nix Normal file
View File

@@ -0,0 +1,5 @@
_: {
programs.wlogout = {
enable = true;
};
}

106
home/wayland/xdg.nix Normal file
View File

@@ -0,0 +1,106 @@
{config, ...}: {
xdg = {
enable = true;
mimeApps = let
archiver-extract-smart = ["peazip-extract-smart.desktop"];
archiver-useless-options = [
"peazip-extract.desktop"
"peazip-extract-desktop.desktop"
"peazip-extract-documents.desktop"
"peazip-extract-downloads.desktop"
"peazip-extract-here.desktop"
];
browser = ["brave-browser.desktop"];
editor = ["dev.zed.Zed.desktop"];
filemanager = ["nemo.desktop"];
image-viewer = ["oculante.desktop"];
media-player = ["vlc.desktop"];
in {
associations = {
added = {
"application/x-directory" = ["peazip-add-to-archive.desktop"];
"inode/directory" = ["peazip-add-to-archive.desktop"];
};
removed = {
"application/iso" = archiver-useless-options;
"application/x-7z-compressed" = archiver-useless-options;
"application/x-ace-compressed" = archiver-useless-options;
"application/x-bzip2" = archiver-useless-options;
"application/x-gzip" = archiver-useless-options;
"application/x-rar-compressed" = archiver-useless-options;
"application/x-tar" = archiver-useless-options;
"application/zip" = archiver-useless-options;
};
};
enable = true;
defaultApplications = {
"application/iso" = archiver-extract-smart;
"application/zip" = archiver-extract-smart;
"application/x-7z-compressed" = archiver-extract-smart;
"application/x-ace-compressed" = archiver-useless-options;
"application/x-bzip2" = archiver-extract-smart;
"application/x-gzip" = archiver-extract-smart;
"application/x-rar-compressed" = archiver-extract-smart;
"application/x-tar" = archiver-extract-smart;
"application/json" = browser;
"application/pdf" = browser;
"application/rdf+xml" = browser;
"application/rss+xml" = browser;
"application/xhtml+xml" = browser;
"application/xhtml_xml" = browser;
"application/xml" = browser;
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;
"application/x-extension-xht" = browser;
"application/x-extension-xhtml" = browser;
"text/html" = browser;
"text/xml" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/unknown" = browser;
"application/x-wine-extension-ini" = editor;
"text/plain" = editor;
"x-scheme-handler/about" = filemanager;
"x-scheme-handler/ftp" = filemanager;
"image/*" = image-viewer;
"image/avif" = image-viewer;
"image/gif" = image-viewer;
"image/jpeg" = image-viewer;
"image/png" = image-viewer;
"image/webp" = image-viewer;
"audio/*" = media-player;
"video/*" = media-player;
"x-scheme-handler/tg" = ["io.github.kukuruzka165.materialgram.desktop"];
};
};
portal = {
config = {
common = {
"org.freedesktop.impl.portal.FileChooser" = "gtk";
};
};
enable = true;
};
userDirs = {
enable = true;
createDirectories = false;
documents = "$HOME/Documents";
download = "$HOME/Downloads";
music = "$HOME/Music";
pictures = "$HOME/Pictures";
publicShare = "/var/empty";
templates = "/var/empty";
videos = "$HOME/Videos";
extraConfig = {
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
};
};
};
}