diff --git a/sdata/dist-arch/illogical-impulse-quickshell-git/PKGBUILD b/sdata/dist-arch/illogical-impulse-quickshell-git/PKGBUILD index 9aac9658c..b7909843b 100644 --- a/sdata/dist-arch/illogical-impulse-quickshell-git/PKGBUILD +++ b/sdata/dist-arch/illogical-impulse-quickshell-git/PKGBUILD @@ -9,7 +9,7 @@ conflicts=("quickshell-git") _pkgname=quickshell pkgname="$_prefix-$_pkgname-git" pkgver=0.1.0.r1 -pkgrel=3 +pkgrel=4 pkgdesc="$_pkgname-git which version pinned for $_prefix" arch=(x86_64 aarch64) url='https://git.outfoxxed.me/quickshell/quickshell' @@ -26,6 +26,21 @@ depends=( 'libdrm' 'mesa' 'google-breakpad' + # NOTE: Below are custom dependencies of illogical-impulse + qt6-5compat + qt6-avif-image-plugin + qt6-imageformats + qt6-multimedia + qt6-positioning + qt6-quicktimeline + qt6-sensors + qt6-svg + qt6-tools + qt6-translations + qt6-virtualkeyboard + qt6-wayland + kdialog + syntax-highlighting ) makedepends=( 'spirv-tools' diff --git a/sdata/dist-arch/illogical-impulse-toolkit/PKGBUILD b/sdata/dist-arch/illogical-impulse-toolkit/PKGBUILD index f3e4f943b..fa0823ea7 100644 --- a/sdata/dist-arch/illogical-impulse-toolkit/PKGBUILD +++ b/sdata/dist-arch/illogical-impulse-toolkit/PKGBUILD @@ -1,27 +1,11 @@ pkgname=illogical-impulse-toolkit pkgver=1.0 -pkgrel=1 -pkgdesc='Illogical Impulse GTK/Qt Dependencies' +pkgrel=2 +pkgdesc='Illogical Impulse Toolkit Dependencies' arch=(any) license=(None) depends=( - kdialog - syntax-highlighting upower wtype ydotool - qt6-5compat - qt6-avif-image-plugin - qt6-base - qt6-declarative - qt6-imageformats - qt6-multimedia - qt6-positioning - qt6-quicktimeline - qt6-sensors - qt6-svg - qt6-tools - qt6-translations - qt6-virtualkeyboard - qt6-wayland ) diff --git a/sdata/dist-nix/home-manager/flake.lock b/sdata/dist-nix/home-manager/flake.lock index c184eee32..8485622b2 100644 --- a/sdata/dist-nix/home-manager/flake.lock +++ b/sdata/dist-nix/home-manager/flake.lock @@ -25,16 +25,16 @@ ] }, "locked": { - "lastModified": 1758463745, - "narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=", + "lastModified": 1762296971, + "narHash": "sha256-Jyv3L5rrUYpecON+9zyFz2VqgTSTsIG35fXuCyuCQv0=", "owner": "nix-community", "repo": "home-manager", - "rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3", + "rev": "34fe48801d2a5301b814eaa1efb496499d06cebc", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-25.05", + "ref": "master", "repo": "home-manager", "type": "github" } @@ -45,11 +45,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1752054764, - "narHash": "sha256-Ob/HuUhANoDs+nvYqyTKrkcPXf4ZgXoqMTQoCK0RFgQ=", + "lastModified": 1762090880, + "narHash": "sha256-fbRQzIGPkjZa83MowjbD2ALaJf9y6KMDdJBQMKFeY/8=", "owner": "nix-community", "repo": "nixGL", - "rev": "a8e1ce7d49a149ed70df676785b07f63288f53c5", + "rev": "b6105297e6f0cd041670c3e8628394d4ee247ed5", "type": "github" }, "original": { @@ -75,16 +75,16 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1761597516, - "narHash": "sha256-wxX7u6D2rpkJLWkZ2E932SIvDJW8+ON/0Yy8+a5vsDU=", + "lastModified": 1762111121, + "narHash": "sha256-4vhDuZ7OZaZmKKrnDpxLZZpGIJvAeMtK6FKLJYUtAdw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "daf6dc47aa4b44791372d6139ab7b25269184d55", + "rev": "b3d51a0365f6695e7dd5cdf3e180604530ed33b4", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-25.05", + "ref": "nixos-unstable", "type": "indirect" } }, diff --git a/sdata/dist-nix/home-manager/flake.nix b/sdata/dist-nix/home-manager/flake.nix index d9b9a30b6..d88daad6e 100644 --- a/sdata/dist-nix/home-manager/flake.nix +++ b/sdata/dist-nix/home-manager/flake.nix @@ -3,15 +3,15 @@ description = "illogical-impulse"; inputs = { - nixpkgs.url = "nixpkgs/nixos-25.05"; + # Qt 6.10 is not yet available from released version of nixpkgs. + #nixpkgs.url = "nixpkgs/nixos-25.05"; + nixpkgs.url = "nixpkgs/nixos-unstable"; home-manager = { - url = "github:nix-community/home-manager/release-25.05"; + #url = "github:nix-community/home-manager/release-25.05"; + url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; }; - #hyprland = { - # url = "github:hyprwm/Hyprland"; - #}; nixgl.url = "github:nix-community/nixGL"; quickshell = { url = "github:quickshell-mirror/quickshell/db1777c20b936a86528c1095cbcb1ebd92801402"; @@ -24,6 +24,7 @@ home_attrs = rec { username = import ./username.nix; homeDirectory = "/home/${username}"; + # Do not edit stateVersion value, see https://github.com/nix-community/home-manager/issues/5794 stateVersion = "25.05"; }; system = "x86_64-linux"; diff --git a/sdata/dist-nix/home-manager/home.nix b/sdata/dist-nix/home-manager/home.nix index 63a895af0..a70f7603a 100644 --- a/sdata/dist-nix/home-manager/home.nix +++ b/sdata/dist-nix/home-manager/home.nix @@ -12,15 +12,16 @@ xdg-desktop-portal-wlr kdePackages.xdg-desktop-portal-kde ]; - config.hyprland = { - default = [ "hyprland" "gtk" ]; - "org.freedesktop.impl.portal.ScreenCast" = [ - "gnome" - ]; - }; + # The following seems to generate ~/.config/xdg-desktop-portal conflicting with the one under dots/ + #config.hyprland = { + # default = [ "hyprland" "gtk" ]; + # "org.freedesktop.impl.portal.ScreenCast" = [ "gnome" ]; + #}; }; - ## Allow fontconfig to discover fonts in home.packages - fonts.fontconfig.enable = true; + # TODO: The following seems to generate ~/.config/fontconfig conflicting with the one under dots/ + # However, fontconfig may rely on this to properly find fonts installed via Nix. + # Need a proper way to deal with it. + #fonts.fontconfig.enable = true; wayland.windowManager.hyprland = { ## Make sure home-manager not generate ~/.config/hypr/hyprland.conf @@ -30,8 +31,6 @@ package = config.lib.nixGL.wrap pkgs.hyprland; }; - - home = { packages = with pkgs; [ ##### Sure ##### @@ -90,7 +89,7 @@ #breeze-plus (https://github.com/mjkim0727/breeze-plus) (TODO: Not available as nixpkg) (Used in kde-material-you-colors config) darkly darkly-qt5 #darkly-bin (darkly is supposed to be set as the theme for Qt apps, just have not figured out how to properly set it yet.) eza #eza (Used in Fish config: `alias ls 'eza --icons'`) - #fish (Install via system PM instead) + #fish (Install via system PM instead; TODO: should install via nix in future when authentication problem fixed) fontconfig #fontconfig (Basic thing) kitty #kitty (Used in fuzzel, Hyprland, kdeglobals and Quickshell config; kitty config is also included as dots) matugen #matugen-bin (Used in Quickshell) @@ -108,7 +107,7 @@ ### illogical-impulse-hyprland hypridle #hypridle (Used for loginctl to lock session) #hyprland (Need NixGL, included elsewhere) - #hyprlock (Should not be installed via Nix) + #hyprlock (Should not be installed via Nix; TODO: should install via nix in future when authentication problem fixed) hyprpicker #hyprpicker (Used in Hyprland and Quickshell config) hyprsunset #hyprsunset (Used in Quickshell config) #xdg-desktop-portal-hyprland (DUPLICATE) @@ -117,10 +116,10 @@ ### illogical-impulse-kde kdePackages.bluedevil #bluedevil (Seems not being used anywhere, maybe a part of KDE settings panel) - #gnome-keyring #gnome-keyring (TODO: Install via system PM instead) (Provide executable gnome-keyring-daemon, used in Hyprland and Quickshell config) + #gnome-keyring #gnome-keyring (TODO: Install via system PM instead; should install via nix in future when authentication problem fixed) (Provide executable gnome-keyring-daemon, used in Hyprland and Quickshell config) networkmanager #networkmanager kdePackages.plasma-nm #plasma-nm (Seems not being used anywhere, maybe a part of KDE settings panel) - #polkit-kde-agent (TODO: Install via system PM instead) + #polkit-kde-agent (TODO: Install via system PM instead; should install via nix in future when authentication problem fixed) kdePackages.dolphin #dolphin (Used in Hyprland and Quickshell config) kdePackages.systemsettings #systemsettings (Used in Hyprland keybinds.conf) @@ -153,10 +152,6 @@ gobject-introspection #gobject-introspection (Not explicitly used) - ### illogical-impulse-quickshell-git - #quickshell.packages.x86_64-linux.default (NixGL applicable, included elsewhere) - - ### illogical-impulse-screencapture hyprshot #hyprshot (Used in Hyprland keybinds.conf as fallback) slurp #slurp (Used in Hyprland and Quickshell config) @@ -167,24 +162,6 @@ ### illogical-impulse-toolkit - kdePackages.kdialog #kdialog (Used in Quickshell config) - # https://nixos.wiki/wiki/Qt - # https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/qt-6/srcs.nix - qt6.qt5compat #qt6-5compat - #qt6.qtimageformats (TODO: really?) #qt6-avif-image-plugin - qt6.qtbase #qt6-base - qt6.qtdeclarative #qt6-declarative - qt6.qtimageformats #qt6-imageformats - qt6.qtmultimedia #qt6-multimedia - qt6.qtpositioning #qt6-positioning - qt6.qtquicktimeline #qt6-quicktimeline - qt6.qtsensors #qt6-sensors - qt6.qtsvg #qt6-svg - qt6.qttools #qt6-tools - qt6.qttranslations #qt6-translations - qt6.qtvirtualkeyboard #qt6-virtualkeyboard - qt6.qtwayland #qt6-wayland - kdePackages.syntax-highlighting #syntax-highlighting (Used in Quickshell config) upower #upower (Used in Quickshell config) wtype #wtype (Used in Hyprland scripts/fuzzel-emoji.sh) ydotool #ydotool (Used in Quickshell config) @@ -205,7 +182,10 @@ ] ++ [ #(config.lib.nixGL.wrap pkgs.hyprland) - (config.lib.nixGL.wrap quickshell.packages.x86_64-linux.default) + + ### illogical-impulse-quickshell-git + #(config.lib.nixGL.wrap quickshell.packages.x86_64-linux.default) + (import ./quickshell.nix { inherit pkgs quickshell; nixGLWrap = config.lib.nixGL.wrap; }) ]; }//home_attrs; } diff --git a/sdata/dist-nix/home-manager/quickshell.nix b/sdata/dist-nix/home-manager/quickshell.nix new file mode 100644 index 000000000..83601718d --- /dev/null +++ b/sdata/dist-nix/home-manager/quickshell.nix @@ -0,0 +1,54 @@ +{ pkgs, quickshell, nixGLWrap, ... }: +let + qs = nixGLWrap quickshell.packages.x86_64-linux.default; +in pkgs.stdenv.mkDerivation { + name = "illogical-impulse-quickshell-wrapper"; + meta = with pkgs.lib; { + description = "Quickshell wrapped with NixGL + bundled Qt deps for home-manager usage"; + license = licenses.gpl3Only; + }; + + dontUnpack = true; + dontConfigure = true; + dontBuild = true; + + nativeBuildInputs = [ + pkgs.makeWrapper + pkgs.qt6.wrapQtAppsHook + ]; + + buildInputs = with pkgs; [ + qs + kdePackages.qtwayland + kdePackages.qtpositioning + kdePackages.qtlocation + kdePackages.syntax-highlighting + gsettings-desktop-schemas + # https://nixos.wiki/wiki/Qt + # https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/qt-6/srcs.nix + qt6.qtbase #qt6-base + qt6.qtdeclarative #qt6-declarative + qt6.qt5compat #qt6-5compat + #qt6-avif-image-plugin (TODO: seems not available as nixpkg) + qt6.qtimageformats #qt6-imageformats + qt6.qtmultimedia #qt6-multimedia + qt6.qtpositioning #qt6-positioning + qt6.qtquicktimeline #qt6-quicktimeline + qt6.qtsensors #qt6-sensors + qt6.qtsvg #qt6-svg + qt6.qttools #qt6-tools + qt6.qttranslations #qt6-translations + qt6.qtvirtualkeyboard #qt6-virtualkeyboard + qt6.qtwayland #qt6-wayland + kdePackages.kdialog #kdialog (Used in Quickshell config) + kdePackages.syntax-highlighting #syntax-highlighting (Used in Quickshell config) + ]; + + installPhase = '' + mkdir -p $out/bin + ls -l ${qs}/bin || true + makeWrapper ${qs}/bin/qs $out/bin/qs \ + --prefix XDG_DATA_DIRS : ${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name} + chmod +x $out/bin/qs + ''; +} diff --git a/sdata/dist-nix/install-deps.sh b/sdata/dist-nix/install-deps.sh index 731258e87..cda6f38f4 100644 --- a/sdata/dist-nix/install-deps.sh +++ b/sdata/dist-nix/install-deps.sh @@ -8,7 +8,54 @@ function vianix-warning(){ printf "despite that this should be reversible.\n" pause } +function install_cmds(){ + if [[ "$OS_DISTRO_ID" == "arch" || "$OS_DISTRO_ID_LIKE" == "arch" || "$OS_DISTRO_ID" == "cachyos" ]]; then + local pkgs=() + for cmd in "$@";do + # For package name which is not cmd name, use "case" syntax to replace + pkgs+=($cmd) + done + x sudo pacman -Syu + x sudo pacman -S --noconfirm --needed "${pkgs[@]}" + elif [[ "$OS_DISTRO_ID" == "debian" || "$OS_DISTRO_ID_LIKE" == "debian" ]]; then + local pkgs=() + for cmd in "$@";do + # For package name which is not cmd name, use "case" syntax to replace + pkgs+=($cmd) + done + x sudo apt update -y + x sudo apt install -y "${pkgs[@]}" + elif [[ "$OS_DISTRO_ID" == "fedora" || "$OS_DISTRO_ID_LIKE" == "fedora" ]]; then + local pkgs=() + for cmd in "$@";do + # For package name which is not cmd name, use "case" syntax to replace + pkgs+=($cmd) + done + x sudo dnf install -y "${pkgs[@]}" + elif [[ "$OS_DISTRO_ID" =~ ^(opensuse-leap|opensuse-tumbleweed)$ ]] || [[ "$OS_DISTRO_ID_LIKE" =~ ^(opensuse|suse)(\ (opensuse|suse))?$ ]]; then + local pkgs=() + for cmd in "$@";do + # For package name which is not cmd name, use "case" syntax to replace + pkgs+=($cmd) + done + x sudo zypper refresh + x sudo zypper -n install "${pkgs[@]}" + fi +} +function install_nix(){ + # https://github.com/NixOS/experimental-nix-installer + local cmd=nix + x mkdir -p ${REPO_ROOT}/cache + x curl -JLo ${REPO_ROOT}/cache/nix-installer https://artifacts.nixos.org/experimental-installer + x sh ${REPO_ROOT}/cache/nix-installer install + try source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' + + command -v $cmd && return + echo "Failed in installing $cmd." + echo "Please install it by yourself and then retry." + return 1 +} function install_home-manager(){ # https://nix-community.github.io/home-manager/index.xhtml#sec-install-standalone local cmd=home-manager @@ -31,72 +78,6 @@ function install_home-manager(){ echo "If this is the problem, use \"su - user\" instead." return 1 } -function install_nix(){ - # https://github.com/NixOS/experimental-nix-installer - local cmd=nix - - x mkdir -p ${REPO_ROOT}/cache - x curl -JLo ${REPO_ROOT}/cache/nix-installer https://artifacts.nixos.org/experimental-installer - x sh ${REPO_ROOT}/cache/nix-installer install - try source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' - - command -v $cmd && return - echo "Failed in installing $cmd." - echo "Please install it by yourself and then retry." - return 1 -} -function install_curl(){ - local cmd=curl - - if [[ "$OS_DISTRO_ID" == "arch" || "$OS_DISTRO_ID_LIKE" == "arch" || "$OS_DISTRO_ID" == "cachyos" ]]; then - x sudo pacman -Syu - x sudo pacman -S --noconfirm $cmd - elif [[ "$OS_DISTRO_ID" == "debian" || "$OS_DISTRO_ID_LIKE" == "debian" ]]; then - x sudo apt update - x sudo apt install $cmd - fi - - command -v $cmd && return - echo "Failed in installing $cmd." - echo "Please install it by yourself and then retry." - return 1 -} -function install_fish(){ - local cmd=fish - - if [[ "$OS_DISTRO_ID" == "arch" || "$OS_DISTRO_ID_LIKE" == "arch" || "$OS_DISTRO_ID" == "cachyos" ]]; then - x sudo pacman -Syu - x sudo pacman -S --noconfirm $cmd - elif [[ "$OS_DISTRO_ID" == "debian" || "$OS_DISTRO_ID_LIKE" == "debian" ]]; then - x sudo apt update - x sudo apt install $cmd - fi - - command -v $cmd && return - echo "Failed in installing $cmd." - echo "Please install it by yourself and then retry." - return 1 -} -function install_swaylock(){ - local cmd=swaylock - echo "Detecting command \"$cmd\"..." - command -v $cmd && return - echo "Command \"$cmd\" not found, try to install..." - - if [[ "$OS_DISTRO_ID" == "arch" || "$OS_DISTRO_ID_LIKE" == "arch" || "$OS_DISTRO_ID" == "cachyos" ]]; then - x sudo pacman -Syu - x sudo pacman -S --noconfirm $cmd - elif [[ "$OS_DISTRO_ID" == "debian" || "$OS_DISTRO_ID_LIKE" == "debian" ]]; then - x sudo apt update - x sudo apt install $cmd - fi - - command -v $cmd && return - echo "Failed in installing $cmd." - echo "Please install it by yourself and then retry." - return 1 -} - function hm_deps(){ SETUP_HM_DIR="${REPO_ROOT}/sdata/dist-nix/home-manager" SETUP_USERNAME_NIXFILE="${SETUP_HM_DIR}/username.nix" @@ -115,21 +96,19 @@ function hm_deps(){ vianix-warning -if ! command -v curl >/dev/null 2>&1;then - echo -e "${STY_YELLOW}[$0]: \"curl\" not found.${STY_RST}" - showfun install_curl - v install_curl -fi -if ! command -v fish >/dev/null 2>&1;then - echo -e "${STY_YELLOW}[$0]: \"fish\" not found.${STY_RST}" - showfun install_fish - v install_fish -fi -if ! command -v swaylock >/dev/null 2>&1;then - echo -e "${STY_YELLOW}[$0]: \"swaylock\" not found.${STY_RST}" - showfun install_swaylock - v install_swaylock +NOT_FOUND_CMDS=() +TEST_CMDS=(curl fish swaylock gnome-keyring) +for cmd in "${TEST_CMDS[@]}"; do + if ! command -v $cmd >/dev/null 2>&1;then + NOT_FOUND_CMDS+=($cmd) + fi +done +if [[ ${#NOT_FOUND_CMDS[@]} -gt 0 ]]; then + echo -e "${STY_YELLOW}[$0]: Not found: ${NOT_FOUND_CMDS[*]}.${STY_RST}" + showfun install_cmds + v install_cmds "${NOT_FOUND_CMDS[@]}" fi + if ! command -v nix >/dev/null 2>&1;then echo -e "${STY_YELLOW}[$0]: \"nix\" not found.${STY_RST}" showfun install_nix diff --git a/sdata/dist-nix/install-setups.sh b/sdata/dist-nix/install-setups.sh new file mode 100644 index 000000000..0ddcfcf37 --- /dev/null +++ b/sdata/dist-nix/install-setups.sh @@ -0,0 +1,39 @@ +# This script is meant to be sourced. +# It's not for directly running. + +##################################################################################### +# These python packages are installed using uv into the venv (virtual environment). Once the folder of the venv gets deleted, they are all gone cleanly. So it's considered as setups, not dependencies. +showfun install-python-packages +v install-python-packages + +if [[ -z $(getent group i2c) ]]; then + v sudo groupadd i2c +fi + +v sudo usermod -aG video,i2c,input "$(whoami)" + +if [[ ! -z $(systemctl --version) ]]; then + v bash -c "echo i2c-dev | sudo tee /etc/modules-load.d/i2c-dev.conf" + # TODO: find a proper way for enable Nix installed ydotool + if ! [[ "${INSTALL_VIA_NIX}" == true ]]; then + v systemctl --user enable ydotool --now + fi + v sudo systemctl enable bluetooth --now +elif [[ ! -z $(openrc --version) ]]; then + v bash -c "echo 'modules=i2c-dev' | sudo tee -a /etc/conf.d/modules" + v sudo rc-update add modules boot + v sudo rc-update add ydotool default + v sudo rc-update add bluetooth default + + x sudo rc-service ydotool start + x sudo rc-service bluetooth start +else + printf "${STY_RED}" + printf "====================INIT SYSTEM NOT FOUND====================\n" + printf "${STY_RST}" + pause +fi + +v gsettings set org.gnome.desktop.interface font-name 'Rubik 11' +v gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' +v kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Darkly diff --git a/sdata/subcmd-install/2.setups-selector.sh b/sdata/subcmd-install/2.setups-selector.sh index e4c8e612d..0a72e8728 100644 --- a/sdata/subcmd-install/2.setups-selector.sh +++ b/sdata/subcmd-install/2.setups-selector.sh @@ -19,7 +19,7 @@ export OS_DISTRO_ID_LIKE=$(awk -F'=' '/^ID_LIKE=/ { gsub("\"","",$2); print tolo if [[ "$INSTALL_VIA_NIX" == "true" ]]; then - TARGET_ID=fallback + TARGET_ID=nix printf "${STY_YELLOW}" printf "===WARNING===\n" printf "./sdata/dist-${TARGET_ID}/install-setups.sh will be used.\n"