nixpkgs/pkgs/by-name/nw/nwg-hello/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
1.8 KiB
Nix
Raw Normal View History

2024-01-12 22:05:01 +00:00
{ lib
, fetchFromGitHub
, gobject-introspection
, gtk-layer-shell
, gtk3
, python3Packages
, wrapGAppsHook
}:
python3Packages.buildPythonApplication rec {
pname = "nwg-hello";
2024-03-24 18:14:21 +00:00
version = "0.1.8";
2024-01-12 22:05:01 +00:00
src = fetchFromGitHub {
owner = "nwg-piotr";
repo = "nwg-hello";
2024-02-08 06:18:58 +00:00
rev = "refs/tags/v${version}";
2024-03-24 18:14:21 +00:00
hash = "sha256-WNich+DsRvYS4GiLWZLWRvvWxCAlzrK9Q7aRX7dKjeQ=";
2024-01-12 22:05:01 +00:00
};
nativeBuildInputs = [
gobject-introspection
wrapGAppsHook
];
buildInputs = [
gtk3
gtk-layer-shell
];
propagatedBuildInputs = [
python3Packages.pygobject3
];
postPatch = ''
# hard coded paths
substituteInPlace nwg_hello/main.py \
--replace '/etc/nwg-hello' "$out/etc/nwg-hello" \
--replace "/usr/share/xsessions" "/run/current-system/sw/share/xsessions" \
--replace "/usr/share/wayland-sessions" "/run/current-system/sw/share/wayland-sessions"
substituteInPlace nwg-hello-default.json \
--replace "/usr/share/xsessions" "/run/current-system/sw/share/xsessions" \
--replace "/usr/share/wayland-sessions" "/run/current-system/sw/share/wayland-sessions"
substituteInPlace nwg_hello/ui.py --replace '/usr/share/nwg-hello' "$out/share/nwg-hello"
'';
postInstall = ''
install -D -m 644 -t "$out/etc/nwg-hello/" nwg-hello-default.json nwg-hello-default.css hyprland.conf sway-config README
install -D -m 644 -t "$out/share/nwg-hello/" nwg.jpg
install -D -m 644 -t "$out/share/nwg-hello/" img/*
'';
# Upstream has no tests
doCheck = false;
pythonImportsCheck = [ "nwg_hello" ];
meta = {
homepage = "https://github.com/nwg-piotr/nwg-hello";
description = "GTK3-based greeter for the greetd daemon, written in python";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
maintainers = [ ];
mainProgram = "nwg-hello";
};
}