-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
basic flake.nix support with lib.packs
impure and sandbox options should be passed as: $ nix build .#pkgs.zlib -L --impure --option sandbox false
- Loading branch information
Showing
4 changed files
with
206 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
description = "Flake for NixPACK"; | ||
|
||
inputs.spack = { url="github:spack/spack"; flake=false; }; | ||
#inputs.spack = { url="github:flatironinstitute/spack/fi-nixpack"; flake=false; }; | ||
inputs.nixpkgs.url = "github:dguibert/nixpkgs/pu-nixpack"; | ||
|
||
outputs = inputs: let | ||
nixpkgsFor = system: import inputs.nixpkgs { | ||
inherit system; | ||
config = { | ||
replaceStdenv = import ./nixpkgs/stdenv.nix; | ||
allowUnfree = true; | ||
cudaSupport = true; | ||
}; | ||
overlays = [(import ./nixpkgs/overlay.nix)]; | ||
}; | ||
|
||
nixosPacks = system: let | ||
pkgs = nixpkgsFor system; | ||
gccWithFortran = pkgs.wrapCC (pkgs.gcc.cc.override { | ||
langFortran = true; | ||
}); | ||
in inputs.self.lib.packs { | ||
inherit system; | ||
os = "nixos21"; | ||
global.verbose = "true"; | ||
spackConfig.config.source_cache="/tmp/spack_cache"; | ||
spackPython = "${pkgs.python3}/bin/python3"; | ||
spackEnv = { | ||
# pure environment PATH | ||
PATH=/*"/run/current-system/sw/bin:" | ||
+*/inputs.nixpkgs.lib.concatStringsSep ":" | ||
(builtins.map (x: "${x}/bin") | ||
[ | ||
pkgs.bash | ||
pkgs.coreutils | ||
pkgs.gnumake | ||
pkgs.gnutar | ||
pkgs.gzip | ||
pkgs.bzip2 | ||
pkgs.xz | ||
pkgs.gawk | ||
pkgs.gnused | ||
pkgs.gnugrep | ||
pkgs.glib | ||
pkgs.binutils.bintools # glib: locale | ||
pkgs.patch | ||
pkgs.texinfo | ||
pkgs.diffutils | ||
pkgs.pkgconfig | ||
pkgs.gitMinimal | ||
pkgs.findutils | ||
]); | ||
#PATH="/run/current-system/sw/bin:${pkgs.gnumake}/bin:${pkgs.binutils.bintools}/bin"; | ||
LOCALE_ARCHIVE="/run/current-system/sw/lib/locale/locale-archive"; | ||
LIBRARY_PATH=/*"/run/current-system/sw/bin:" | ||
+*/inputs.nixpkgs.lib.concatStringsSep ":" | ||
(builtins.map (x: "${x}/lib") | ||
[ | ||
(inputs.nixpkgs.lib.getLib pkgs.binutils.bintools) # ucx (configure fails) libbfd not found | ||
]); | ||
}; | ||
|
||
package = { | ||
compiler = { name="gcc"; extern=gccWithFortran; version=gccWithFortran.version; }; | ||
perl = { extern=pkgs.perl; version=pkgs.perl.version; }; | ||
openssh = { extern=pkgs.openssh; version=pkgs.openssh.version; }; | ||
openssl = { extern=pkgs.symlinkJoin { name="openssl"; paths = [ pkgs.openssl.all ]; }; version=pkgs.openssl.version; }; | ||
openmpi = { | ||
version = "4.1"; | ||
variants = { | ||
fabrics = { | ||
none = false; | ||
ucx = true; | ||
}; | ||
schedulers = { | ||
none = false; | ||
slurm = false; | ||
}; | ||
pmi = false; | ||
pmix = false; | ||
static = false; | ||
thread_multiple = true; | ||
legacylaunchers = true; | ||
}; | ||
}; | ||
}; | ||
repoPatch = { | ||
dyninst = spec: old: { | ||
patches = [ ./patch/dyninst-nixos.patch ]; | ||
}; | ||
openmpi = spec: old: { | ||
build = { | ||
setup = '' | ||
configure_args = pkg.configure_args() | ||
if spec.satisfies("~pmix"): | ||
if '--without-mpix' in configure_args: configure_args.remove('--without-pmix') | ||
pkg.configure_args = lambda: configure_args | ||
''; | ||
}; | ||
}; | ||
}; | ||
}; | ||
in { | ||
lib = (import packs/lib.nix) // { | ||
packs = { | ||
... | ||
}@args: import ./packs ({ | ||
inherit (inputs) spack nixpkgs; | ||
} // args); | ||
}; | ||
|
||
|
||
packages.x86_64-linux = nixosPacks "x86_64-linux"; | ||
|
||
defaultPackage.x86_64-linux = inputs.self.packages.x86_64-linux.hello; | ||
|
||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
diff --git a/scripts/dynsysname b/scripts/dynsysname | ||
index 6906fb224..ce385e046 100755 | ||
--- a/scripts/dynsysname | ||
+++ b/scripts/dynsysname | ||
@@ -1,4 +1,4 @@ | ||
-#!/bin/bash | ||
+#!/usr/bin/env bash | ||
|
||
P=$1 | ||
|
||
diff --git a/scripts/sysname b/scripts/sysname | ||
index 16f540483..dccd3e677 100755 | ||
--- a/scripts/sysname | ||
+++ b/scripts/sysname | ||
@@ -1,4 +1,4 @@ | ||
-#!/bin/bash | ||
+#!/usr/bin/env bash | ||
# $Id: sysname,v 1.6 2005/08/09 16:13:16 gquinn Exp $ | ||
# Attempt to guess a canonical system name. | ||
# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. |