forked from rarias/jungle
Compare commits
4 Commits
nix-portab
...
test-hello
| Author | SHA1 | Date | |
|---|---|---|---|
|
d9c49cd5c9
|
|||
|
d6d8976b7e
|
|||
|
0a47e17054
|
|||
|
4b4423d3cf
|
@@ -11,10 +11,10 @@ jobs:
|
|||||||
build:all:
|
build:all:
|
||||||
runs-on: native
|
runs-on: native
|
||||||
steps:
|
steps:
|
||||||
- uses: https://gitea.com/ScMi1/checkout@v1.4
|
- uses: https://jungle.bsc.es/git/actions/checkout@v6-gitea
|
||||||
- run: nix build -L --no-link --print-out-paths .#bsc.ci.all
|
- run: nix build -L --no-link --print-out-paths .#bsc.ci.all
|
||||||
build:cross:
|
build:cross:
|
||||||
runs-on: native
|
runs-on: native
|
||||||
steps:
|
steps:
|
||||||
- uses: https://gitea.com/ScMi1/checkout@v1.4
|
- uses: https://jungle.bsc.es/git/actions/checkout@v6-gitea
|
||||||
- run: nix build -L --no-link --print-out-paths .#bsc.ci.cross
|
- run: nix build -L --no-link --print-out-paths .#bsc.ci.cross
|
||||||
|
|||||||
23
flake.nix
23
flake.nix
@@ -1,18 +1,25 @@
|
|||||||
{
|
{
|
||||||
|
description = "hello";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, ... }:
|
outputs = { self, nixpkgs, ... }:
|
||||||
let
|
let
|
||||||
forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" "armv6l-linux" "armv7l-linux" "i686-linux" "riscv64-linux" ];
|
|
||||||
|
|
||||||
mkConf = name: nixpkgs.lib.nixosSystem {
|
mkConf = name: nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = { inherit nixpkgs; theFlake = self; };
|
specialArgs = { inherit nixpkgs; theFlake = self; };
|
||||||
modules = [ "${self.outPath}/m/${name}/configuration.nix" ];
|
modules = [ "${self.outPath}/m/${name}/configuration.nix" ];
|
||||||
};
|
};
|
||||||
in
|
# For now we only support x86
|
||||||
|
system = "x86_64-linux";
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [ self.overlays.default ];
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
hut = mkConf "hut";
|
hut = mkConf "hut";
|
||||||
@@ -33,15 +40,9 @@ let
|
|||||||
overlays.default = self.bscOverlay;
|
overlays.default = self.bscOverlay;
|
||||||
|
|
||||||
# full nixpkgs with our overlay applied
|
# full nixpkgs with our overlay applied
|
||||||
legacyPackages = forAllSystems (system:
|
legacyPackages.${system} = pkgs;
|
||||||
import nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
overlays = [ self.overlays.default ];
|
|
||||||
config.allowUnfree = true;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
hydraJobs = self.legacyPackages.x86_64-linux.bsc.hydraJobs;
|
hydraJobs = self.legacyPackages.${system}.bsc.hydraJobs;
|
||||||
|
|
||||||
# propagate nixpkgs lib, so we can do bscpkgs.lib
|
# propagate nixpkgs lib, so we can do bscpkgs.lib
|
||||||
lib = nixpkgs.lib // {
|
lib = nixpkgs.lib // {
|
||||||
|
|||||||
@@ -61,8 +61,6 @@
|
|||||||
registrationFlags = [
|
registrationFlags = [
|
||||||
# Increase build log length to 64 MiB
|
# Increase build log length to 64 MiB
|
||||||
"--output-limit 65536"
|
"--output-limit 65536"
|
||||||
# Allow the runner to be used in multiple projects
|
|
||||||
"--locked=false"
|
|
||||||
];
|
];
|
||||||
preBuildScript = pkgs.writeScript "setup-container" ''
|
preBuildScript = pkgs.writeScript "setup-container" ''
|
||||||
mkdir -p -m 0755 /nix/var/log/nix/drvs
|
mkdir -p -m 0755 /nix/var/log/nix/drvs
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
closing = pkgs.writeText "closing.txt"
|
closing = pkgs.writeText "closing.txt"
|
||||||
''
|
''
|
||||||
Subject: OmpSs-2 release enters closing period
|
Subject: OmpSs-2 release enters closing period
|
||||||
To: star@bsc.es
|
|
||||||
|
|
||||||
Hi,
|
Hi,
|
||||||
|
|
||||||
@@ -43,7 +42,6 @@
|
|||||||
freeze = pkgs.writeText "freeze.txt"
|
freeze = pkgs.writeText "freeze.txt"
|
||||||
''
|
''
|
||||||
Subject: OmpSs-2 release enters freeze period
|
Subject: OmpSs-2 release enters freeze period
|
||||||
To: star@bsc.es
|
|
||||||
|
|
||||||
Hi,
|
Hi,
|
||||||
|
|
||||||
@@ -57,7 +55,6 @@
|
|||||||
release = pkgs.writeText "release.txt"
|
release = pkgs.writeText "release.txt"
|
||||||
''
|
''
|
||||||
Subject: OmpSs-2 release now
|
Subject: OmpSs-2 release now
|
||||||
To: star@bsc.es
|
|
||||||
|
|
||||||
Hi,
|
Hi,
|
||||||
|
|
||||||
@@ -72,7 +69,7 @@
|
|||||||
script = ''
|
script = ''
|
||||||
set -eu
|
set -eu
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
cat ${mail} | ${config.security.wrapperDir}/sendmail -t star@bsc.es
|
cat ${mail} | ${config.security.wrapperDir}/sendmail star@bsc.es
|
||||||
'';
|
'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ in
|
|||||||
};
|
};
|
||||||
log.LEVEL = "Warn";
|
log.LEVEL = "Warn";
|
||||||
|
|
||||||
|
actions.DEFAULT_ACTIONS_URL = "self";
|
||||||
|
|
||||||
mailer = {
|
mailer = {
|
||||||
ENABLED = true;
|
ENABLED = true;
|
||||||
FROM = "jungle-robot@bsc.es";
|
FROM = "jungle-robot@bsc.es";
|
||||||
|
|||||||
10
overlay.nix
10
overlay.nix
@@ -61,16 +61,6 @@ let
|
|||||||
tagaspi = callPackage ./pkgs/tagaspi/default.nix { };
|
tagaspi = callPackage ./pkgs/tagaspi/default.nix { };
|
||||||
tampi = callPackage ./pkgs/tampi/default.nix { };
|
tampi = callPackage ./pkgs/tampi/default.nix { };
|
||||||
upc-qaire-exporter = prev.callPackage ./pkgs/upc-qaire-exporter/default.nix { };
|
upc-qaire-exporter = prev.callPackage ./pkgs/upc-qaire-exporter/default.nix { };
|
||||||
upx = prev.upx.overrideAttrs {
|
|
||||||
version = "5.1.0";
|
|
||||||
src = final.fetchFromGitHub {
|
|
||||||
owner = "upx";
|
|
||||||
repo = "upx";
|
|
||||||
tag = "v5.1.0";
|
|
||||||
fetchSubmodules = true;
|
|
||||||
hash = "sha256-FQtDHsbZ/JrgRLwc2Wd2F5ZcBdqrU0YIT9hGQ0k0D+w=";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
wxparaver = callPackage ./pkgs/paraver/default.nix { };
|
wxparaver = callPackage ./pkgs/paraver/default.nix { };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
, lib
|
, lib
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, cmake
|
, cmake
|
||||||
, ninja
|
|
||||||
, bash
|
, bash
|
||||||
, python3
|
, python3
|
||||||
, perl
|
, perl
|
||||||
@@ -63,7 +62,6 @@ in stdenv.mkDerivation {
|
|||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
bash
|
bash
|
||||||
cmake
|
cmake
|
||||||
ninja
|
|
||||||
elfutils
|
elfutils
|
||||||
llvmPackages_latest.lld
|
llvmPackages_latest.lld
|
||||||
pkg-config
|
pkg-config
|
||||||
|
|||||||
@@ -19,16 +19,6 @@ with builtins;
|
|||||||
compression ? "zstd -19 -T0",
|
compression ? "zstd -19 -T0",
|
||||||
lib ? pkgs.lib,
|
lib ? pkgs.lib,
|
||||||
pkgs ? import <nixpkgs> {},
|
pkgs ? import <nixpkgs> {},
|
||||||
|
|
||||||
# pkgs set from the host system (just for eval in installDynamic)
|
|
||||||
pkgsHost ?
|
|
||||||
if stdenv.hostPlatform == stdenv.buildPlatform then
|
|
||||||
pkgs
|
|
||||||
else
|
|
||||||
import pkgs.path {
|
|
||||||
system = pkgs.stdenv.hostPlatform.system;
|
|
||||||
},
|
|
||||||
|
|
||||||
# hardcode executable to run. Useful when creating a bundle.
|
# hardcode executable to run. Useful when creating a bundle.
|
||||||
bundledPackage ? null,
|
bundledPackage ? null,
|
||||||
|
|
||||||
@@ -59,7 +49,7 @@ let
|
|||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "nix-portable-store-tarball";
|
name = "nix-portable-store-tarball";
|
||||||
nativeBuildInputs = [ perl pkgs.zstd ];
|
nativeBuildInputs = [ perl zstd ];
|
||||||
exportReferencesGraph = map (x: [("closure-" + baseNameOf x) x]) targets;
|
exportReferencesGraph = map (x: [("closure-" + baseNameOf x) x]) targets;
|
||||||
buildCommand = ''
|
buildCommand = ''
|
||||||
storePaths=$(cat ${closureInfo}/store-paths)
|
storePaths=$(cat ${closureInfo}/store-paths)
|
||||||
@@ -96,9 +86,9 @@ let
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
installDynamic = pkgname: let
|
installDynamic = pkgname: let
|
||||||
out = builtins.unsafeDiscardStringContext pkgsHost.${pkgname}.out.outPath;
|
out = pkgs.${pkgname}.out;
|
||||||
in ''
|
in ''
|
||||||
if [ ! -e \$store${lib.removePrefix "/nix/store" out} ] ; then
|
if [ ! -e \$store${lib.removePrefix "/nix/store" pkgs.${pkgname}.out} ] ; then
|
||||||
debug "Installing ${pkgname}"
|
debug "Installing ${pkgname}"
|
||||||
\$run \$store${lib.removePrefix "/nix/store" nix}/bin/nix build --impure --no-link --expr "
|
\$run \$store${lib.removePrefix "/nix/store" nix}/bin/nix build --impure --no-link --expr "
|
||||||
(import ${nixpkgsSrc} {}).${pkgname}.out
|
(import ${nixpkgsSrc} {}).${pkgname}.out
|
||||||
@@ -110,9 +100,7 @@ let
|
|||||||
export PATH="${out}/bin:\$PATH"
|
export PATH="${out}/bin:\$PATH"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
caBundleZstd = pkgs.runCommand "cacerts" {
|
caBundleZstd = pkgs.runCommand "cacerts" {} "cat ${cacert}/etc/ssl/certs/ca-bundle.crt | ${zstd}/bin/zstd -19 > $out";
|
||||||
nativeBuildInputs = [ pkgs.zstd ];
|
|
||||||
} "cat ${cacert}/etc/ssl/certs/ca-bundle.crt | zstd -19 > $out";
|
|
||||||
|
|
||||||
bwrap = packStaticBin "${bwrapStatic}/bin/bwrap";
|
bwrap = packStaticBin "${bwrapStatic}/bin/bwrap";
|
||||||
nixStatic = packStaticBin "${inp.nixStatic}/bin/nix";
|
nixStatic = packStaticBin "${inp.nixStatic}/bin/nix";
|
||||||
@@ -264,7 +252,7 @@ let
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Override $SHELL with nix bashInteractive
|
# Override $SHELL with nix bashInteractive
|
||||||
export SHELL="${builtins.unsafeDiscardStringContext pkgsHost.bashInteractive.out.outPath}/bin/bash"
|
export SHELL="${pkgs.bashInteractive.out}/bin/bash"
|
||||||
export PS1="\n\[\033[1;32m\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\$\[\033[0m\] "
|
export PS1="\n\[\033[1;32m\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\$\[\033[0m\] "
|
||||||
|
|
||||||
# unset bash function aliases
|
# unset bash function aliases
|
||||||
@@ -309,7 +297,7 @@ let
|
|||||||
|
|
||||||
|
|
||||||
collectBinds(){
|
collectBinds(){
|
||||||
pathsTopLevel="/boot /run /sys \$PWD /gpfs /tmp /scratch /home"
|
pathsTopLevel="/boot /run /sys \$PWD /gpfs /tmp /scratch"
|
||||||
|
|
||||||
toBind=""
|
toBind=""
|
||||||
for p in \$pathsTopLevel; do
|
for p in \$pathsTopLevel; do
|
||||||
@@ -603,7 +591,7 @@ let
|
|||||||
runtimeScriptEscaped = replaceStrings ["\""] ["\\\""] runtimeScript;
|
runtimeScriptEscaped = replaceStrings ["\""] ["\\\""] runtimeScript;
|
||||||
|
|
||||||
nixPortable = pkgs.runCommand pname {
|
nixPortable = pkgs.runCommand pname {
|
||||||
nativeBuildInputs = [unixtools.xxd unzip pkgs.zip];
|
nativeBuildInputs = [unixtools.xxd unzip];
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "https://github.com/DavHau/nix-portable";
|
homepage = "https://github.com/DavHau/nix-portable";
|
||||||
@@ -631,7 +619,7 @@ let
|
|||||||
|
|
||||||
unzip -vl $out/bin/nix-portable.zip
|
unzip -vl $out/bin/nix-portable.zip
|
||||||
|
|
||||||
zip="zip -0"
|
zip="${zip}/bin/zip -0"
|
||||||
$zip $out/bin/nix-portable.zip ${bwrap}/bin/bwrap
|
$zip $out/bin/nix-portable.zip ${bwrap}/bin/bwrap
|
||||||
$zip $out/bin/nix-portable.zip ${nixStatic}/bin/nix
|
$zip $out/bin/nix-portable.zip ${nixStatic}/bin/nix
|
||||||
$zip $out/bin/nix-portable.zip ${zstd}/bin/zstd
|
$zip $out/bin/nix-portable.zip ${zstd}/bin/zstd
|
||||||
@@ -642,7 +630,7 @@ let
|
|||||||
fp=$(sha256sum $out/bin/nix-portable.zip | cut -d " " -f 1)
|
fp=$(sha256sum $out/bin/nix-portable.zip | cut -d " " -f 1)
|
||||||
sed -i "s/_FINGERPRINT_PLACEHOLDER_/$fp/g" $out/bin/nix-portable.zip
|
sed -i "s/_FINGERPRINT_PLACEHOLDER_/$fp/g" $out/bin/nix-portable.zip
|
||||||
# fix broken zip header due to manual modification
|
# fix broken zip header due to manual modification
|
||||||
zip -F $out/bin/nix-portable.zip --out $out/bin/nix-portable-fixed.zip
|
${zip}/bin/zip -F $out/bin/nix-portable.zip --out $out/bin/nix-portable-fixed.zip
|
||||||
|
|
||||||
rm $out/bin/nix-portable.zip
|
rm $out/bin/nix-portable.zip
|
||||||
executable=${if bundledPackage == null then "" else bundledExe}
|
executable=${if bundledPackage == null then "" else bundledExe}
|
||||||
|
|||||||
Reference in New Issue
Block a user