nix: clean up devShells
Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
24618ab9a1
commit
7b554234b2
96
flake.nix
96
flake.nix
@ -115,19 +115,52 @@
|
||||
};
|
||||
fsu = pkgs.callPackage ./cmd/fsu/package.nix { inherit (self.packages.${system}) fortify; };
|
||||
|
||||
dist = pkgs.runCommand "${fortify.name}-dist" { inherit (self.devShells.${system}.default) buildInputs; } ''
|
||||
# go requires XDG_CACHE_HOME for the build cache
|
||||
export XDG_CACHE_HOME="$(mktemp -d)"
|
||||
dist =
|
||||
pkgs.runCommand "${fortify.name}-dist"
|
||||
{
|
||||
buildInputs =
|
||||
with pkgs;
|
||||
[
|
||||
go
|
||||
gcc
|
||||
]
|
||||
# buildInputs
|
||||
++ (
|
||||
with pkgsStatic;
|
||||
[
|
||||
musl
|
||||
libffi
|
||||
libseccomp
|
||||
acl
|
||||
wayland
|
||||
wayland-protocols
|
||||
]
|
||||
++ (with xorg; [
|
||||
libxcb
|
||||
libXau
|
||||
libXdmcp
|
||||
])
|
||||
)
|
||||
# nativeBuildInputs
|
||||
++ [
|
||||
pkg-config
|
||||
wayland-scanner
|
||||
makeBinaryWrapper
|
||||
];
|
||||
}
|
||||
''
|
||||
# go requires XDG_CACHE_HOME for the build cache
|
||||
export XDG_CACHE_HOME="$(mktemp -d)"
|
||||
|
||||
# get a different workdir as go does not like /build
|
||||
cd $(mktemp -d) \
|
||||
&& cp -r ${fortify.src}/. . \
|
||||
&& chmod +w cmd && cp -r ${fsu.src}/. cmd/fsu/ \
|
||||
&& chmod -R +w .
|
||||
# get a different workdir as go does not like /build
|
||||
cd $(mktemp -d) \
|
||||
&& cp -r ${fortify.src}/. . \
|
||||
&& chmod +w cmd && cp -r ${fsu.src}/. cmd/fsu/ \
|
||||
&& chmod -R +w .
|
||||
|
||||
export FORTIFY_VERSION="v${fortify.version}"
|
||||
./dist/release.sh && mkdir $out && cp -v "dist/fortify-$FORTIFY_VERSION.tar.gz"* $out
|
||||
'';
|
||||
export FORTIFY_VERSION="v${fortify.version}"
|
||||
./dist/release.sh && mkdir $out && cp -v "dist/fortify-$FORTIFY_VERSION.tar.gz"* $out
|
||||
'';
|
||||
|
||||
fhs = pkgs.buildFHSEnv {
|
||||
pname = "fortify-fhs";
|
||||
@ -174,47 +207,12 @@
|
||||
pkgs = nixpkgsFor.${system};
|
||||
in
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
buildInputs =
|
||||
with pkgs;
|
||||
[
|
||||
go
|
||||
gcc
|
||||
]
|
||||
# buildInputs
|
||||
++ (
|
||||
with pkgsStatic;
|
||||
[
|
||||
musl
|
||||
libffi
|
||||
libseccomp
|
||||
acl
|
||||
wayland
|
||||
wayland-protocols
|
||||
]
|
||||
++ (with xorg; [
|
||||
libxcb
|
||||
libXau
|
||||
libXdmcp
|
||||
])
|
||||
)
|
||||
# nativeBuildInputs
|
||||
++ [
|
||||
pkg-config
|
||||
wayland-scanner
|
||||
makeBinaryWrapper
|
||||
];
|
||||
};
|
||||
|
||||
default = pkgs.mkShell { inherit (fortify) buildInputs; };
|
||||
withPackage = pkgs.mkShell { buildInputs = [ fortify ] ++ fortify.buildInputs; };
|
||||
fhs = fhs.env;
|
||||
|
||||
withPackage = nixpkgsFor.${system}.mkShell {
|
||||
buildInputs = [ self.packages.${system}.fortify ] ++ self.devShells.${system}.default.buildInputs;
|
||||
};
|
||||
|
||||
generateDoc =
|
||||
let
|
||||
pkgs = nixpkgsFor.${system};
|
||||
inherit (pkgs) lib;
|
||||
|
||||
doc =
|
||||
@ -233,7 +231,7 @@
|
||||
sed -i '/*Declared by:*/,+1 d' $out
|
||||
'';
|
||||
in
|
||||
nixpkgsFor.${system}.mkShell {
|
||||
pkgs.mkShell {
|
||||
shellHook = ''
|
||||
exec cat ${docText} > options.md
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user