nixpkgs/pkgs/by-name/ra/ragnarwm/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

74 lines
1.6 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, writeText
, fontconfig
, libX11
, libXft
, libXcursor
, libXcomposite
, conf ? null
, nixosTests
}:
stdenv.mkDerivation (finalAttrs: {
pname = "ragnarwm";
version = "1.4";
src = fetchFromGitHub {
owner = "cococry";
repo = "Ragnar";
rev = finalAttrs.version;
hash = "sha256-OZhIwrKEhTfkw9K8nZIwGZzxXBObseWS92Y+85HmdNs=";
};
prePatch = ''
substituteInPlace Makefile \
--replace '/usr/bin' "$out/bin" \
--replace '/usr/share' "$out/share"
'';
postPatch =
let
configFile =
if lib.isDerivation conf || builtins.isPath conf
then conf else writeText "config.h" conf;
in
lib.optionalString (conf != null) "cp ${configFile} config.h";
buildInputs = [
fontconfig
libX11
libXft
libXcursor
libXcomposite
];
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
enableParallelBuilding = true;
preInstall = ''
mkdir -p $out/bin
mkdir -p $out/share/applications
'';
postInstall = ''
install -Dm644 $out/share/applications/ragnar.desktop $out/share/xsessions/ragnar.desktop
'';
passthru = {
tests.ragnarwm = nixosTests.ragnarwm;
providedSessions = [ "ragnar" ];
};
meta = {
description = "Minimal, flexible & user-friendly X tiling window manager";
homepage = "https://ragnar-website.vercel.app";
changelog = "https://github.com/cococry/Ragnar/releases/tag/${finalAttrs.version}";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ sigmanificient ];
mainProgram = "ragnar";
platforms = lib.platforms.linux;
};
})