2024-06-17 22:09:46 +02:00
# this ISO works best with tow-boot or another way of UEFI booting.
2024-06-15 23:24:37 +02:00
{
inputs ,
configLib ,
. . .
} :
( inputs . nixpkgs . lib . nixosSystem {
system = " a a r c h 6 4 - l i n u x " ;
specialArgs = { inherit inputs configLib ; } ;
# > Our main nixos configuration file <
modules = [
inputs . home-manager . nixosModules . home-manager
../configs/nixos/interactive-networking.nix
2024-10-01 14:52:14 +02:00
../configs/nixos/tailscale.nix
2024-06-15 23:24:37 +02:00
../configs/nixos/common.nix
../configs/nixos/sshd.nix
( {
config ,
pkgs ,
lib ,
inputs ,
configLib ,
modulesPath ,
options ,
. . .
} : {
2024-06-17 22:09:46 +02:00
# do not cross compile, some packages are broken, and will take an age anywyay. instead, if you are on nixos, set `boot.binfmt.emulatedSystems=["aarch64-linux"];`.
# if your not on nixos, install quemu-user-static and quemu-user-static-binfmt, and add `extra-platforms = aarch64-linux` to /etc/nix/nix.conf. may have to modify extra-sandbox-paths.
# alternatively, set up a remote-builder for aarch64-linux.
# nixpkgs.buildPlatform.system = "x86_64-linux";
# nixpkgs.hostPlatform.system = "aarch64-linux";
2024-06-15 23:24:37 +02:00
imports = [
2024-06-17 22:09:46 +02:00
" ${ modulesPath } / i n s t a l l e r / c d - d v d / i s o - i m a g e . n i x "
" ${ modulesPath } / p r o f i l e s / b a s e . n i x "
" ${ modulesPath } / p r o f i l e s / c l o n e - c o n f i g . n i x "
" ${ modulesPath } / p r o f i l e s / a l l - h a r d w a r e . n i x "
" ${ modulesPath } / i n s t a l l e r / s c a n / d e t e c t e d . n i x "
" ${ modulesPath } / i n s t a l l e r / s c a n / n o t - d e t e c t e d . n i x "
2024-06-15 23:24:37 +02:00
] ;
host = {
user = " g a b e " ;
fullName = " G a b e V e n b e r g " ;
gui . enable = true ;
} ;
networking . hostName = " n i x o s - i n s t a l l e r " ; # Define your hostname.
users . users . ${ config . host . user } = {
packages = with pkgs ; [
2024-06-16 21:52:15 +02:00
neovim
2024-06-19 01:06:17 +02:00
gptfdisk
2024-06-15 23:24:37 +02:00
] ;
} ;
home-manager . users . ${ config . host . user } = {
inputs ,
osConfig ,
. . .
} : {
host = osConfig . host ;
user = {
2024-06-18 16:32:21 +02:00
nvim . enable-lsp = false ;
2024-06-15 23:24:37 +02:00
git = {
profile = {
name = " G a b e V e n b e r g " ;
email = " g a b e v e n b e r g @ g m a i l . c o m " ;
} ;
workProfile . enable = false ;
} ;
} ;
imports = [
2024-06-18 16:32:21 +02:00
../roles/home-manager/terminal.nix
2024-06-15 23:24:37 +02:00
../configs/home-manager/common.nix
inputs . nixvim . homeManagerModules . nixvim
] ;
} ;
# Adds terminus_font for people with HiDPI displays
console . packages = options . console . packages . default ++ [ pkgs . terminus_font ] ;
2024-06-17 22:09:46 +02:00
# ISO naming.
isoImage . isoName = " ${ config . isoImage . isoBaseName } - ${ pkgs . stdenv . hostPlatform . system } . i s o " ;
# EFI booting
isoImage . makeEfiBootable = true ;
# USB booting
isoImage . makeUsbBootable = true ;
# Add Memtest86+ to the CD.
boot . loader . grub . memtest86 . enable = true ;
# services.libinput.enable = true; # for touchpad support on many laptops
# An installation media cannot tolerate a host config defined file
# system layout on a fresh machine, before it has been formatted.
swapDevices = lib . mkForce [ ] ;
fileSystems = lib . mkForce config . lib . isoFileSystems ;
system . nixos . variant_id = lib . mkDefault " i n s t a l l e r " ;
# Enable in installer, even if the minimal profile disables it.
documentation . enable = lib . mkForce true ;
# Show the manual.
documentation . nixos . enable = lib . mkForce true ;
2024-06-15 23:24:37 +02:00
# Tell the Nix evaluator to garbage collect more aggressively.
# This is desirable in memory-constrained environments that don't
# (yet) have swap set up.
environment . variables . GC_INITIAL_HEAP_SIZE = " 1 M " ;
# Make the installer more likely to succeed in low memory
# environments. The kernel's overcommit heustistics bite us
# fairly often, preventing processes such as nix-worker or
# download-using-manifests.pl from forking even if there is
# plenty of free memory.
boot . kernel . sysctl . " v m . o v e r c o m m i t _ m e m o r y " = " 1 " ;
# Show all debug messages from the kernel but don't log refused packets
# because we have the firewall enabled. This makes installs from the
# console less cumbersome if the machine has a public IP.
networking . firewall . logRefusedConnections = lib . mkDefault false ;
2024-06-17 22:09:46 +02:00
# Prevent installation media from evacuating persistent storage, as their
# var directory is not persistent and it would thus result in deletion of
# those entries.
environment . etc . " s y s t e m d / p s t o r e . c o n f " . text = ''
[ PStore ]
Unlink = no
'' ;
# Much faster than xz
isoImage . squashfsCompression = lib . mkDefault " z s t d " ;
2024-06-15 23:24:37 +02:00
system . stateVersion = lib . mkDefault lib . trivial . release ;
} )
] ;
} )
. config
. system
. build
2024-06-17 22:09:46 +02:00
. isoImage