diff --git a/.envrc b/.envrc index 7ae2fb3..a475a37 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1,2 @@ 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 diff --git a/.nix/repo/benchmark.nix b/.nix/repo/benchmark.nix index 3afb05b..b80e1d4 100644 --- a/.nix/repo/benchmark.nix +++ b/.nix/repo/benchmark.nix @@ -1,10 +1,9 @@ -{ - inputs, - cell, -}: { - bench = inputs.nixpkgs.writeShellApplication { +{inputs, ...}: let + inherit (inputs) pkgs; +in { + bench = pkgs.writeShellApplication { name = "benchmark"; - runtimeInputs = [inputs.nixpkgs.hyperfine]; + runtimeInputs = [pkgs.hyperfine]; text = '' echo "Comparison cases first:" hyperfine -w 3 \ diff --git a/.nix/repo/devShells.nix b/.nix/repo/devShells.nix index 2ceb786..e8ce627 100644 --- a/.nix/repo/devShells.nix +++ b/.nix/repo/devShells.nix @@ -1,13 +1,10 @@ -{ - inputs, - cell, -}: let - devshell = import "${inputs.self}/lib" { - pkgs = inputs.nixpkgs; - }; +{inputs, ...}: let + inherit (inputs) pkgs devshell; in { default = devshell.mkShell { - packages = [inputs.nixpkgs.alejandra]; + packages = [ + pkgs.alejandra + ]; env."HELLO".value = "world!"; enterShellCommands.test = { text = "echo Hello $HELLO"; diff --git a/.nix/repo/flake.nix b/.nix/repo/flake.nix index ff22c86..6e170ea 100644 --- a/.nix/repo/flake.nix +++ b/.nix/repo/flake.nix @@ -2,5 +2,10 @@ inputs = { 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;}; + }; } diff --git a/.nix/repo/tests.nix b/.nix/repo/tests.nix index e1b14b1..7d9bc36 100644 --- a/.nix/repo/tests.nix +++ b/.nix/repo/tests.nix @@ -1,10 +1,5 @@ -{ - inputs, - cell, -}: let - pkgs = inputs.nixpkgs; - ntlib = inputs.nixtest-lib.lib {inherit pkgs;}; - devshell = import "${inputs.self}/lib" {inherit pkgs;}; +{inputs, ...}: let + inherit (inputs) pkgs ntlib devshell; in { tests = ntlib.mkNixtest { modules = ntlib.autodiscover {dir = "${inputs.self}/tests";}; diff --git a/flake.lock b/flake.lock index 61c301a..54fbce9 100644 --- a/flake.lock +++ b/flake.lock @@ -60,11 +60,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1753694789, - "narHash": "sha256-cKgvtz6fKuK1Xr5LQW/zOUiAC0oSQoA9nOISB0pJZqM=", + "lastModified": 1754498491, + "narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "dc9637876d0dcc8c9e5e22986b857632effeb727", + "rev": "c2ae88e026f9525daf89587f3cbee584b92b6134", "type": "github" }, "original": { @@ -74,6 +74,21 @@ "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": { "locked": { "lastModified": 1668010795, @@ -117,9 +132,30 @@ "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": { "inputs": { "nixpkgs": "nixpkgs", + "ren": "ren", "std": "std" } }, diff --git a/flake.nix b/flake.nix index 2f9ed7c..b7361ad 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,7 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + ren.url = "gitlab:rensa-nix/core?dir=lib"; std = { url = "github:divnix/std"; inputs = { @@ -15,20 +16,25 @@ outputs = { self, - std, + ren, ... } @ inputs: - std.growOn + ren.buildWith { inherit inputs; cellsFrom = ./.nix; - cellBlocks = with std.blockTypes; [ - (devshells "devShells") - (pkgs "tests") - (runnables "benchmark") + transformInputs = system: i: + i + // { + 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"]]; }; }