Lib/flakes: remove self references
This commit is contained in:
@@ -43,8 +43,6 @@ lib.fix (
|
|||||||
facts = import ./facts.nix { inherit lib; };
|
facts = import ./facts.nix { inherit lib; };
|
||||||
|
|
||||||
# flakes
|
# flakes
|
||||||
flakes = clanLib.callLib ./flakes.nix {
|
flakes = clanLib.callLib ./flakes.nix { };
|
||||||
clan-core = self;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,16 +1,22 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
clan-core,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
# A flake lock for offline use.
|
# A flake lock for offline use.
|
||||||
# All flake inputs are locked to an existing store path
|
# All flake inputs are locked to an existing store path
|
||||||
mkOfflineFlakeLock =
|
mkOfflineFlakeLock =
|
||||||
flakePath:
|
flakeRef:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
flake =
|
||||||
|
if lib.isAttrs flakeRef then
|
||||||
|
flakeRef
|
||||||
|
else
|
||||||
|
throw "Cannot handle flake of type ${lib.typeOf flakeRef} yet.";
|
||||||
|
flakePath = toString flake;
|
||||||
flakeLock = lib.importJSON (flakePath + "/flake.lock");
|
flakeLock = lib.importJSON (flakePath + "/flake.lock");
|
||||||
flakeInputs = builtins.removeAttrs clan-core.inputs [ "self" ];
|
flakeInputs = builtins.removeAttrs flake.inputs [ "self" ];
|
||||||
inputsToPaths =
|
inputsToPaths =
|
||||||
flakeLock:
|
flakeLock:
|
||||||
flakeLock
|
flakeLock
|
||||||
@@ -28,7 +34,7 @@
|
|||||||
lastModified =
|
lastModified =
|
||||||
# lol, nixpkgs has a different timestamp on the fs???
|
# lol, nixpkgs has a different timestamp on the fs???
|
||||||
if name == "nixpkgs" then 0 else 1;
|
if name == "nixpkgs" then 0 else 1;
|
||||||
path = "${clan-core.inputs.${name}}";
|
path = "${flake.inputs.${name}}";
|
||||||
type = "path";
|
type = "path";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ in
|
|||||||
export NIX_STORE_DIR=$HOME
|
export NIX_STORE_DIR=$HOME
|
||||||
cp -r ${clanCore} $out
|
cp -r ${clanCore} $out
|
||||||
chmod +w -R $out
|
chmod +w -R $out
|
||||||
cp ${mkOfflineFlakeLock clanCore} $out/flake.lock
|
cp ${mkOfflineFlakeLock self} $out/flake.lock
|
||||||
nix flake lock $out --extra-experimental-features 'nix-command flakes'
|
nix flake lock $out --extra-experimental-features 'nix-command flakes'
|
||||||
clanCoreHash=$(nix hash path ${clanCore} --extra-experimental-features 'nix-command')
|
clanCoreHash=$(nix hash path ${clanCore} --extra-experimental-features 'nix-command')
|
||||||
'';
|
'';
|
||||||
|
|||||||
Reference in New Issue
Block a user