-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconfiguration.nix
More file actions
111 lines (96 loc) · 2.34 KB
/
configuration.nix
File metadata and controls
111 lines (96 loc) · 2.34 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
{
config,
pkgs,
lib,
modulesPath,
...
}:
let
user = "guest";
password = "guest";
# SSID = "mywifi";
# SSIDpassword = "mypassword";
# interface = "wlan0";
hostname = "raspi";
in
{
nixpkgs.hostPlatform = "aarch64-linux";
imports = [
"${modulesPath}/installer/sd-card/sd-image-aarch64.nix"
"${modulesPath}/profiles/minimal.nix"
];
# SDイメージのカーネルモジュールリストから存在しないモジュールを除外
nixpkgs.overlays = [
(final: prev: {
makeModulesClosure = x:
prev.makeModulesClosure (x // {
allowMissing = true;
});
})
];
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_rpi4;
initrd = {
# dw-hdmiモジュールが存在しない問題を回避するため、デフォルトモジュールを無効化
includeDefaultModules = false;
availableKernelModules = [
"xhci_pci"
"usbhid"
"usb_storage"
"sd_mod"
"mmc_block"
];
kernelModules = [ ];
};
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
};
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
};
networking = {
useNetworkd = true;
useDHCP = true;
hostName = hostname;
wireless = {
# enable = true;
# networks."${SSID}".psk = SSIDpassword;
# interfaces = [ interface ];
};
};
systemd.network.networks."eth0" = {
matchConfig.Name = "eth0";
gateway = [ "192.168.10.1" ];
dns = [ "1.1.1.1" ];
address = [
"192.168.10.50/24"
];
};
environment.systemPackages = with pkgs; [ vim ];
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
users.users.coma = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINZWLYeAZNYt2ZHjJl4zd6rsS+2LT9uL4AqUJid6gikl coma@comabook"
];
};
security.sudo.wheelNeedsPassword = false;
time.timeZone = "Asia/Tokyo";
hardware.enableRedistributableFirmware = true;
# Flakesとnix-commandを有効化
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "25.05";
}