aboutsummaryrefslogtreecommitdiffhomepage
path: root/flake.nix
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-03-17 09:49:18 +0900
committerOphestra <cat@gensokyo.uk>2025-03-17 12:26:19 +0900
commit33855381422932a208fa412bd4a96c0905aafdf1 (patch)
tree070feaa36174174fb52ebdbfc76bd24d41a71084 /flake.nix
parent24618ab9a1524e8b8986a9bf67667288e642fcf1 (diff)
nix: clean up flake outputs
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix100
1 files changed, 20 insertions, 80 deletions
diff --git a/flake.nix b/flake.nix
index b1929d55..29a6367e 100644
--- a/flake.nix
+++ b/flake.nix
@@ -27,7 +27,7 @@
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
- nixosModules.fortify = import ./nixos.nix;
+ nixosModules.fortify = import ./nixos.nix self.packages;
buildPackage = forAllSystems (
system:
@@ -105,9 +105,21 @@
default = fortify;
fortify = pkgs.pkgsStatic.callPackage ./package.nix {
inherit (pkgs)
+ # passthru.buildInputs
+ go
+ gcc
+
+ # nativeBuildInputs
+ pkg-config
+ wayland-scanner
+ makeBinaryWrapper
+
+ # appPackages
+ glibc
bubblewrap
xdg-dbus-proxy
- glibc
+
+ # fpkg
zstd
gnutar
coreutils
@@ -115,7 +127,7 @@
};
fsu = pkgs.callPackage ./cmd/fsu/package.nix { inherit (self.packages.${system}) fortify; };
- dist = pkgs.runCommand "${fortify.name}-dist" { inherit (self.devShells.${system}.default) buildInputs; } ''
+ dist = pkgs.runCommand "${fortify.name}-dist" { buildInputs = fortify.targetPkgs ++ [ pkgs.pkgsStatic.musl ]; } ''
# go requires XDG_CACHE_HOME for the build cache
export XDG_CACHE_HOME="$(mktemp -d)"
@@ -128,93 +140,21 @@
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";
- inherit (fortify) version;
- targetPkgs =
- pkgs:
- with pkgs;
- [
- go
- gcc
- pkg-config
- wayland-scanner
- ]
- ++ (
- with pkgs.pkgsStatic;
- [
- musl
- libffi
- libseccomp
- acl
- wayland
- wayland-protocols
- ]
- ++ (with xorg; [
- libxcb
- libXau
- libXdmcp
-
- xorgproto
- ])
- );
- extraOutputsToInstall = [ "dev" ];
- profile = ''
- export PKG_CONFIG_PATH="/usr/share/pkgconfig:$PKG_CONFIG_PATH"
- '';
- };
}
);
devShells = forAllSystems (
system:
let
- inherit (self.packages.${system}) fortify fhs;
+ inherit (self.packages.${system}) fortify;
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
- ];
- };
-
- fhs = fhs.env;
-
- withPackage = nixpkgsFor.${system}.mkShell {
- buildInputs = [ self.packages.${system}.fortify ] ++ self.devShells.${system}.default.buildInputs;
- };
+ default = pkgs.mkShell { buildInputs = fortify.targetPkgs; };
+ withPackage = pkgs.mkShell { buildInputs = [ fortify ] ++ fortify.targetPkgs; };
generateDoc =
let
- pkgs = nixpkgsFor.${system};
inherit (pkgs) lib;
doc =
@@ -223,7 +163,7 @@
specialArgs = {
inherit pkgs;
};
- modules = [ ./options.nix ];
+ modules = [ (import ./options.nix self.packages) ];
};
cleanEval = lib.filterAttrsRecursive (n: _: n != "_module") eval;
in
@@ -233,7 +173,7 @@
sed -i '/*Declared by:*/,+1 d' $out
'';
in
- nixpkgsFor.${system}.mkShell {
+ pkgs.mkShell {
shellHook = ''
exec cat ${docText} > options.md
'';