Add version-suffix to dependency channels

This commit is contained in:
Charlotte Van Petegem 2021-08-13 11:40:43 +02:00
parent c6d69264e8
commit 1bcc033dbc
No known key found for this signature in database
GPG key ID: 019E764B7184435A
4 changed files with 1531 additions and 1517 deletions

View file

@ -37,8 +37,19 @@
};
hostDefaults = {
modules = [
({ lib, ... }: {
environment.etc = lib.mapAttrs' (key: val: { name = "channels/${key}"; value = { source = val.outPath; }; }) inputs;
({ lib, pkgs, ... }: {
environment.etc = lib.mapAttrs'
(key: val: {
name = "channels/${key}";
value = {
source = pkgs.runCommandNoCC "${key}-channel" { } ''
mkdir $out
echo "${val.rev or (toString val.lastModified)}" > $out/.version-suffix
echo "import ${val.outPath}/default.nix" > $out/default.nix
'';
};
})
inputs;
nix.nixPath = [ "/etc/channels" ];
})
utils.nixosModules.saneFlakeDefaults