diff options
author | Aylur <[email protected]> | 2024-09-11 21:48:26 +0000 |
---|---|---|
committer | Aylur <[email protected]> | 2024-09-11 21:48:26 +0000 |
commit | e2b9013d38f64f6e0f53841f32f9e000b74e220f (patch) | |
tree | a540296191fac436649ba66934580aa468aaf4ae | |
parent | 0e259e49357d5389db897414fc52b50b1ce1d14c (diff) |
nix: touchups
-rw-r--r-- | flake.nix | 12 | ||||
-rw-r--r-- | nix/lua.nix | 44 |
2 files changed, 28 insertions, 28 deletions
@@ -8,8 +8,8 @@ inherit (builtins) replaceStrings readFile; version = replaceStrings ["\n"] [""] (readFile ./version); - system = "x86_64-linux"; - pkgs = import nixpkgs {inherit system;}; + system = "x86_64-linux"; # TODO: other architectures + pkgs = nixpkgs.legacyPackages.${system}; mkPkg = name: src: inputs: pkgs.stdenv.mkDerivation { @@ -33,9 +33,11 @@ inherit self pkgs; }; - mkLuaPackage = import ./nix/lua.nix { - inherit pkgs; - astal = self; + lib = { + mkLuaPackage = import ./nix/lua.nix { + inherit pkgs; + astal = self; + }; }; packages.${system} = with pkgs; { diff --git a/nix/lua.nix b/nix/lua.nix index ed8ec0a..0449c34 100644 --- a/nix/lua.nix +++ b/nix/lua.nix @@ -4,7 +4,7 @@ defaults: { name ? "astal-lua", src, extraLuaPackages ? (ps: []), - extraPacakges ? [], + extraPackages ? [], }: let lua = pkgs.lua.withPackages (ps: (extraLuaPackages ps) @@ -22,37 +22,35 @@ defaults: { })) ]); - nativeBuildInputs = with pkgs; [ - wrapGAppsHook - gobject-introspection - ]; - - buildInputs = - extraPacakges - ++ [ - lua - astal.packages.${pkgs.system}.default - ]; - - script = pkgs.writeScript "astal-lua" '' + script = '' #!${lua}/bin/lua package.path = package.path .. ";${src}/?.lua" require "app" ''; in - pkgs.stdenv.mkDerivation { - inherit nativeBuildInputs buildInputs src name; + pkgs.stdenvNoCC.mkDerivation { + inherit src name; + + nativeBuildInputs = with pkgs; [ + wrapGAppsHook + gobject-introspection + ]; + + buildInputs = + extraPackages + ++ [ + lua + astal.packages.${pkgs.system}.default + ]; installPhase = '' mkdir -p $out/bin cp -r * $out/bin - cp ${script} $out/bin/${name} - chmod +x $out/bin/${name} + echo '${script}' > astal-lua + install -m 755 astal-lua $out/bin/${name} ''; - preFixup = '' - gappsWrapperArgs+=( - --prefix PATH : "${pkgs.lib.makeBinPath extraPacakges}" - ) - ''; + gappsWrapperArgs = [ + "--prefix PATH : ${pkgs.lib.makeBinPath extraPackages}" + ]; } |