chore: update rensa and use improved input handling

This commit is contained in:
technofab 2025-08-20 09:03:18 +02:00
parent fbacfc149b
commit e76bef387e
No known key found for this signature in database
7 changed files with 70 additions and 33 deletions

1
.envrc
View file

@ -1,3 +1,2 @@
source $(fetchurl https://gitlab.com/rensa-nix/direnv/-/raw/v0.2.0/direnvrc "sha256-PFFxlZWNz/LLuNHA1Zpu2qdC3MF+oukv/TxFj5Utixk=") source $(fetchurl https://gitlab.com/rensa-nix/direnv/-/raw/v0.2.0/direnvrc "sha256-PFFxlZWNz/LLuNHA1Zpu2qdC3MF+oukv/TxFj5Utixk=")
REN_FLAKE_ATTR=__std
use ren //repo/devShells/default use ren //repo/devShells/default

View file

@ -1,10 +1,9 @@
{ {inputs, ...}: let
inputs, inherit (inputs) pkgs;
cell, in {
}: { bench = pkgs.writeShellApplication {
bench = inputs.nixpkgs.writeShellApplication {
name = "benchmark"; name = "benchmark";
runtimeInputs = [inputs.nixpkgs.hyperfine]; runtimeInputs = [pkgs.hyperfine];
text = '' text = ''
echo "Comparison cases first:" echo "Comparison cases first:"
hyperfine -w 3 \ hyperfine -w 3 \

View file

@ -1,13 +1,10 @@
{ {inputs, ...}: let
inputs, inherit (inputs) pkgs devshell;
cell,
}: let
devshell = import "${inputs.self}/lib" {
pkgs = inputs.nixpkgs;
};
in { in {
default = devshell.mkShell { default = devshell.mkShell {
packages = [inputs.nixpkgs.alejandra]; packages = [
pkgs.alejandra
];
env."HELLO".value = "world!"; env."HELLO".value = "world!";
enterShellCommands.test = { enterShellCommands.test = {
text = "echo Hello $HELLO"; text = "echo Hello $HELLO";

View file

@ -2,5 +2,10 @@
inputs = { inputs = {
nixtest-lib.url = "gitlab:TECHNOFAB/nixtest?dir=lib"; nixtest-lib.url = "gitlab:TECHNOFAB/nixtest?dir=lib";
}; };
outputs = i: i; outputs = i:
i
// {
ntlib = i.nixtest-lib.lib {inherit (i.parent) pkgs;};
devshell = import "${i.parent.self}/lib" {inherit (i.parent) pkgs;};
};
} }

View file

@ -1,10 +1,5 @@
{ {inputs, ...}: let
inputs, inherit (inputs) pkgs ntlib devshell;
cell,
}: let
pkgs = inputs.nixpkgs;
ntlib = inputs.nixtest-lib.lib {inherit pkgs;};
devshell = import "${inputs.self}/lib" {inherit pkgs;};
in { in {
tests = ntlib.mkNixtest { tests = ntlib.mkNixtest {
modules = ntlib.autodiscover {dir = "${inputs.self}/tests";}; modules = ntlib.autodiscover {dir = "${inputs.self}/tests";};

42
flake.lock generated
View file

@ -60,11 +60,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1753694789, "lastModified": 1754498491,
"narHash": "sha256-cKgvtz6fKuK1Xr5LQW/zOUiAC0oSQoA9nOISB0pJZqM=", "narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "dc9637876d0dcc8c9e5e22986b857632effeb727", "rev": "c2ae88e026f9525daf89587f3cbee584b92b6134",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -74,6 +74,21 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib": {
"locked": {
"lastModified": 1754184128,
"narHash": "sha256-AjhoyBL4eSyXf01Bmc6DiuaMrJRNdWopmdnMY0Pa/M0=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "02e72200e6d56494f4a7c0da8118760736e41b60",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nosys": { "nosys": {
"locked": { "locked": {
"lastModified": 1668010795, "lastModified": 1668010795,
@ -117,9 +132,30 @@
"type": "github" "type": "github"
} }
}, },
"ren": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"dir": "lib",
"lastModified": 1755264589,
"narHash": "sha256-g8KjU4D/nxpMjCLQNP90VAAWUH89yvONRfChyhhzq4c=",
"owner": "rensa-nix",
"repo": "core",
"rev": "9f20f8c94b09a1c85356f8340ebe0a339b0d32e6",
"type": "gitlab"
},
"original": {
"dir": "lib",
"owner": "rensa-nix",
"repo": "core",
"type": "gitlab"
}
},
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"ren": "ren",
"std": "std" "std": "std"
} }
}, },

View file

@ -1,6 +1,7 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
ren.url = "gitlab:rensa-nix/core?dir=lib";
std = { std = {
url = "github:divnix/std"; url = "github:divnix/std";
inputs = { inputs = {
@ -15,20 +16,25 @@
outputs = { outputs = {
self, self,
std, ren,
... ...
} @ inputs: } @ inputs:
std.growOn ren.buildWith
{ {
inherit inputs; inherit inputs;
cellsFrom = ./.nix; cellsFrom = ./.nix;
cellBlocks = with std.blockTypes; [ transformInputs = system: i:
(devshells "devShells") i
(pkgs "tests") // {
(runnables "benchmark") pkgs = import i.nixpkgs {inherit system;};
};
cellBlocks = with ren.blocks; [
(simple "devShells")
(simple "tests")
(simple "benchmark")
]; ];
} }
{ {
packages = std.harvest self [["repo" "tests"] ["repo" "benchmark"]]; packages = ren.select self [["repo" "tests"] ["repo" "benchmark"]];
}; };
} }