mirror of
https://gitlab.com/rensa-nix/core.git
synced 2025-12-11 22:00:09 +01:00
feat: add devshell and improve input handling of cells
pass system to cells and their flake.nix inputs
This commit is contained in:
parent
2774f3ea91
commit
c9c329ec0f
9 changed files with 62 additions and 5 deletions
2
.envrc
Normal file
2
.envrc
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
source $(fetchurl https://gitlab.com/rensa-nix/direnv/-/raw/v0.2.0/direnvrc "sha256-PFFxlZWNz/LLuNHA1Zpu2qdC3MF+oukv/TxFj5Utixk=")
|
||||||
|
use ren //repo/devShells/default
|
||||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
result
|
||||||
|
.ren
|
||||||
7
cells/repo/devShells.nix
Normal file
7
cells/repo/devShells.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{inputs, ...}: let
|
||||||
|
inherit (inputs) pkgs devshellLib;
|
||||||
|
in {
|
||||||
|
default = devshellLib.mkShell {
|
||||||
|
packages = [pkgs.alejandra];
|
||||||
|
};
|
||||||
|
}
|
||||||
28
cells/repo/flake.lock
generated
Normal file
28
cells/repo/flake.lock
generated
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"devshell": {
|
||||||
|
"locked": {
|
||||||
|
"dir": "lib",
|
||||||
|
"lastModified": 1753958239,
|
||||||
|
"narHash": "sha256-J0B5rfQAza9UKSqnKINn++AsrMWxG3/oTqVUt3QRlWk=",
|
||||||
|
"owner": "rensa-nix",
|
||||||
|
"repo": "devshell",
|
||||||
|
"rev": "fbacfc149b59acf68efa97951418a9a7a7022707",
|
||||||
|
"type": "gitlab"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"dir": "lib",
|
||||||
|
"owner": "rensa-nix",
|
||||||
|
"repo": "devshell",
|
||||||
|
"type": "gitlab"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"devshell": "devshell"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
14
cells/repo/flake.nix
Normal file
14
cells/repo/flake.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
devshell.url = "gitlab:rensa-nix/devshell?dir=lib";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = i:
|
||||||
|
i
|
||||||
|
// rec {
|
||||||
|
pkgs = import i.parent.nixpkgs {
|
||||||
|
inherit (i) system;
|
||||||
|
};
|
||||||
|
devshellLib = i.devshell.lib {inherit pkgs;};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
{
|
{
|
||||||
inputs,
|
|
||||||
cell,
|
|
||||||
}: {
|
|
||||||
hello = "world";
|
hello = "world";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
cellsFrom = ./cells;
|
cellsFrom = ./cells;
|
||||||
cellBlocks = with rensa.blocks; [
|
cellBlocks = with rensa.blocks; [
|
||||||
(simple "test")
|
(simple "test")
|
||||||
|
(simple "devShells")
|
||||||
];
|
];
|
||||||
} {};
|
} {};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,13 @@
|
||||||
cell = cells // {__cr = [cellName cellBlock.name];};
|
cell = cells // {__cr = [cellName cellBlock.name];};
|
||||||
additionalInputs =
|
additionalInputs =
|
||||||
if l.pathExists cellP.flake
|
if l.pathExists cellP.flake
|
||||||
then (callFlake (builtins.dirOf cellP.flake) {root.parent = inputs;}).outputs
|
then
|
||||||
|
(callFlake (builtins.dirOf cellP.flake) {
|
||||||
|
root = {
|
||||||
|
parent = inputs;
|
||||||
|
system = system;
|
||||||
|
};
|
||||||
|
}).outputs
|
||||||
else {};
|
else {};
|
||||||
in
|
in
|
||||||
importSignatureFor system cell cells additionalInputs;
|
importSignatureFor system cell cells additionalInputs;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
inherit self;
|
inherit self;
|
||||||
cells = deSystemize system cells;
|
cells = deSystemize system cells;
|
||||||
};
|
};
|
||||||
inherit cell;
|
inherit cell system;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
inherit deSystemize createImportSignature;
|
inherit deSystemize createImportSignature;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue