Skip to content

Commit

Permalink
devenv: fix locale warnings, install shell completions, and more (#36…
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar authored Dec 23, 2024
2 parents b467e92 + aa9162f commit 1636ec1
Showing 1 changed file with 33 additions and 12 deletions.
45 changes: 33 additions & 12 deletions pkgs/by-name/de/devenv/package.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
lib,
stdenv,
fetchFromGitHub,
makeWrapper,
makeBinaryWrapper,
installShellFiles,
rustPlatform,
testers,
cachix,
darwin,
sqlx-cli,
nixVersions,
openssl,
pkg-config,
glibcLocalesUtf8,
devenv, # required to run version test
}:

Expand Down Expand Up @@ -55,20 +55,41 @@ rustPlatform.buildRustPackage {
'';

nativeBuildInputs = [
makeWrapper
installShellFiles
makeBinaryWrapper
pkg-config
sqlx-cli
];

buildInputs =
[ openssl ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.SystemConfiguration
];
buildInputs = [ openssl ];

postInstall = ''
wrapProgram $out/bin/devenv --set DEVENV_NIX ${devenv_nix} --prefix PATH ":" "$out/bin:${cachix}/bin"
'';
postInstall =
let
setDefaultLocaleArchive = lib.optionalString (glibcLocalesUtf8 != null) ''
--set-default LOCALE_ARCHIVE ${glibcLocalesUtf8}/lib/locale/locale-archive
'';
in
''
wrapProgram $out/bin/devenv \
--prefix PATH ":" "$out/bin:${cachix}/bin" \
--set DEVENV_NIX ${devenv_nix} \
${setDefaultLocaleArchive}
# Generate manpages
cargo xtask generate-manpages --out-dir man
installManPage man/*
# Generate shell completions
compdir=./completions
for shell in bash fish zsh; do
cargo xtask generate-shell-completion $shell --out-dir $compdir
done
installShellCompletion --cmd devenv \
--bash $compdir/devenv.bash \
--fish $compdir/devenv.fish \
--zsh $compdir/_devenv
'';

passthru.tests = {
version = testers.testVersion {
Expand Down

0 comments on commit 1636ec1

Please sign in to comment.