mirror of
https://github.com/zoriya/astal.git
synced 2025-12-06 06:06:10 +00:00
nix: touchups
This commit is contained in:
12
flake.nix
12
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; {
|
||||
|
||||
44
nix/lua.nix
44
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}"
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user