Compare commits

..

31 Commits

Author SHA1 Message Date
7a6e4232de Add nom and nixfmt-tree to system packages
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-02-03 15:17:30 +01:00
3b56e905e5 Add standalone home-manager to system packages
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-02-03 15:17:29 +01:00
2d41309466 Format and sort default package list
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-02-03 15:17:24 +01:00
deb0cd1488 Allow USB access to TC1 from Gitlab Runner
Reviewed-by: Aleix Boné <abonerib@bsc.es>
2026-01-23 17:56:16 +01:00
cd1f502ecc Allow user USB access to FTDI device in tent
Reviewed-by: Aleix Boné <abonerib@bsc.es>
2026-01-23 17:56:11 +01:00
dda6a66782 Fix gitea user to allow sending email
In order to send email, the gitea user needs to be in the mail-robot
group.

Fixes: rarias/jungle#220
Reviewed-by: Aleix Boné <abonerib@bsc.es>
2026-01-20 12:18:52 +01:00
22420e6ac8 Remove unneeded perf package from eudy
It is already included in the base list of packages, which is now only
"perf" and doesn't depend on the kernel version.

Reviewed-by: Aleix Boné <abonerib@bsc.es>
2026-01-20 12:18:49 +01:00
a71cd78b4c Fix infiniband interface names
Reviewed-by: Aleix Boné <abonerib@bsc.es>
2026-01-20 12:18:46 +01:00
e84a2cadbb flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/8bb5646e0bed5dbd3ab08c7a7cc15b75ab4e1d0f?narHash=sha256-SqUuBFjhl/kpDiVaKLQBoD8TLD%2B/cTUzzgVFoaHrkqY%3D' (2025-11-30)
  → 'github:NixOS/nixpkgs/3c9db02515ef1d9b6b709fc60ba9a540957f661c?narHash=sha256-2GffSfQxe3sedHzK%2BsTKlYo/NTIAGzbFCIsNMUPAAnk%3D' (2026-01-05)

Reviewed-by: Aleix Boné <abonerib@bsc.es>
2026-01-20 12:18:41 +01:00
d3e43eb651 Remove conflicting definitions in amd-uprof-driver
See: https://lkml.org/lkml/2025/4/9/1709

Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-01-20 12:15:18 +01:00
a491546ffb Mark mcxx as broken and remove from package list
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-01-20 12:15:14 +01:00
933c78a80b Fix moved package linuxPackages.perf is now perf
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-01-20 12:15:10 +01:00
150969be9b Fix replaced nixseparatedebuginfod
nixseparatedebuginfod has been replaced by nixseparatedebuginfod2

Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-01-20 12:15:06 +01:00
9097729759 Use standard gcc for intel packages
This reverts 26f52aa27d

Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-01-20 12:15:02 +01:00
779449f1db Fix renamed option watchdog.runtimeTime
The option 'systemd.watchdog.runtimeTime' has been renamed to
'systemd.settings.Manager.RuntimeWatchdogSec'.

Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-01-20 12:14:59 +01:00
6cbe33bd80 Replace wrapGAppsHook with wrapGAppsHook3
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-01-20 12:14:56 +01:00
3f1f5ae8f2 Fix changed cudaPackages.cuda_cudart output
See: https://github.com/NixOS/nixpkgs/pull/437723
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-01-20 12:14:49 +01:00
fe8586e780 Set pyproject=true in buildPythonApplication
The buildPythonPackage and buildPythonApplication functions now
  require an explicit format attribute. Previously the default format
  used setuptools and called setup.py from the source tree, which is
  deprecated. The modern alternative is to configure pyproject = true
  with build-system = [ setuptools ].

Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-01-20 12:14:31 +01:00
8677adba27 Fix renamed llvm bintools
Moved from llvmPackages_latest.tools.bintools to
llvmPackages_latest.bintools

Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-01-20 12:14:27 +01:00
f614149edf Upgrade nixpkgs to 25.11
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-01-20 12:14:11 +01:00
859eebda98 Change varcila shell to zsh
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-01-07 13:22:17 +01:00
c2a201b085 Increase fail2ban ban time on each attempt
Reviewed-by: Aleix Boné <abonerib@bsc.es>
2026-01-07 13:14:34 +01:00
f921f0a4bd Disable password login via SSH in apex
Reviewed-by: Aleix Boné <abonerib@bsc.es>
2026-01-07 13:14:30 +01:00
aa16bfc0bc Enable fail2ban in apex login node
We are seeing a lot of failed attempts from the same IPs:

    apex% sudo journalctl -u sshd -b0 | grep 'Failed password' | wc -l
    2441

