summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-09-11 21:48:26 +0000
committerAylur <[email protected]>2024-09-11 21:48:26 +0000
commite2b9013d38f64f6e0f53841f32f9e000b74e220f (patch)
treea540296191fac436649ba66934580aa468aaf4ae
parent0e259e49357d5389db897414fc52b50b1ce1d14c (diff)
nix: touchups
-rw-r--r--flake.nix12
-rw-r--r--nix/lua.nix44
2 files changed, 28 insertions, 28 deletions
diff --git a/flake.nix b/flake.nix
index 8ff60e7..f2ae8cf 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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}"
+ ];
}