mirror of
https://github.com/divnix/digga.git
synced 2024-12-23 16:11:51 +03:00
use self.inputs instead of inputs
This commit is contained in:
parent
95734468e8
commit
048b886435
@ -3,7 +3,7 @@ let
|
||||
inherit (builtins) mapAttrs attrNames attrValues head isFunction;
|
||||
in
|
||||
|
||||
_: { self, inputs, ... } @ args:
|
||||
_: { self, ... } @ args:
|
||||
let
|
||||
|
||||
config = lib.mkFlake.evalArgs {
|
||||
@ -20,7 +20,7 @@ let
|
||||
modules = cfg.home.modules ++ cfg.home.externalModules;
|
||||
})
|
||||
(globalDefaults {
|
||||
inherit self inputs;
|
||||
inherit self;
|
||||
})
|
||||
];
|
||||
|
||||
@ -41,7 +41,8 @@ let
|
||||
in
|
||||
lib.systemFlake (lib.mergeAny
|
||||
{
|
||||
inherit self inputs hosts;
|
||||
inherit self hosts;
|
||||
inherit (self) inputs;
|
||||
inherit (cfg) channelsConfig supportedSystems;
|
||||
|
||||
channels = mapAttrs
|
||||
@ -84,8 +85,7 @@ lib.systemFlake (lib.mergeAny
|
||||
# since we can't detect overlays owned by self
|
||||
# we have to filter out ones exported by the inputs
|
||||
# optimally we would want a solution for NixOS/nix#4740
|
||||
inherit inputs;
|
||||
inherit (self) pkgs;
|
||||
inherit (self) pkgs inputs;
|
||||
};
|
||||
|
||||
outputsBuilder = channels:
|
||||
|
@ -5,7 +5,7 @@ let
|
||||
argOpts = with lib; { config, ... }:
|
||||
let
|
||||
cfg = config;
|
||||
inherit (config) self;
|
||||
inherit (args) self;
|
||||
|
||||
maybeImport = obj:
|
||||
if (builtins.isPath obj || builtins.isString obj) && lib.hasSuffix ".nix" obj then
|
||||
@ -47,8 +47,8 @@ let
|
||||
options = with types; {
|
||||
input = mkOption {
|
||||
type = flakeType;
|
||||
default = cfg.inputs.${name};
|
||||
defaultText = "inputs.<name>";
|
||||
default = self.inputs.${name};
|
||||
defaultText = "self.inputs.<name>";
|
||||
description = ''
|
||||
nixpkgs flake input to use for this channel
|
||||
'';
|
||||
@ -239,13 +239,6 @@ let
|
||||
type = flakeType;
|
||||
description = "The flake to create the devos outputs for";
|
||||
};
|
||||
inputs = mkOption {
|
||||
type = attrsOf flakeType;
|
||||
description = ''
|
||||
inputs for this flake
|
||||
used to set channel defaults and create registry
|
||||
'';
|
||||
};
|
||||
supportedSystems = mkOption {
|
||||
type = listOf str;
|
||||
default = lib.defaultSystems;
|
||||
|
@ -13,7 +13,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
globalDefaults = { self, inputs }:
|
||||
globalDefaults = { self }:
|
||||
let
|
||||
experimentalFeatures = [
|
||||
"flakes"
|
||||
@ -28,8 +28,8 @@
|
||||
nix.nixPath = [
|
||||
"nixpkgs=${channel.input}"
|
||||
"nixos-config=${self}/lib/compat/nixos"
|
||||
] ++ lib.optionals (inputs ? home) [
|
||||
"home-manager=${inputs.home}"
|
||||
] ++ lib.optionals (self.inputs ? home) [
|
||||
"home-manager=${self.inputs.home}"
|
||||
];
|
||||
|
||||
nix.registry = {
|
||||
@ -54,7 +54,7 @@
|
||||
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
|
||||
};
|
||||
|
||||
isoConfig = { self, inputs, fullHostConfig }:
|
||||
isoConfig = { self, fullHostConfig }:
|
||||
{ config, modulesPath, ... }@args: {
|
||||
|
||||
imports = [ "${modulesPath}/installer/cd-dvd/installation-cd-minimal-new-kernel.nix" ];
|
||||
@ -63,7 +63,7 @@
|
||||
# so convert each to list which can be coerced to string
|
||||
disabledModules = map lib.singleton (args.suites.allProfiles or [ ]);
|
||||
|
||||
nix.registry = lib.mapAttrs (n: v: { flake = v; }) inputs;
|
||||
nix.registry = lib.mapAttrs (n: v: { flake = v; }) self.inputs;
|
||||
|
||||
isoImage.isoBaseName = "nixos-" + config.networking.hostName;
|
||||
isoImage.contents = [{
|
||||
|
@ -4,12 +4,11 @@ let
|
||||
|
||||
self = self // {
|
||||
outPath = toString ./.;
|
||||
};
|
||||
|
||||
inputs = {
|
||||
nixos = pkgs.input;
|
||||
latest = pkgs.input;
|
||||
};
|
||||
};
|
||||
|
||||
channelsConfig = { allowUnfree = true; };
|
||||
|
||||
|
@ -10,7 +10,6 @@ in
|
||||
system.build = {
|
||||
iso = (mkBuild (diggaLib.modules.isoConfig {
|
||||
inherit self;
|
||||
inherit (self) inputs;
|
||||
fullHostConfig = config;
|
||||
})).config.system.build.isoImage;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user