Reviewed-by: Aleix Boné <abonerib@bsc.es>
2026-01-07 13:14:22 +01:00
a173af654f Fix osu cross-compilation
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2025-10-31 16:23:46 +01:00
2fff7e4a7b Set mpich default compilers from targetPackages
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2025-10-31 16:23:46 +01:00
a761b73336 Enable meta.cross for mpich related packages
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2025-10-31 16:23:46 +01:00
86eb796771 Disable meta.cross for gpi-2 and tagaspi
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2025-10-31 16:23:46 +01:00
08633435cf Fix nativeBuildInputs for tagaspi
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2025-10-31 16:23:46 +01:00
39d64456a4 Fix nativeBuildInputs for gpi-2
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2025-10-31 16:23:46 +01:00
410040a4a0 Fix mpich cross compilation (disable fortran)
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2025-10-31 16:23:46 +01:00
32 changed files with 180 additions and 51 deletions

8
flake.lock generated
View File

@@ -2,16 +2,16 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1752436162,
"narHash": "sha256-Kt1UIPi7kZqkSc5HVj6UY5YLHHEzPBkgpNUByuyxtlw=",
"lastModified": 1767634882,
"narHash": "sha256-2GffSfQxe3sedHzK+sTKlYo/NTIAGzbFCIsNMUPAAnk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dfcd5b901dbab46c9c6e80b265648481aafb01f8",
"rev": "3c9db02515ef1d9b6b709fc60ba9a540957f661c",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}

View File

@@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
};
outputs = { self, nixpkgs, ... }:

View File

@@ -57,6 +57,18 @@
};
};
services.fail2ban = {
enable = true;
maxretry = 5;
bantime-increment = {
enable = true; # Double ban time on each attack
maxtime = "7d"; # Ban up to a week
};
};
# Disable SSH login with password, allow only keypair
services.openssh.settings.PasswordAuthentication = false;
networking.firewall = {
extraCommands = ''
# Blackhole BSC vulnerability scanner (OpenVAS) as it is spamming our

View File

@@ -24,7 +24,7 @@
address = "10.0.40.40";
prefixLength = 24;
} ];
interfaces.ibp5s0.ipv4.addresses = [ {
interfaces.ibs785.ipv4.addresses = [ {
address = "10.0.42.40";
prefixLength = 24;
} ];

View File

@@ -1,12 +1,37 @@
{ pkgs, config, ... }:
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
vim wget git htop tmux pciutils tcpdump ripgrep nix-index nixos-option
nix-diff ipmitool freeipmi ethtool lm_sensors cmake gnumake file tree
ncdu config.boot.kernelPackages.perf ldns pv
cmake
ethtool
file
freeipmi
git
gnumake
home-manager
htop
ipmitool
ldns
lm_sensors
ncdu
nix-diff
nix-index
nix-output-monitor
nixfmt-tree
nixos-option
pciutils
perf
pv
ripgrep
tcpdump
tmux
tree
vim
wget
# From jungle overlay
osumb nixgen
nixgen
osumb
];
programs.direnv.enable = true;

View File

@@ -139,6 +139,7 @@
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKGt0ESYxekBiHJQowmKpfdouw0hVm3N7tUMtAaeLejK vincent@varch"
];
shell = pkgs.zsh;
};
pmartin1 = {

View File

@@ -5,5 +5,5 @@
boot.kernelModules = [ "ipmi_watchdog" ];
# Enable systemd watchdog with 30 s interval
systemd.watchdog.runtimeTime = "30s";
systemd.settings.Manager.RuntimeWatchdogSec = 30;
}

View File

