-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodule.nix
57 lines (50 loc) · 1.35 KB
/
module.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
{nixpkgs, ...}: {
pkgs,
lib,
config,
...
}: {
imports = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
];
options = {
uconsole.boot.configTxt = with lib;
mkOption {
type = types.string;
};
uconsole.boot.kernel.crossBuild = with lib;
mkOption {
type = types.bool;
};
};
config = {
boot.kernelParams = ["console=serial0,115200" "console=tty1"];
system.stateVersion = "23.11";
sdImage.compressImage = false;
sdImage.populateFirmwareCommands = let
configTxt = pkgs.writeText "config.txt" config.uconsole.boot.configTxt;
in ''
# Add the config
rm -f firmware/config.txt
cp ${configTxt} firmware/config.txt
'';
networking.networkmanager.enable = true;
powerManagement.cpuFreqGovernor = "ondemand";
services.openssh.enable = true;
# ---- Some extra stuff, this should be removed or make it configurable
# TODO make this configurable
users.mutableUsers = false;
users.users.nixos = {
password = "nixos";
isNormalUser = true;
extraGroups = ["wheel" "networkmanager" "video"];
shell = pkgs.bashInteractive;
};
programs.git.enable = true;
nix.extraOptions = ''
experimental-features = nix-command flakes
keep-outputs = true
keep-derivations = true
'';
};
}