configuration.nix/installer/installer-configuration.nix

74 lines
2.2 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ pkgs, lib, config, ... }:
let
serverIP = "10.0.174.12";
buildNodeYggIP = "200:ccc6:1361:5c84:aba0:1244:35f5:c903";
configRepoUrl = "https://forgejo.gregorbednov.ru/gregorbednov/configuration.nix.git";
in
{
isoImage.isoName = lib.mkForce "mirea-nixos-installer.iso";
isoImage.squashfsCompression = "zstd -Xcompression-level 6";
services.getty.autologinUser = lib.mkForce "root";
environment.systemPackages = with pkgs; [
parted
gptfdisk
util-linux
dosfstools
e2fsprogs
git
pv
curl
(writeShellScriptBin "mirea-install" (
builtins.replaceStrings
[ "@CONFIG_REPO_URL@" ]
[ configRepoUrl ]
(builtins.readFile ./mirea-install.sh)
))
];
# Yggdrasil запускается на установщике — благодаря ему доступен локальный кэш сборок
services.yggdrasil = {
enable = true;
persistentKeys = false;
settings.Peers = [ "tcp://${serverIP}:12345" ];
};
networking.networkmanager.enable = true;
networking.wireless.enable = lib.mkForce false;
networking.hosts."${buildNodeYggIP}" = [ "nixos.builds.node" ];
nix.settings = {
substituters = [
"http://nixos.builds.node"
"https://cache.nixos.org"
];
trusted-public-keys = [
"nixos.builds.node:E/XNkcdzB0EyTyEJuOTXJH8qynxgCfQ87JHkbD88uF8="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
];
trusted-substituters = [ "http://nixos.builds.node" ];
connect-timeout = 5;
experimental-features = [ "nix-command" "flakes" ];
};
systemd.services.nix-daemon = {
after = [ "yggdrasil.service" ];
wants = [ "yggdrasil.service" ];
};
i18n.defaultLocale = "ru_RU.UTF-8";
time.timeZone = "Europe/Moscow";
console.font = "cyr-sun16";
environment.etc."issue".text = ''
Установщик NixOS MIREA
Запустите: mirea-install
'';
system.stateVersion = "24.11";
}