@@ -1,11 +1,6 @@
{ config, pkgs, lib, ... }:
{ pkgs, lib, ... }:
{
# add the perf tool
environment.systemPackages = with pkgs; [
config.boot.kernelPackages.perf
];
# allow non-root users to read tracing data from the kernel
boot.kernel.sysctl."kernel.perf_event_paranoid" = -2;
boot.kernel.sysctl."kernel.kptr_restrict" = 0;

View File

@@ -45,7 +45,7 @@
address = "10.0.40.7";
prefixLength = 24;
} ];
interfaces.ibp5s0.ipv4.addresses = [ {
interfaces.ibs785.ipv4.addresses = [ {
address = "10.0.42.7";
prefixLength = 24;
} ];

View File

@@ -46,7 +46,7 @@
address = "10.0.40.42";
prefixLength = 24;
} ];
interfaces.ibp5s0.ipv4.addresses = [ {
interfaces.ibs785.ipv4.addresses = [ {
address = "10.0.42.42";
prefixLength = 24;
} ];

View File

@@ -1,3 +1,10 @@
{
services.nixseparatedebuginfod.enable = true;
services.nixseparatedebuginfod2 = {
enable = true;
substituters = [
"local:"
"https://cache.nixos.org"
"http://hut/cache"
];
};
}

27
m/module/tc1-board.nix Normal file
View File

@@ -0,0 +1,27 @@
{ lib, pkgs, ... }:
{
# Allow user access to FTDI USB device
services.udev.packages = lib.singleton (pkgs.writeTextFile {
# Needs to be < 73
name = "60-ftdi-tc1.rules";
text = ''
# Bus 003 Device 003: ID 0403:6011 Future Technology Devices International, Ltd FT4232H Quad HS USB-UART/FIFO IC
# Use := to make sure it doesn't get changed later
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", MODE:="0666"
'';
destination = "/etc/udev/rules.d/60-ftdi-tc1.rules";
});
# Allow access to USB for docker in GitLab runner
services.gitlab-runner = {
services.gitlab-bsc-docker = {
registrationFlags = [
# We need raw access to the USB port to reboot the board
"--docker-devices /dev/bus/usb/003/003"
# And TTY access for the serial port
"--docker-devices /dev/ttyUSB2"
];
};
};
}

View File

@@ -20,7 +20,7 @@
address = "10.0.40.1";
prefixLength = 24;
} ];
interfaces.ibp5s0.ipv4.addresses = [ {
interfaces.ibs785.ipv4.addresses = [ {
address = "10.0.42.1";
prefixLength = 24;
} ];

View File

@@ -21,7 +21,7 @@
prefixLength = 24;
} ];
# Watch out! The OmniPath device is not in the same place here:
interfaces.ibp129s0.ipv4.addresses = [ {
interfaces.ibs801.ipv4.addresses = [ {
address = "10.0.42.2";
prefixLength = 24;
} ];

View File

@@ -16,6 +16,7 @@
../module/p.nix
../module/vpn-dac.nix
../module/hut-substituter.nix
../module/tc1-board.nix
];
# Select the this using the ID to avoid mismatches

View File

@@ -27,4 +27,7 @@
};
};
};
# Allow gitea user to send mail
users.users.gitea.extraGroups = [ "mail-robot" ];
}

View File

@@ -30,7 +30,8 @@ let
amd-uprof-driver = _prev.callPackage ./pkgs/amd-uprof/driver.nix { };
});
lmbench = callPackage ./pkgs/lmbench/default.nix { };
mcxx = callPackage ./pkgs/mcxx/default.nix { };
# Broken and unmantained
# mcxx = callPackage ./pkgs/mcxx/default.nix { };
meteocat-exporter = prev.callPackage ./pkgs/meteocat-exporter/default.nix { };
mpi = final.mpich; # Set MPICH as default
mpich = callPackage ./pkgs/mpich/default.nix { mpich = prev.mpich; };

View File

