Xeon-SP boards: Factor out OCP VPD `get_cxl_mode()` impl
[coreboot2.git] / util / liveiso / nixos / common.nix
blobff5dfea3660ed8c8cda7a003310110d77bbfc22b
1 # SPDX-License-Identifier: GPL-2.0-only
3 { config, options, pkgs, ... }:
6         imports = [
7                 <nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
8                 <nixpkgs/nixos/modules/installer/cd-dvd/iso-image.nix>
9         ];
11         system.stateVersion = "23.11";
13         isoImage = {
14                 makeEfiBootable = true;
15                 makeUsbBootable = true;
16                 isoName = "${config.isoImage.isoBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.iso";
17         };
19         environment = {
20                 variables = {
21                         EDITOR = "nvim";
22                         VISUAL = "nvim";
23                         # Tell the Nix evaluator to garbage collect more aggressively.
24                         # This is desirable in memory-constrained environments that don't
25                         # (yet) have swap set up.
26                         GC_INITIAL_HEAP_SIZE = "1M";
27                 };
28                 shellAliases.vim = "nvim";
29         };
31         boot = {
32                 kernelParams = [
33                         "console=ttyS0,115200"
34                         "console=tty0"
35                         "iomem=relaxed"
36                         "spi_intel.writeable=1"
37                 ];
38                 # pkgs.linuxPackages == lts
39                 # pkgs.linuxPackages_latest == stable
40                 kernelPackages = pkgs.linuxPackages;
41                 extraModulePackages = with config.boot.kernelPackages; [
42                         acpi_call
43                         chipsec
44                         zfs
45                 ];
46                 # Make programs more likely to work in low memory
47                 # environments. The kernel's overcommit heustistics bite us
48                 # fairly often, preventing processes from forking even if
49                 # there is plenty of free memory.
50                 kernel.sysctl."vm.overcommit_memory" = "1";
51                 loader.grub.memtest86.enable = true;
52                 postBootCommands = ''
53                         mkdir -p /mnt
54                 '';
55         };
57         console.packages = options.console.packages.default ++ [ pkgs.terminus_font ];
59         nixpkgs.config.allowUnfree = true;
60         hardware = {
61                 cpu.intel.updateMicrocode = true;
62                 cpu.amd.updateMicrocode = true;
63                 enableAllFirmware = true;
64                 bluetooth = {
65                         enable = true;
66                         powerOnBoot = false;
67                 };
68         };
70         services = {
71                 fwupd.enable = true;
72                 udev.packages = with pkgs; [
73                         rfkill_udev
74                 ];
75                 openssh = {
76                         enable = true;
77                         settings.PermitRootLogin = "yes";
78                 };
79         };
81         networking = {
82                 hostName = "devsystem";
83                 networkmanager.enable = true;
84         };
86         security.sudo.wheelNeedsPassword = false;
88         users = {
89                 groups.user = {};
90                 users = {
91                         root.initialHashedPassword = "";
92                         user = {
93                                 isNormalUser = true;
94                                 group = "user";
95                                 extraGroups = [ "users" "wheel" "networkmanager" "uucp" "flashrom" ];
96                                 initialHashedPassword = "";
97                         };
98                 };
99         };
101         programs.flashrom.enable = true;
103         environment.systemPackages = with pkgs; [
104                 acpica-tools
105                 btrfs-progs
106                 bzip2
107                 ccrypt
108                 chipsec
109                 coreboot-utils
110                 cryptsetup
111                 curl
112                 ddrescue
113                 devmem2
114                 dmidecode
115                 dosfstools
116                 e2fsprogs
117                 efibootmgr
118                 efivar
119                 exfat
120                 f2fs-tools
121                 fuse
122                 fuse3
123                 fwts
124                 gptfdisk
125                 gitAndTools.gitFull
126                 gitAndTools.tig
127                 gzip
128                 hdparm
129                 hexdump
130                 htop
131                 i2c-tools
132                 intel-gpu-tools
133                 inxi
134                 iotools
135                 jfsutils
136                 jq
137                 lm_sensors
138                 mdadm
139                 minicom
140                 mkpasswd
141                 ms-sys
142                 msr-tools
143                 mtdutils
144                 neovim
145                 nixos-install-tools
146                 ntfsprogs
147                 nvme-cli
148                 openssl
149                 p7zip
150                 pacman
151                 parted
152                 pcimem
153                 pciutils
154                 phoronix-test-suite
155                 powertop
156                 psmisc
157                 python3Full
158                 rsync
159                 screen
160                 sdparm
161                 smartmontools
162                 socat
163                 sshfs-fuse
164                 testdisk
165                 tmate
166                 tmux
167                 uefitool
168                 uefitoolPackages.old-engine
169                 unzip
170                 upterm
171                 usbutils
172                 wget
173                 zfs
174                 zip
175                 zstd
176         ];