iso: move iso target to ./lib

This commit is contained in:
David Arnold 2021-01-27 21:11:38 -05:00
parent 33bcf093b7
commit 8cb82a307f
No known key found for this signature in database
GPG Key ID: 6D6A936E69C59D08
3 changed files with 38 additions and 38 deletions

View File

@ -62,6 +62,7 @@
lib = import ./lib { lib = import ./lib {
inherit (nixos) lib; inherit (nixos) lib;
inherit nixos;
}; };
templates.flk.path = ./.; templates.flk.path = ./.;

View File

@ -9,48 +9,14 @@
, ... , ...
}: }:
let let
inherit (lib.flk) recImport; inherit (lib.flk) recImport nixosSystemExtended;
inherit (builtins) attrValues removeAttrs; inherit (builtins) attrValues removeAttrs;
unstableModules = [ ]; unstableModules = [ ];
addToDisabledModules = [ ]; addToDisabledModules = [ ];
libExt = lib.extend (
final: prev: {
nixosSystemExtended = { modules, ... } @ args:
lib.nixosSystem (args // {
modules =
let
isoConfig = (
import (nixos + "/nixos/lib/eval-config.nix")
(
args // {
modules = modules ++ [
(nixos + "/nixos/modules/installer/cd-dvd/installation-cd-minimal-new-kernel.nix")
({ config, ... }: {
isoImage.isoBaseName = "nixos-" + config.networking.hostName;
networking.networkmanager.enable = lib.mkForce false; # confilcts with networking.wireless which might be slightly more useful on a stick
networking.wireless.iwd.enable = lib.mkForce false; # confilcts with networking.wireless
})
];
}
)
).config;
in
modules ++ [
{
system.build = {
iso = isoConfig.system.build.isoImage;
};
}
];
}
);
}
);
config = hostName: config = hostName:
libExt.nixosSystemExtended { nixosSystemExtended {
inherit system; inherit system;
specialArgs = specialArgs =

View File

@ -1,9 +1,9 @@
{ lib, ... }: { lib, nixos, ... }:
let let
inherit (builtins) attrNames attrValues isAttrs readDir listToAttrs mapAttrs; inherit (builtins) attrNames attrValues isAttrs readDir listToAttrs mapAttrs;
inherit (lib) fold filterAttrs hasSuffix mapAttrs' nameValuePair removeSuffix inherit (lib) fold filterAttrs hasSuffix mapAttrs' nameValuePair removeSuffix
recursiveUpdate genAttrs; recursiveUpdate genAttrs nixosSystem;
# mapFilterAttrs :: # mapFilterAttrs ::
# (name -> value -> bool ) # (name -> value -> bool )
@ -55,6 +55,39 @@ in
nameValuePair ("") (null)) nameValuePair ("") (null))
(readDir dir); (readDir dir);
nixosSystemExtended = { modules, ... } @ args:
nixosSystem (
args // {
modules =
let
isoConfig = (
import (nixos + "/nixos/lib/eval-config.nix")
(
args // {
modules = modules ++ [
(nixos + "/nixos/modules/installer/cd-dvd/installation-cd-minimal-new-kernel.nix")
(
{ config, ... }: {
isoImage.isoBaseName = "nixos-" + config.networking.hostName;
networking.networkmanager.enable = lib.mkForce false; # confilcts with networking.wireless which might be slightly more useful on a stick
networking.wireless.iwd.enable = lib.mkForce false; # confilcts with networking.wireless
}
)
];
}
)
).config;
in
modules ++ [
{
system.build = {
iso = isoConfig.system.build.isoImage;
};
}
];
}
);
nixosModules = nixosModules =
let let
# binary cache # binary cache