@@ -19,7 +19,7 @@ in stdenv.mkDerivation {
'';
hardeningDisable = [ "pic" "format" ];
nativeBuildInputs = kernel.moduleBuildDependencies;
patches = [ ./makefile.patch ./hrtimer.patch ];
patches = [ ./makefile.patch ./hrtimer.patch ./remove-wr-rdmsrq.patch ];
makeFlags = [
"KERNEL_VERSION=${kernel.modDirVersion}"
"KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"

View File

@@ -0,0 +1,20 @@
diff --git a/inc/PwrProfAsm.h b/inc/PwrProfAsm.h
index d77770a..c93a0e9 100644
--- a/inc/PwrProfAsm.h
+++ b/inc/PwrProfAsm.h
@@ -347,6 +347,7 @@
#endif
+/*
#define rdmsrq(msr,val1,val2,val3,val4) ({ \
__asm__ __volatile__( \
"rdmsr\n" \
@@ -362,6 +363,7 @@
:"c"(msr), "a"(val1), "d"(val2), "S"(val3), "D"(val4) \
); \
})
+*/
#define rdmsrpw(msr,val1,val2,val3,val4) ({ \
__asm__ __volatile__( \

View File

@@ -12,7 +12,7 @@ stdenv.mkDerivation (finalAttrs: {
src = ./.;
buildInputs = [
cudatoolkit # Required for nvcc
cudaPackages.cuda_cudart.static # Required for -lcudart_static
(lib.getOutput "static" cudaPackages.cuda_cudart) # Required for -lcudart_static
autoAddDriverRunpath
];
installPhase = ''

View File

@@ -9,7 +9,6 @@
, automake
, libtool
, mpi
, rsync
, gfortran
}:
@@ -44,13 +43,24 @@ stdenv.mkDerivation rec {
configureFlags = [
"--with-infiniband=${rdma-core-all}"
"--with-mpi=${mpiAll}"
"--with-mpi=yes" # fixes mpi detection when cross-compiling
"--with-slurm"
"CFLAGS=-fPIC"
"CXXFLAGS=-fPIC"
];
buildInputs = [ slurm mpiAll rdma-core-all autoconf automake libtool rsync gfortran ];
nativeBuildInputs = [
autoconf
automake
gfortran
libtool
];
buildInputs = [
slurm
mpiAll
rdma-core-all
];
hardeningDisable = [ "all" ];
@@ -60,5 +70,6 @@ stdenv.mkDerivation rec {
maintainers = with lib.maintainers.bsc; [ rarias ];
platforms = lib.platforms.linux;
license = lib.licenses.gpl3Plus;
cross = false; # infiniband detection does not work
};
}

View File

@@ -10,7 +10,7 @@
, zlib
, autoPatchelfHook
, libfabric
, gcc13
, gcc
, wrapCCWith
}:
@@ -33,8 +33,6 @@ let
maintainers = with lib.maintainers.bsc; [ abonerib ];
};
gcc = gcc13;
v = {
hpckit = "2023.1.0";
compiler = "2023.1.0";

View File

@@ -27,10 +27,10 @@ let
# We need to replace the lld linker from bintools with our linker just built,
# otherwise we run into incompatibility issues when mixing compiler and linker
# versions.
bintools-unwrapped = llvmPackages_latest.tools.bintools-unwrapped.override {
bintools-unwrapped = llvmPackages_latest.bintools-unwrapped.override {
lld = clangOmpss2Unwrapped;
};
bintools = llvmPackages_latest.tools.bintools.override {
bintools = llvmPackages_latest.bintools.override {
bintools = bintools-unwrapped;
};
targetConfig = stdenv.targetPlatform.config;

View File

@@ -65,6 +65,7 @@ stdenv.mkDerivation rec {
];
meta = {
broken = true;
homepage = "https://github.com/bsc-pm/mcxx";
description = "C/C++/Fortran source-to-source compilation infrastructure aimed at fast prototyping";
maintainers = with lib.maintainers.bsc; [ rpenacob ];

View File

@@ -1,9 +1,11 @@
{ python3Packages, lib }:
python3Packages.buildPythonApplication rec {
python3Packages.buildPythonApplication {
pname = "meteocat-exporter";
version = "1.0";
pyproject = true;
src = ./.;
doCheck = false;

View File

@@ -6,6 +6,13 @@
, pmix
, gfortran
, symlinkJoin
# Disabled when cross-compiling
# To fix cross compilation, we should fill the values in:
# https://github.com/pmodels/mpich/blob/main/maint/fcrosscompile/cross_values.txt.in
# For each arch
, enableFortran ? stdenv.hostPlatform == stdenv.buildPlatform
, perl
, targetPackages
}:
let
@@ -15,10 +22,13 @@ let
paths = [ pmix.dev pmix.out ];
};
in mpich.overrideAttrs (old: {
buildInput = old.buildInputs ++ [
buildInputs = old.buildInputs ++ [
libfabric
pmixAll
];
nativeBuildInputs = old.nativeBuildInputs ++ [
perl
];
configureFlags = [
"--enable-shared"
"--enable-sharedlib"
@@ -31,10 +41,21 @@ in mpich.overrideAttrs (old: {
] ++ lib.optionals (lib.versionAtLeast gfortran.version "10") [
"FFLAGS=-fallow-argument-mismatch" # https://github.com/pmodels/mpich/issues/4300
"FCFLAGS=-fallow-argument-mismatch"
] ++ lib.optionals (!enableFortran) [
"--disable-fortran"
];
preFixup = ''
sed -i 's:^CC=.*:CC=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' $out/bin/mpicc
sed -i 's:^CXX=.*:CXX=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}c++:' $out/bin/mpicxx
'' + lib.optionalString enableFortran ''
sed -i 's:^FC=.*:FC=${targetPackages.gfortran or gfortran}/bin/${targetPackages.gfortran.targetPrefix or gfortran.targetPrefix}gfortran:' $out/bin/mpifort
'';
hardeningDisable = [ "all" ];
meta = old.meta // {
maintainers = old.meta.maintainers ++ (with lib.maintainers.bsc; [ rarias ]);
cross = true;
};
})

View File

@@ -32,6 +32,11 @@ stdenv.mkDerivation rec {
"CXX=mpicxx"
];
env = {
MPICH_CC="${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
MPICH_CXX="${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++";
};
postInstall = ''
mkdir -p $out/bin
for f in $(find $out -executable -type f); do
@@ -44,5 +49,6 @@ stdenv.mkDerivation rec {
homepage = "http://mvapich.cse.ohio-state.edu/benchmarks/";
maintainers = [ ];
platforms = lib.platforms.all;
cross = true;
};
}

View File

@@ -12,7 +12,7 @@
, paraverKernel
, openssl
, glibcLocales
, wrapGAppsHook
, wrapGAppsHook3
}:
let
@@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
autoconf
automake
autoreconfHook
wrapGAppsHook
wrapGAppsHook3
];
buildInputs = [

View File

@@ -35,5 +35,6 @@ stdenv.mkDerivation rec {
maintainers = with lib.maintainers.bsc; [ rarias ];
platforms = lib.platforms.linux;
license = lib.licenses.mit;
cross = true;
};
}

View File

@@ -5,23 +5,14 @@
, automake
, autoconf
, libtool
, mpi
, autoreconfHook
, gpi-2
, boost
, numactl
, rdma-core
, gfortran
, symlinkJoin
}:
let
mpiAll = symlinkJoin {
name = "mpi-all";
paths = [ mpi.all ];
};
in
stdenv.mkDerivation rec {
pname = "tagaspi";
enableParallelBuilding = true;
@@ -35,16 +26,18 @@ stdenv.mkDerivation rec {
hash = "sha256-RGG/Re2uM293HduZfGzKUWioDtwnSYYdfeG9pVrX9EM=";
};
buildInputs = [
nativeBuildInputs = [
autoreconfHook
automake
autoconf
libtool
gfortran
];
buildInputs = [
boost
numactl
rdma-core
gfortran
mpiAll
];
dontDisableStatic = true;
@@ -63,5 +56,6 @@ stdenv.mkDerivation rec {
maintainers = with lib.maintainers.bsc; [ rarias ];
platforms = lib.platforms.linux;
license = lib.licenses.gpl3Plus;
cross = false; # gpi-2 cannot cross
};
}

View File

@@ -68,5 +68,6 @@ in stdenv.mkDerivation {
maintainers = with lib.maintainers.bsc; [ rarias ];
platforms = lib.platforms.linux;
license = lib.licenses.gpl3Plus;
cross = true;
};
}

View File

@@ -1,9 +1,11 @@
{ python3Packages, lib }:
python3Packages.buildPythonApplication rec {
python3Packages.buildPythonApplication {
pname = "upc-qaire-exporter";
version = "1.0";
pyproject = true;
src = ./.;
doCheck = false;