Files
nixpkgs/pkgs/by-name/ag/ags/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

116 lines
2.6 KiB
Nix

{
lib,
astal,
blueprint-compiler,
buildGoModule,
callPackage,
dart-sass,
symlinkJoin,
fetchFromGitHub,
gjs,
glib,
gobject-introspection,
gtk4-layer-shell,
installShellFiles,
nix-update-script,
nodejs,
stdenv,
wrapGAppsHook3,
extraPackages ? [ ],
}:
buildGoModule rec {
pname = "ags";
version = "2.3.0";
src = fetchFromGitHub {
owner = "Aylur";
repo = "ags";
tag = "v${version}";
hash = "sha256-GLyNtU9A2VN22jNRHZ2OXuFfTJLh8uEVVt+ftsKUX0c=";
};
vendorHash = "sha256-Pw6UNT5YkDVz4HcH7b5LfOg+K3ohrBGPGB9wYGAQ9F4=";
proxyVendor = true;
ldflags = [
"-s"
"-w"
"-X main.astalGjs=${astal.gjs}/share/astal/gjs"
"-X main.gtk4LayerShell=${gtk4-layer-shell}/lib/libgtk4-layer-shell.so"
];
nativeBuildInputs = [
wrapGAppsHook3
gobject-introspection
installShellFiles
];
buildInputs = extraPackages ++ [
glib
astal.io
astal.astal3
astal.astal4
gobject-introspection # needed for type generation
];
preFixup =
let
# git files are usually in `dev` output.
# `propagatedBuildInputs` are also available in the gjs runtime
# so we also want to generate types for these.
depsOf = pkg: [ (pkg.dev or pkg) ] ++ (map depsOf (pkg.propagatedBuildInputs or [ ]));
girDirs = symlinkJoin {
name = "gir-dirs";
paths = lib.flatten (map depsOf buildInputs);
};
in
''
gappsWrapperArgs+=(
--prefix EXTRA_GIR_DIRS : "${girDirs}/share/gir-1.0"
--prefix PATH : "${
lib.makeBinPath (
[
gjs
nodejs
dart-sass
blueprint-compiler
astal.io
]
++ extraPackages
)
}"
)
'';
postInstall =
lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform)
# bash
''
installShellCompletion \
--cmd ags \
--bash <($out/bin/ags completion bash) \
--fish <($out/bin/ags completion fish) \
--zsh <($out/bin/ags completion zsh)
'';
passthru = {
bundle = callPackage ./bundle.nix { };
updateScript = nix-update-script { };
};
meta = {
description = "Scaffolding CLI for Astal widget system";
homepage = "https://github.com/Aylur/ags";
changelog = "https://github.com/Aylur/ags/releases/tag/v${version}";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [
foo-dogsquared
johnrtitor
perchun
];
mainProgram = "ags";
platforms = lib.platforms.linux;
};
}