iso-cd: style cleanup (#2)

This commit is contained in:
Timothy DeHerrera 2021-02-01 18:57:19 -07:00 committed by GitHub
parent 8cb82a307f
commit 17621d6b14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 38 deletions

View file

@ -60,10 +60,7 @@
overlay = import ./pkgs; overlay = import ./pkgs;
lib = import ./lib { lib = import ./lib { inherit nixos; };
inherit (nixos) lib;
inherit nixos;
};
templates.flk.path = ./.; templates.flk.path = ./.;

View file

@ -1,9 +1,9 @@
{ lib, nixos, ... }: { 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 (nixos.lib) fold filterAttrs hasSuffix mapAttrs' nameValuePair removeSuffix
recursiveUpdate genAttrs nixosSystem; recursiveUpdate genAttrs nixosSystem mkForce;
# mapFilterAttrs :: # mapFilterAttrs ::
# (name -> value -> bool ) # (name -> value -> bool )
@ -56,37 +56,32 @@ in
(readDir dir); (readDir dir);
nixosSystemExtended = { modules, ... } @ args: nixosSystemExtended = { modules, ... } @ args:
nixosSystem ( nixosSystem (args // {
args // {
modules = modules =
let let
isoConfig = ( modpath = "nixos/modules";
import (nixos + "/nixos/lib/eval-config.nix") cd = "installer/cd-dvd/installation-cd-minimal-new-kernel.nix";
( isoConfig = (nixosSystem
args // { (args // {
modules = modules ++ [ modules = modules ++ [
(nixos + "/nixos/modules/installer/cd-dvd/installation-cd-minimal-new-kernel.nix") "${nixos}/${modpath}/${cd}"
( ({ config, ... }: {
{ config, ... }: {
isoImage.isoBaseName = "nixos-" + config.networking.hostName; 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 # confilcts with networking.wireless which might be slightly
networking.wireless.iwd.enable = lib.mkForce false; # confilcts with networking.wireless # more useful on a stick
} networking.networkmanager.enable = mkForce false;
) # confilcts with networking.wireless
networking.wireless.iwd.enable = mkForce false;
})
]; ];
} })).config;
)
).config;
in in
modules ++ [ modules ++ [{
{
system.build = { system.build = {
iso = isoConfig.system.build.isoImage; iso = isoConfig.system.build.isoImage;
}; };
} }];
]; });
}
);
nixosModules = nixosModules =
let let