nix-eval-jobs: integrate into lix build system and delete cruft

We don't want any of this github integration stuff since it won't do
anything, flakes don't support subdirs properly and maintaining a second
flake is pointless and annoying, and then the rest is lix formatting
standards hitting n-e-j.

Yeet!

Change-Id: Ibcd3b0182d90f727562a92c215b6061c16502554
This commit is contained in:
Jade Lovelace
2025-01-29 10:10:11 -08:00
committed by Jade Lovelace
parent 79aa6ce797
commit 80f814d2a1
13 changed files with 39 additions and 448 deletions
+9 -1
View File
@@ -197,6 +197,10 @@
lix-clang-tidy = final.callPackage ./subprojects/lix-clang-tidy { };
nix-eval-jobs = final.callPackage ./subprojects/nix-eval-jobs {
srcDir = ./subprojects/nix-eval-jobs;
};
# Export the patched version of boehmgc that Lix uses into the overlay
# for consumers of this flake.
boehmgc-nix = final.nix.passthru.boehmgc-nix;
@@ -246,6 +250,9 @@
# Perl bindings for various platforms.
perlBindings = forAllSystems (system: nixpkgsFor.${system}.native.nix.passthru.perl-bindings);
# nix-eval-jobs can be built against this Lix.
nix-eval-jobs = forAllSystems (system: nixpkgsFor.${system}.native.nix-eval-jobs);
# Binary tarball for various platforms, containing a Nix store
# with the closure of 'nix' package.
binaryTarball = forAllSystems (system: nixpkgsFor.${system}.native.nix.passthru.binaryTarball);
@@ -405,6 +412,7 @@
binaryTarball = self.hydraJobs.binaryTarball.${system};
perlBindings = self.hydraJobs.perlBindings.${system};
nix-eval-jobs = self.hydraJobs.nix-eval-jobs.${system};
nixpkgsLibTests = self.hydraJobs.tests.nixpkgsLibTests.${system};
rl-next = self.hydraJobs.rl-next.${system}.user;
# Will be empty attr set on i686-linux, and filtered out by forAvailableSystems.
@@ -422,7 +430,7 @@
inherit (nixpkgsFor.${system}.native) nix;
default = nix;
inherit (nixpkgsFor.${system}.native) lix-clang-tidy;
inherit (nixpkgsFor.${system}.native) lix-clang-tidy nix-eval-jobs;
}
// (
lib.optionalAttrs (builtins.elem system linux64BitSystems) {
-6
View File
@@ -1,6 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
@@ -1,66 +0,0 @@
name: Nix actions
on:
pull_request:
push:
branches:
- main
- staging
- release-*
jobs:
nix-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
- id: set-matrix
name: Generate Nix Matrix
run: |
set -Eeu
echo "matrix=$(nix eval --json '.#githubActions.matrix')" >> "$GITHUB_OUTPUT"
nix-build:
needs: nix-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
- run: nix build -L ".#${{ matrix.attr }}"
tests:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
# Nix Flakes doesn't work on shallow clones
fetch-depth: 0
- uses: cachix/install-nix-action@v25
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
extra_nix_config: |
accept-flake-config = true
- name: Build
run: nix develop -c bash -c 'meson setup -Db_sanitize=address,undefined build && ninja -C build'
- name: Run tests
run: nix develop -c pytest ./tests -m 'not infiniterecursion'
# address sanitizer will lead to out-of-memory in the infinite recursion case
- name: Build without sanitizer
run: nix develop -c bash -c 'rm -rf build && meson setup build && ninja -C build'
- name: Run tests
run: nix develop -c pytest ./tests -m 'infiniterecursion'
collect:
runs-on: ubuntu-latest
needs:
- nix-build
- tests
steps:
- run: "true"
-22
View File
@@ -1,22 +0,0 @@
name: "Publish a flake to flakestry"
on:
push:
tags:
- "v?[0-9]+.[0-9]+.[0-9]+"
- "v?[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
tag:
description: "The existing tag to publish"
type: "string"
required: true
jobs:
publish-flake:
runs-on: ubuntu-latest
permissions:
id-token: "write"
contents: "read"
steps:
- uses: flakestry/flakestry-publish@main
with:
version: "${{ inputs.tag || github.ref_name }}"
-18
View File
@@ -1,18 +0,0 @@
queue_rules:
- name: default
merge_conditions:
- check-success=collect
defaults:
actions:
queue:
allow_merging_configuration_change: true
method: rebase
pull_request_rules:
- name: merge using the merge queue
conditions:
- base=main
- label~=merge-queue|dependencies
actions:
queue: {}
+25 -17
View File
@@ -1,13 +1,15 @@
{ stdenv
, lib
, nix
, pkgs
, srcDir ? null
{
stdenv,
lib,
nix,
pkgs,
srcDir ? null,
}:
let
filterMesonBuild = builtins.filterSource
(path: type: type != "directory" || baseNameOf path != "build");
filterMesonBuild = builtins.filterSource (
path: type: type != "directory" || baseNameOf path != "build"
);
in
stdenv.mkDerivation {
pname = "nix-eval-jobs";
@@ -18,21 +20,27 @@ stdenv.mkDerivation {
nix
boost
];
nativeBuildInputs = with pkgs; [
meson
pkg-config
ninja
# nlohmann_json can be only discovered via cmake files
cmake
# XXX: ew
nix.passthru.capnproto-lix
] ++ (lib.optional stdenv.cc.isClang [ pkgs.clang-tools ]);
nativeBuildInputs =
with pkgs;
[
meson
pkg-config
ninja
# nlohmann_json can be only discovered via cmake files
cmake
# XXX: ew
nix.passthru.capnproto-lix
]
++ (lib.optional stdenv.cc.isClang [ pkgs.clang-tools ]);
meta = {
description = "Hydra's builtin hydra-eval-jobs as a standalone";
homepage = "https://github.com/nix-community/nix-eval-jobs";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [ adisbladis mic92 ];
maintainers = with lib.maintainers; [
adisbladis
mic92
];
platforms = lib.platforms.unix;
};
}
-44
View File
@@ -1,44 +0,0 @@
{ pkgs, ... }: {
# Used to find the project root
projectRootFile = "flake.lock";
programs.deno.enable = true;
programs.clang-format.enable = true;
settings.formatter = {
nix = {
command = "sh";
options = [
"-eucx"
''
${pkgs.deadnix}/bin/deadnix --edit "$@"
for i in "$@"; do
${pkgs.statix}/bin/statix fix "$i"
done
${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt "$@"
''
"--"
];
includes = [ "*.nix" ];
excludes = [ ];
};
clang-format = { };
python = {
command = "sh";
options = [
"-eucx"
''
${pkgs.python3.pkgs.black}/bin/black "$@"
${pkgs.ruff}/bin/ruff --fix "$@"
''
"--" # this argument is ignored by bash
];
includes = [ "*.py" ];
};
};
}
-177
View File
@@ -1,177 +0,0 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1730504689,
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "506278e768c2a08bec68eb62932193e341f55c90",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"lix": {
"inputs": {
"flake-compat": "flake-compat",
"nix2container": "nix2container",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-regression": "nixpkgs-regression",
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1737857294,
"narHash": "sha256-bzC+anLF/NlgolaMoB4uTFgSejLJlTzPcNF1Kbq/BP0=",
"rev": "4af6b5ed9f8f2412bef5331b8e3b93f3ad305ea1",
"type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/4af6b5ed9f8f2412bef5331b8e3b93f3ad305ea1.tar.gz?rev=4af6b5ed9f8f2412bef5331b8e3b93f3ad305ea1"
},
"original": {
"type": "tarball",
"url": "https://git.lix.systems/lix-project/lix/archive/main.tar.gz"
}
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1731952509,
"narHash": "sha256-p4gB3Rhw8R6Ak4eMl8pqjCPOLCZRqaehZxdZ/mbFClM=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "7b5f051df789b6b20d259924d349a9ba3319b226",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nix2container": {
"flake": false,
"locked": {
"lastModified": 1724996935,
"narHash": "sha256-njRK9vvZ1JJsP8oV2OgkBrpJhgQezI03S7gzskCcHos=",
"owner": "nlewo",
"repo": "nix2container",
"rev": "fa6bb0a1159f55d071ba99331355955ae30b3401",
"type": "github"
},
"original": {
"owner": "nlewo",
"repo": "nix2container",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1737672001,
"narHash": "sha256-YnHJJ19wqmibLQdUeq9xzE6CjrMA568KN/lFPuSVs4I=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "035f8c0853c2977b24ffc4d0a42c74f00b182cd8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.11-small",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-regression": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"pre-commit-hooks": {
"flake": false,
"locked": {
"lastModified": 1733318908,
"narHash": "sha256-SVQVsbafSM1dJ4fpgyBqLZ+Lft+jcQuMtEL3lQWx2Sk=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "6f4e2a2112050951a314d2733a994fbab94864c6",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"lix": "lix",
"nix-github-actions": "nix-github-actions",
"nixpkgs": "nixpkgs",
"treefmt-nix": "treefmt-nix"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1732292307,
"narHash": "sha256-5WSng844vXt8uytT5djmqBCkopyle6ciFgteuA9bJpw=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "705df92694af7093dfbb27109ce16d828a79155f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
-52
View File
@@ -1,52 +0,0 @@
{
description = "Hydra's builtin hydra-eval-jobs as a standalone";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11-small";
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
inputs.flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
inputs.treefmt-nix.url = "github:numtide/treefmt-nix";
inputs.treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
inputs.nix-github-actions.url = "github:nix-community/nix-github-actions";
inputs.nix-github-actions.inputs.nixpkgs.follows = "nixpkgs";
inputs.lix = {
url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ { flake-parts, ... }:
let
inherit (inputs.nixpkgs) lib;
inherit (inputs) self;
in
flake-parts.lib.mkFlake { inherit inputs; }
{
systems = inputs.nixpkgs.lib.systems.flakeExposed;
imports = [ inputs.treefmt-nix.flakeModule ];
flake.githubActions = inputs.nix-github-actions.lib.mkGithubMatrix {
checks = {
inherit (self.checks) x86_64-linux;
x86_64-darwin = builtins.removeAttrs self.checks.x86_64-darwin [ "treefmt" ];
};
};
perSystem = { pkgs, self', inputs', ... }:
let
drvArgs = {
srcDir = self;
nix = inputs'.lix.packages.default;
};
in
{
treefmt.imports = [ ./dev/treefmt.nix ];
packages.nix-eval-jobs = pkgs.callPackage ./default.nix drvArgs;
packages.clangStdenv-nix-eval-jobs = pkgs.callPackage ./default.nix (drvArgs // { stdenv = pkgs.clangStdenv; });
packages.default = self'.packages.nix-eval-jobs;
devShells.default = pkgs.callPackage ./shell.nix drvArgs;
checks = builtins.removeAttrs self'.packages [ "default" ] // {
shell = self'.devShells.default;
};
};
};
}
-42
View File
@@ -1,42 +0,0 @@
{ pkgs ? (
let
inherit (builtins) fromJSON readFile;
flakeLock = fromJSON (readFile ./flake.lock);
inherit (flakeLock.nodes.nixpkgs) locked;
nixpkgs = assert locked.type == "github"; builtins.fetchTarball {
url = "https://github.com/${locked.owner}/${locked.repo}/archive/${locked.rev}.tar.gz";
sha256 = locked.narHash;
};
in
import nixpkgs { }
)
, srcDir ? null
, nix
}:
let
inherit (pkgs) lib stdenv;
nix-eval-jobs = pkgs.callPackage ./default.nix {
inherit srcDir nix;
};
in
pkgs.mkShell {
inherit (nix-eval-jobs) buildInputs;
nativeBuildInputs = nix-eval-jobs.nativeBuildInputs ++ [
pkgs.clang-tools
(pkgs.python3.withPackages (ps: [
ps.pytest
]))
] ++ lib.optional stdenv.isLinux # broken on darwin
(pkgs.writeShellScriptBin "update-include-what-you-use" ''
#!${pkgs.stdenv.shell}
export PATH=${pkgs.include-what-you-use}/bin:$PATH
find src -type f -name '*.cpp' -o -name '*.hh' -print0 | \
xargs -n1 --null include-what-you-use -std=c++20 -isystem ${lib.getDev nix}/include/nix 2>&1 | \
fix_includes.py
'');
shellHook = lib.optionalString stdenv.isLinux ''
export NIX_DEBUG_INFO_DIRS="${pkgs.curl.debug}/lib/debug:${nix.debug}/lib/debug''${NIX_DEBUG_INFO_DIRS:+:$NIX_DEBUG_INFO_DIRS}"
'';
}
@@ -1,5 +1,6 @@
{ pkgs ? import (builtins.getFlake (toString ./.)).inputs.nixpkgs { }
, system ? pkgs.system
{
pkgs ? import (builtins.getFlake (toString ./.)).inputs.nixpkgs { },
system ? pkgs.system,
}:
{
@@ -1,7 +1,8 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { nixpkgs, ... }:
outputs =
{ nixpkgs, ... }:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in
View File