-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgbeed02.nix
More file actions
128 lines (115 loc) · 2.79 KB
/
Copy pathgbeed02.nix
File metadata and controls
128 lines (115 loc) · 2.79 KB
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
125
126
127
128
{
outputs,
nixos-raspberrypi,
config,
pkgs,
lib,
...
}: let
hostname = "gbeed02";
username = "gbeed";
system = "aarch64-linux";
gbeed = outputs.packages.${system}.console;
in {
imports = with nixos-raspberrypi.nixosModules; [
raspberry-pi-02.base
raspberry-pi-02.display-vc4
];
image.baseName = lib.mkForce hostname;
hardware.graphics.enable = true;
system.stateVersion = config.system.nixos.release;
time.timeZone = "UTC";
networking.hostName = hostname;
users.users.gbeed = {
isNormalUser = true;
extraGroups = ["video" "render" "input" "wheel"];
initialHashedPassword = hostname;
home = "/home/${username}";
};
users.users.root.initialHashedPassword = hostname;
security.sudo = {
enable = true;
wheelNeedsPassword = false;
};
services.getty.autologinUser = username;
services.openssh = {
enable = true;
settings.PermitRootLogin = "yes";
};
networking.useNetworkd = true;
networking.wireless.enable = false;
networking.wireless.iwd = {
enable = true;
settings = {
Network.EnableIPv6 = true;
Settings.AutoConnect = true;
};
};
networking.firewall.allowedUDPPorts = [5353];
environment.systemPackages = [
gbeed
pkgs.git
pkgs.tree
pkgs.htop
];
# gbeed systemd service, should launch on boot
# systemd.services.gbeed = {
# description = "Game Boy Emulator for Embedded Devices";
# after = ["multi-user.target"];
# wantedBy = ["multi-user.target"];
#
# environment = {
# HOME = "/home/${username}";
# };
#
# serviceConfig = {
# Type = "simple";
# User = username;
# Group = "users";
# WorkingDirectory = "/home/${username}";
#
# ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p /home/${username}/roms /home/${username}/saves";
# ExecStart = "gbeed";
#
# Restart = "on-failure";
# RestartSec = "3";
#
# # DRM/KMS access
# SupplementaryGroups = ["video" "render" "input"];
#
# # TTY access for DRM
# TTYPath = "/dev/tty1";
# StandardInput = "tty";
# StandardOutput = "tty";
# StandardError = "journal";
# TTYVHangup = true;
# TTYReset = true;
# };
# };
# filesystem layout for SD card
fileSystems = {
"/boot/firmware" = {
device = "/dev/disk/by-label/FIRMWARE";
fsType = "vfat";
options = [
"noatime"
"noauto"
"x-systemd.automount"
"x-systemd.idle-timeout=1min"
];
};
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = ["noatime"];
};
};
system.nixos.tags = let
cfg = config.boot.loader.raspberry-pi;
in [
"gbeed"
"raspberry-pi-${cfg.variant}"
cfg.bootloader
config.boot.kernelPackages.kernel.version
];
}