about summary refs log tree commit diff
path: root/lib/systems/inspect.nix
diff options
context:
space:
mode:
authorRyan Burns <rtburns@protonmail.com>2021-10-17 20:48:47 -0700
committerRyan Burns <rtburns@protonmail.com>2024-01-02 14:07:20 -0800
commit5cbd74e49a94692ce5582506966789e60a27363e (patch)
tree54f7680cb63df10ff6832b06d101ed0b6f990b2f /lib/systems/inspect.nix
parentee291783e509f809c0c5e2c4050ea9edcfd6c4f6 (diff)
lib/systems: add exec format inspection attrs
Most of the time when we do a patchelf conditional on
hostPlatform.isLinux, what we really mean is hostPlatform.isElf.
Now that we are starting to support BSDs, this is becoming more important.
Diffstat (limited to 'lib/systems/inspect.nix')
-rw-r--r--lib/systems/inspect.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix
index 073df78797c72..5e5e92699e44c 100644
--- a/lib/systems/inspect.nix
+++ b/lib/systems/inspect.nix
@@ -98,6 +98,9 @@ rec {
       { cpu = { family = "riscv"; }; }
       { cpu = { family = "x86"; }; }
     ];
+
+    isElf          = { kernel.execFormat = execFormats.elf; };
+    isMacho        = { kernel.execFormat = execFormats.macho; };
   };
 
   # given two patterns, return a pattern which is their logical AND.