diff options
Diffstat (limited to 'pkgs')
| -rw-r--r-- | pkgs/arcanist/default.nix | 59 | ||||
| -rw-r--r-- | pkgs/astal/builder.nix | 63 | ||||
| -rw-r--r-- | pkgs/astal/default.nix | 35 | ||||
| -rw-r--r-- | pkgs/astal/theme.nix | 34 | ||||
| -rw-r--r-- | pkgs/default.nix | 19 | ||||
| -rw-r--r-- | pkgs/solaar-udev-rules/42-logitech-unify-permissions.rules | 31 | ||||
| -rw-r--r-- | pkgs/solaar-udev-rules/default.nix | 14 |
7 files changed, 157 insertions, 98 deletions
diff --git a/pkgs/arcanist/default.nix b/pkgs/arcanist/default.nix index 1ed7b50..9cdf8ed 100644 --- a/pkgs/arcanist/default.nix +++ b/pkgs/arcanist/default.nix @@ -1,31 +1,60 @@ -{pkgs}: -pkgs.stdenvNoCC.mkDerivation rec { +{ + lib, + stdenv, + fetchFromGitHub, + makeWrapper, + php82, + python3, + git, + diffutils, +}: +stdenv.mkDerivation rec { pname = "arcanist"; - version = "2025.18"; + version = "2025.51"; - src = pkgs.fetchFromGitHub { + src = fetchFromGitHub { owner = "phorgeit"; repo = "arcanist"; rev = version; - hash = "sha256-yiHLMcgszV9jP/8qb9X/t9Vfm3Ad7DpU55cafWPPQHY="; + hash = "sha256-muqNbQBLDOLhzVSF7vTckhb6ouIcj6tHR20CFsgv9bQ="; }; - buildInputs = with pkgs; [ + nativeBuildInputs = [makeWrapper]; + + dontBuild = true; + + buildInputs = [ php82 python3 - ]; - - propagatedInputs = with pkgs; [ git diffutils ]; + configurePhase = '' + runHook preConfigure + + patchShebangs . + + runHook postConfigure + ''; + installPhase = '' - mkdir -p $out/share/php/${pname} - mkdir -p $out/bin - cp -a * $out/share/php/${pname} - patchShebangs $out/share/php/${pname} - ln -s $out/share/php/${pname}/bin/arc $out/bin/arc - ln -sf ${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt $out/share/php/${pname}/resources/ssl/default.pem + runHook preInstall + mkdir -p $out/share/php/arcanist $out/bin + + cp --target-directory=$out/share/php/arcanist --recursive \ + bin externals resources scripts src support + + makeWrapper $out/share/php/arcanist/bin/arc $out/bin/arc \ + --inherit-argv0 \ + --chdir $out/share/php/arcanist \ + --prefix PATH : ${lib.makeBinPath buildInputs} + + makeWrapper $out/share/php/arcanist/bin/phage $out/bin/phage \ + --inherit-argv0 \ + --chdir $out/share/php/arcanist \ + --prefix PATH : ${lib.makeBinPath buildInputs} + + runHook postInstall ''; } diff --git a/pkgs/astal/builder.nix b/pkgs/astal/builder.nix index db102bd..ffb38ce 100644 --- a/pkgs/astal/builder.nix +++ b/pkgs/astal/builder.nix @@ -1,43 +1,44 @@ { - pkgs, + stdenvNoCC, astal, + gobject-introspection, + lib, + lua, name, src, - extraLuaPackages ? (_: []), + wrapGAppsHook3, extraPackages ? [], }: let - lua = pkgs.lua.withPackages (ps: - (extraLuaPackages ps) - ++ [ - ps.lgi - (ps.luaPackages.toLuaModule (pkgs.stdenvNoCC.mkDerivation { - name = "astal"; - src = "${astal}/lang/lua/astal"; - dontBuild = true; - installPhase = '' - mkdir -p $out/share/lua/${ps.lua.luaversion}/astal - cp -r * $out/share/lua/${ps.lua.luaversion}/astal - ''; - })) - (ps.luaPackages.toLuaModule (pkgs.stdenvNoCC.mkDerivation { - inherit src name; - dontBuild = true; - installPhase = '' - mkdir -p $out/share/lua/${ps.lua.luaversion} - cp -r * $out/share/lua/${ps.lua.luaversion} - ''; - })) - ]); + lua_ = lua.withPackages (ps: [ + ps.lgi + (ps.luaPackages.toLuaModule (stdenvNoCC.mkDerivation { + name = "astal"; + src = "${astal}/lang/lua/astal"; + dontBuild = true; + installPhase = '' + mkdir -p $out/share/lua/${ps.lua.luaversion}/astal + cp -r * $out/share/lua/${ps.lua.luaversion}/astal + ''; + })) + (ps.luaPackages.toLuaModule (stdenvNoCC.mkDerivation { + inherit src name; + dontBuild = true; + installPhase = '' + mkdir -p $out/share/lua/${ps.lua.luaversion} + cp -r * $out/share/lua/${ps.lua.luaversion} + ''; + })) + ]); script = '' - #!${lua}/bin/lua + #!${lua_}/bin/lua require "init" ''; in - pkgs.stdenvNoCC.mkDerivation { + stdenvNoCC.mkDerivation { inherit src name; - nativeBuildInputs = with pkgs; [ + nativeBuildInputs = [ wrapGAppsHook3 gobject-introspection ]; @@ -45,9 +46,9 @@ in buildInputs = extraPackages ++ [ - lua - astal.packages.${pkgs.stdenv.hostPlatform.system}.io - astal.packages.${pkgs.stdenv.hostPlatform.system}.astal3 + lua_ + astal.io + astal.astal3 ]; installPhase = '' @@ -63,7 +64,7 @@ in preFixup = '' gappsWrapperArgs+=( - --prefix PATH : "${pkgs.lib.makeBinPath extraPackages}" + --prefix PATH : "${lib.makeBinPath extraPackages}" ) ''; } diff --git a/pkgs/astal/default.nix b/pkgs/astal/default.nix index dc8f2a7..d076f07 100644 --- a/pkgs/astal/default.nix +++ b/pkgs/astal/default.nix @@ -1,32 +1,29 @@ { - pkgs, - stdenv, - inputs, - options, + astal, + callPackage, + dart-sass, + networkmanager, + runCommand, + writeShellApplication, + # System theme must be passed in + theme ? null, ... }: let - inherit (pkgs) runCommand dart-sass; - - apkgs = inputs.astal.packages.${stdenv.hostPlatform.system}; - scss = "${dart-sass}/bin/sass"; - theme = import ./theme.nix {inherit options;}; - + vars = import ./theme.nix {inherit theme;}; mkAstal = file: - import ./builder.nix { - inherit pkgs; - astal = inputs.astal; + callPackage ./builder.nix { src = runCommand "src" {} '' mkdir -p $out cp -r ${./src}/{*.lua,widget} $out/ cp $out/${file}.lua $out/init.lua cp -r ${./src}/style/* . - echo '${theme}' > theme.scss + echo '${vars}' > theme.scss cat theme.scss style.scss widget/* > main.scss - ${scss} main.scss $out/main.css + ${dart-sass}/bin/sass main.scss $out/main.css ''; name = "astal-${file}"; extraPackages = - (with apkgs; [ + (with astal; [ apps battery hyprland @@ -36,15 +33,15 @@ tray wireplumber ]) - ++ (with pkgs; [ + ++ [ networkmanager - ]); + ]; }; mkAstalWrapper = file: let pkg = mkAstal file; in - pkgs.writeShellApplication { + writeShellApplication { name = "astal-${file}"; text = '' ${pkg}/bin/astal-${file} diff --git a/pkgs/astal/theme.nix b/pkgs/astal/theme.nix index 9774012..b76864c 100644 --- a/pkgs/astal/theme.nix +++ b/pkgs/astal/theme.nix @@ -1,26 +1,26 @@ -{options, ...}: '' +{theme, ...}: '' - $text: #${options.theme.colors.text}; - $subtext: #${options.theme.colors.subtext}; + $text: #${theme.colors.text}; + $subtext: #${theme.colors.subtext}; - $base: #${options.theme.colors.base}; - $surface: #${options.theme.colors.surface}; - $overlay: #${options.theme.colors.overlay}; + $base: #${theme.colors.base}; + $surface: #${theme.colors.surface}; + $overlay: #${theme.colors.overlay}; - $primary: #${options.theme.colors.primary}; - $success: #${options.theme.colors.success}; - $warning: #${options.theme.colors.warning}; - $error: #${options.theme.colors.error}; + $primary: #${theme.colors.primary}; + $success: #${theme.colors.success}; + $warning: #${theme.colors.warning}; + $error: #${theme.colors.error}; - $border: ${toString options.theme.borderWidth}px; + $border: ${toString theme.borderWidth}px; - $inner-radius: ${toString options.theme.innerRadius}px; - $outer-radius: ${toString options.theme.outerRadius}px; + $inner-radius: ${toString theme.innerRadius}px; + $outer-radius: ${toString theme.outerRadius}px; - $inner-gap: ${toString options.theme.innerGap}px; - $outer-gap: ${toString options.theme.outerGap}px; + $inner-gap: ${toString theme.innerGap}px; + $outer-gap: ${toString theme.outerGap}px; - $font-name: "${options.theme.font.regular}", "${options.theme.font.monospace}"; - $font-size: ${toString options.theme.font.size}px; + $font-name: "${theme.font.regular}", "${theme.font.monospace}"; + $font-size: ${toString theme.font.size}px; '' diff --git a/pkgs/default.nix b/pkgs/default.nix index 1069328..3b6e894 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,19 +1,6 @@ -{ - pkgs, - inputs, - lib, - ... -}: let - options = - (lib.evalModules { - modules = [ - ../options.nix - ]; - }).config; -in { +{pkgs}: { arcanist = pkgs.callPackage ./arcanist {}; - astal = pkgs.callPackage ./astal { - inherit inputs options; - }; + astal = pkgs.callPackage ./astal {}; libfprint-2-tod1-vfs0090 = pkgs.callPackage ./libfprint-2-tod1-vfs0090 {}; + solaar-udev-rules = pkgs.callPackage ./solaar-udev-rules {}; } diff --git a/pkgs/solaar-udev-rules/42-logitech-unify-permissions.rules b/pkgs/solaar-udev-rules/42-logitech-unify-permissions.rules new file mode 100644 index 0000000..e52c9b0 --- /dev/null +++ b/pkgs/solaar-udev-rules/42-logitech-unify-permissions.rules @@ -0,0 +1,31 @@ +# This rule was added by Solaar. +# +# Allows non-root users to have raw access to Logitech devices. +# Allowing users to write to the device is potentially dangerous +# because they could perform firmware updates. + +ACTION != "add", GOTO="solaar_end" +SUBSYSTEM != "hidraw", GOTO="solaar_end" + +# USB-connected Logitech receivers and devices +ATTRS{idVendor}=="046d", GOTO="solaar_apply" + +# Lenovo nano receiver +ATTRS{idVendor}=="17ef", ATTRS{idProduct}=="6042", GOTO="solaar_apply" + +# Bluetooth-connected Logitech devices +KERNELS == "0005:046D:*", GOTO="solaar_apply" + +GOTO="solaar_end" + +LABEL="solaar_apply" + +# Allow any seated user to access the receiver. +# uaccess: modern ACL-enabled udev +TAG+="uaccess" + +# Grant members of the "plugdev" group access to receiver (useful for SSH users) +#MODE="0660", GROUP="plugdev" + +LABEL="solaar_end" +# vim: ft=udevrules diff --git a/pkgs/solaar-udev-rules/default.nix b/pkgs/solaar-udev-rules/default.nix new file mode 100644 index 0000000..a4148a0 --- /dev/null +++ b/pkgs/solaar-udev-rules/default.nix @@ -0,0 +1,14 @@ +{stdenv}: +stdenv.mkDerivation { + name = "solaar-udev-rules"; + + src = ./.; + + dontBuild = true; + dontConfigure = true; + + installPhase = '' + mkdir -p $out/etc/udev/rules.d + cp 42-logitech-unify-permissions.rules $out/etc/udev/rules.d + ''; +} |