nixpkgs/pkgs/by-name/mg/mgmt/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

69 lines
1.4 KiB
Nix

{ augeas
, buildGoModule
, fetchFromGitHub
, gotools
, lib
, libvirt
, libxml2
, nex
, pkg-config
, ragel
}:
buildGoModule rec {
pname = "mgmt";
version = "unstable-2022-10-24";
src = fetchFromGitHub {
owner = "purpleidea";
repo = pname;
rev = "d8820fa1855668d9e0f7a7829d9dd0d122b2c5a9";
hash = "sha256-jurZvEtiaTjWeDkmCJDIFlTzR5EVglfoDxkFgOilo8s=";
};
# patching must be done in prebuild, so it is shared with goModules
# see https://github.com/NixOS/nixpkgs/issues/208036
preBuild = ''
for file in `find -name Makefile -type f`; do
substituteInPlace $file --replace "/usr/bin/env " ""
done
substituteInPlace lang/types/Makefile \
--replace "unset GOCACHE && " ""
patchShebangs misc/header.sh
make lang funcgen
'';
buildInputs = [
augeas
libvirt
libxml2
];
nativeBuildInputs = [
gotools
nex
pkg-config
ragel
];
ldflags = [
"-s"
"-w"
"-X main.program=${pname}"
"-X main.version=${version}"
];
subPackages = [ "." ];
vendorHash = "sha256-Dtqy4TILN+7JXiHKHDdjzRTsT8jZYG5sPudxhd8znXY=";
meta = with lib; {
description = "Next generation distributed, event-driven, parallel config management!";
homepage = "https://mgmtconfig.com";
license = licenses.gpl3Only;
maintainers = with maintainers; [ urandom ];
mainProgram = "mgmt";
};
}