aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-02-26 12:20:12 +0900
committerOphestra <cat@gensokyo.uk>2025-02-26 12:24:04 +0900
commitc21a4cff14baddeea8b1c25d144b13521bb86fee (patch)
tree47441c0e8d9fe50f809c4251247be8ea479d8b55
parent4fa38d60633d921774ccf2771994e5161c12c4f5 (diff)
nix: wrap fpkg
This is usable on nixos now due to the static build. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--flake.nix9
-rw-r--r--options.nix9
-rw-r--r--package.nix45
3 files changed, 48 insertions, 15 deletions
diff --git a/flake.nix b/flake.nix
index 16f93c05..30986a05 100644
--- a/flake.nix
+++ b/flake.nix
@@ -103,7 +103,14 @@
{
default = fortify;
fortify = pkgs.pkgsStatic.callPackage ./package.nix {
- inherit (pkgs) bubblewrap xdg-dbus-proxy glibc;
+ inherit (pkgs)
+ bubblewrap
+ xdg-dbus-proxy
+ glibc
+ zstd
+ gnutar
+ coreutils
+ ;
};
fsu = pkgs.callPackage ./cmd/fsu/package.nix { inherit (self.packages.${system}) fortify; };
diff --git a/options.nix b/options.nix
index 5bea3386..5bad55d7 100644
--- a/options.nix
+++ b/options.nix
@@ -3,7 +3,14 @@
let
inherit (lib) types mkOption mkEnableOption;
fortify = pkgs.pkgsStatic.callPackage ./package.nix {
- inherit (pkgs) bubblewrap xdg-dbus-proxy glibc;
+ inherit (pkgs)
+ bubblewrap
+ xdg-dbus-proxy
+ glibc
+ zstd
+ gnutar
+ coreutils
+ ;
};
in
diff --git a/package.nix b/package.nix
index e45b857d..595fa2a7 100644
--- a/package.nix
+++ b/package.nix
@@ -14,6 +14,11 @@
wayland-scanner,
xorg,
+ # for fpkg
+ zstd,
+ gnutar,
+ coreutils,
+
glibc, # for ldd
withStatic ? stdenv.hostPlatform.isStatic,
}:
@@ -80,19 +85,33 @@ buildGoModule rec {
HOME="$(mktemp -d)" PATH="${pkg-config}/bin:$PATH" go generate ./...
'';
- postInstall = ''
- install -D --target-directory=$out/share/zsh/site-functions comp/*
+ postInstall =
+ let
+ appPackages = [
+ glibc
+ bubblewrap
+ xdg-dbus-proxy
+ ];
+ in
+ ''
+ install -D --target-directory=$out/share/zsh/site-functions comp/*
- mkdir "$out/libexec"
- mv "$out"/bin/* "$out/libexec/"
+ mkdir "$out/libexec"
+ mv "$out"/bin/* "$out/libexec/"
- makeBinaryWrapper "$out/libexec/fortify" "$out/bin/fortify" \
- --inherit-argv0 --prefix PATH : ${
- lib.makeBinPath [
- glibc
- bubblewrap
- xdg-dbus-proxy
- ]
- }
- '';
+ makeBinaryWrapper "$out/libexec/fortify" "$out/bin/fortify" \
+ --inherit-argv0 --prefix PATH : ${lib.makeBinPath appPackages}
+
+ makeBinaryWrapper "$out/libexec/fpkg" "$out/bin/fpkg" \
+ --inherit-argv0 --prefix PATH : ${
+ lib.makeBinPath (
+ appPackages
+ ++ [
+ zstd
+ gnutar
+ coreutils
+ ]
+ )
+ }
+ '';
}