-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimages.nix
124 lines (121 loc) · 3.41 KB
/
images.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{ inputs, ... }:
let
commonModules = [
inputs.self.nixosModules.default
inputs.nix-index-database.nixosModules.nix-index
../9l/nixcfg
(
{
pkgs,
lib,
modulesPath,
...
}:
{
system.stateVersion = "24.11";
imports = [
# some default installer ISO config
"${toString modulesPath}/profiles/installation-device.nix"
"${toString modulesPath}/profiles/base.nix"
];
networking.networkmanager.enable = true;
networking.wireless.enable = lib.mkImageMediaOverride false;
boot.supportedFilesystems.zfs = lib.mkForce false;
boot.kernelParams = [
"iomem=relaxed"
];
hardware.enableRedistributableFirmware = true;
programs.nix-index-database.comma.enable = true;
programs.flashprog.enable = true;
environment.systemPackages =
with pkgs;
[
# Distro install tools
apk-tools
dnf5
# Tools
git
neovim
ranger
# Neovim deps
fd
gcc
git
gnumake
lua5_1
luarocks
ripgrep
tree-sitter
wget
nil
nixd
nixfmt-rfc-style
# ChromeOS Utilities
vboot_reference
submarine
]
++ lib.optionals (system == "x86_64-linux") [
# Distro install tools
apt
arch-install-scripts
];
services.getty.helpLine = lib.mkForce ''
The "nixos" and "root" accounts have empty passwords.
To log in over ssh you must set a password for either "nixos" or "root"
with `passwd` (prefix with `sudo` for "root"), or add your public key to
/home/nixos/.ssh/authorized_keys or /root/.ssh/authorized_keys.
If you need a wireless connection, use NetworkManager (nmcli or nmtui).
'';
}
)
];
customFormats = import ./imageFormats { inherit inputs; };
specialArgs = { inherit inputs; };
in
{
# Raw image for MTK-based Chromebooks with Depthcharge
raw-aarch64cros = inputs.nixos-generators.nixosGenerate {
inherit customFormats specialArgs;
system = "aarch64-linux";
modules = commonModules ++ [
inputs.self.nixosModules.crosAarch64
(
{ pkgs, ... }:
{
boot.kernelParams = [ "console=tty0" ];
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_cros;
}
)
];
format = "raw-cros";
};
# Raw image for Intel or AMD-based Chromebooks with Depthcharge
raw-x64cros = inputs.nixos-generators.nixosGenerate {
inherit customFormats specialArgs;
system = "x86_64-linux";
modules = commonModules ++ [
(
{ pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages_latest;
}
)
];
format = "raw-cros";
};
# ISO 9660 image for reqular x86_64 computers
iso-x86_64 = inputs.nixos-generators.nixosGenerate {
inherit customFormats specialArgs;
system = "x86_64-linux";
modules = commonModules ++ [
(
{ lib, pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages_latest;
image.baseName = lib.mkForce "nixos-${pkgs.system}-${inputs.self.shortRev or "dirty"}";
}
)
];
format = "install-iso";
};
}