about summary refs log tree commit diff
path: root/lib/systems
diff options
context:
space:
mode:
authorDaniel Olsen <daniel.olsen99@gmail.com>2022-08-15 02:10:01 +0200
committerAlyssa Ross <hi@alyssa.is>2022-08-16 08:36:57 +0000
commit875d77ca0328df20cb4db308b29ef77bb25749d8 (patch)
treed7c035c7183850f0a9fa265c4a1322bf19be66c6 /lib/systems
parent70ec0e7ec4bc889ba6518fbe382a9c1a3cad6619 (diff)
lib/systems: Add staticLibrary and library
staticLibrary includes common extensions for static libraries
library is a new common attribute that includes both shared and static extensions
Diffstat (limited to 'lib/systems')
-rw-r--r--lib/systems/default.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/systems/default.nix b/lib/systems/default.nix
index 2990afde3e9a6..8f579368d6d34 100644
--- a/lib/systems/default.nix
+++ b/lib/systems/default.nix
@@ -65,11 +65,17 @@ rec {
         # is why we use the more obscure "bfd" and not "binutils" for this
         # choice.
         else                                     "bfd";
-      extensions = {
+      extensions = rec {
         sharedLibrary =
           /**/ if final.isDarwin  then ".dylib"
           else if final.isWindows then ".dll"
           else                         ".so";
+        staticLibrary =
+          /**/ if final.isWindows then ".lib"
+          else                         ".a";
+        library =
+          /**/ if final.isStatic then staticLibrary
+          else                        sharedLibrary;
         executable =
           /**/ if final.isWindows then ".exe"
           else                         "";