outputs: add updater script
This commit is contained in:
parent
59d6ba8f97
commit
72d18c49fe
1 changed files with 27 additions and 2 deletions
29
outputs.nix
29
outputs.nix
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
inputs ? import ./inputs.nix {},
|
inputsPath ? ./inputs.nix,
|
||||||
|
inputs ? import inputsPath {},
|
||||||
selfPath ? ./.
|
selfPath ? ./.
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ systems = [
|
||||||
forEachSystem = lib.genAttrs systems;
|
forEachSystem = lib.genAttrs systems;
|
||||||
|
|
||||||
self = {
|
self = {
|
||||||
inherit inputs lib self;
|
inherit inputs inputsPath lib self;
|
||||||
outPath = selfPath;
|
outPath = selfPath;
|
||||||
modifiedNixpkgs = import ./pkgs/top-level/impure.nix;
|
modifiedNixpkgs = import ./pkgs/top-level/impure.nix;
|
||||||
modifiedNixpkgsPure = import ./pkgs/top-level/default.nix;
|
modifiedNixpkgsPure = import ./pkgs/top-level/default.nix;
|
||||||
|
@ -71,6 +72,30 @@ self = {
|
||||||
builtins.attrValues
|
builtins.attrValues
|
||||||
builtins.listToAttrs
|
builtins.listToAttrs
|
||||||
];
|
];
|
||||||
|
# FIXME: currently impure
|
||||||
|
# NOTE: to run, you need to evaluate outputs.nix instead of default.nix
|
||||||
|
# nix-shell outputs.nix -A update
|
||||||
|
update = let
|
||||||
|
updateScript = (self.packagesForSystem (builtins.currentSystem)).den-update-script;
|
||||||
|
in updateScript {
|
||||||
|
path = "";
|
||||||
|
packages = lib.pipe ./update-list.nix [
|
||||||
|
import
|
||||||
|
(x: x self)
|
||||||
|
lib.attrsToList
|
||||||
|
(lib.imap1 (i: {name, value}: {
|
||||||
|
name = builtins.toString i;
|
||||||
|
value = value // {
|
||||||
|
# hack to pass isDerivation check in nixpkgs maintainers/scripts/update.nix
|
||||||
|
# https://github.com/NixOS/nixpkgs/blob/a1185f4064c18a5db37c5c84e5638c78b46e3341/maintainers/scripts/update.nix#L85
|
||||||
|
type = "derivation";
|
||||||
|
name = name;
|
||||||
|
};
|
||||||
|
}))
|
||||||
|
builtins.listToAttrs
|
||||||
|
lib.recurseIntoAttrs
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
in self
|
in self
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue