mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 16:39:07 +01:00
Add custom installer iso
This commit is contained in:
parent
7adc4cf660
commit
d4e1577ee1
1 changed files with 61 additions and 0 deletions
61
flake-parts/iso.nix
Normal file
61
flake-parts/iso.nix
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
{ inputs, self, ... }:
|
||||
{
|
||||
perSystem =
|
||||
{ system, lib, ... }:
|
||||
{
|
||||
packages.iso =
|
||||
(inputs.nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
inherit (self) allHosts;
|
||||
};
|
||||
|
||||
modules = lib.singleton (
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
pkgs,
|
||||
allHosts,
|
||||
...
|
||||
}:
|
||||
{
|
||||
nixpkgs.hostPlatform = system;
|
||||
|
||||
nix.settings.experimental-features = [ "pipe-operators" ];
|
||||
|
||||
networking = {
|
||||
hostName = "installer";
|
||||
wireless.enable = false;
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
|
||||
console.keyMap = "de-latin1-nodeadkeys";
|
||||
|
||||
boot.supportedFilesystems = {
|
||||
zfs = false;
|
||||
bcachefs = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = [ inputs.disko.packages.${pkgs.stdenv.hostPlatform.system}.default ];
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
};
|
||||
};
|
||||
|
||||
users.users.root.openssh.authorizedKeys.keyFiles =
|
||||
allHosts
|
||||
|> lib.attrValues
|
||||
|> lib.filter (host: host.config.networking.hostName != config.networking.hostName)
|
||||
|> lib.filter (host: host.config |> lib.hasAttr "home-manager")
|
||||
|> lib.map (host: host.config.home-manager.users.seb.custom.programs.ssh)
|
||||
|> lib.filter (ssh: ssh.enable)
|
||||
|> lib.map (ssh: ssh.publicKeyFile);
|
||||
}
|
||||
);
|
||||
}).config.system.build.images.iso-installer;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue