-
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
101 additions
and
10 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,47 @@ | ||
{ | ||
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; | ||
}; | ||
|
||
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="${pkgs.coreutils}/bin:${pkgs.gnumake}/bin:${pkgs.gnutar}/bin:${pkgs.gzip}/bin:${pkgs.gnused}/bin:${pkgs.glib}/bin"; # glib: locale | ||
PATH="/run/current-system/sw/bin:${pkgs.gnumake}/bin:${pkgs.binutils.bintools}/bin"; | ||
LOCALE_ARCHIVE="/run/current-system/sw/lib/locale/locale-archive"; | ||
}; | ||
|
||
package = { | ||
compiler = { name="gcc"; extern=gccWithFortran; version=gccWithFortran.version; }; | ||
}; | ||
}; | ||
in { | ||
lib.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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
packs: spackPath: config: derivation ({ | ||
packs: spackEnv: config: derivation ({ | ||
inherit (packs.prefs) system; | ||
name = "spackConfig"; | ||
builder = ./config.sh; | ||
sections = builtins.attrNames config; | ||
PATH = spackPath; | ||
} // builtins.mapAttrs (n: v: builtins.toJSON { "${n}" = v; }) config) | ||
} // spackEnv // builtins.mapAttrs (n: v: builtins.toJSON { "${n}" = v; }) config) |