diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..a475a37 --- /dev/null +++ b/.envrc @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1a68549 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +result +.ren diff --git a/cells/repo/devShells.nix b/cells/repo/devShells.nix new file mode 100644 index 0000000..d7583f9 --- /dev/null +++ b/cells/repo/devShells.nix @@ -0,0 +1,7 @@ +{inputs, ...}: let + inherit (inputs) pkgs devshellLib; +in { + default = devshellLib.mkShell { + packages = [pkgs.alejandra]; + }; +} diff --git a/cells/repo/flake.lock b/cells/repo/flake.lock new file mode 100644 index 0000000..3917fbc --- /dev/null +++ b/cells/repo/flake.lock @@ -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 +} diff --git a/cells/repo/flake.nix b/cells/repo/flake.nix new file mode 100644 index 0000000..2cb1932 --- /dev/null +++ b/cells/repo/flake.nix @@ -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;}; + }; +} diff --git a/cells/test/test.nix b/cells/test/test.nix index c086227..03a8e7a 100644 --- a/cells/test/test.nix +++ b/cells/test/test.nix @@ -1,6 +1,3 @@ { - inputs, - cell, -}: { hello = "world"; } diff --git a/flake.nix b/flake.nix index 7995277..76cf0f7 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,7 @@ cellsFrom = ./cells; cellBlocks = with rensa.blocks; [ (simple "test") + (simple "devShells") ]; } {}; } diff --git a/lib/core/loader.nix b/lib/core/loader.nix index 88d30c1..808b488 100644 --- a/lib/core/loader.nix +++ b/lib/core/loader.nix @@ -22,7 +22,13 @@ cell = cells // {__cr = [cellName cellBlock.name];}; additionalInputs = 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 {}; in importSignatureFor system cell cells additionalInputs; diff --git a/lib/utils/import-signature.nix b/lib/utils/import-signature.nix index 7550820..840f030 100644 --- a/lib/utils/import-signature.nix +++ b/lib/utils/import-signature.nix @@ -28,7 +28,7 @@ inherit self; cells = deSystemize system cells; }; - inherit cell; + inherit cell system; }; in { inherit deSystemize createImportSignature;