-
Notifications
You must be signed in to change notification settings - Fork 2
/
configuration.nix
151 lines (136 loc) · 3.92 KB
/
configuration.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{ config, pkgs, lib, ... }:
let in {
imports =
[
"${fetchTarball "https://github.com/NixOS/nixos-hardware/archive/936e4649098d6a5e0762058cb7687be1b2d90550.tar.gz" }/raspberry-pi/4"
./hardware-configuration.nix
./wifi.nix
./hass-secrets.nix
];
boot.supportedFilesystems = [ "zfs" ];
networking = {
hostId = "6459f901"; # Hex form of tailscale IP
hostName = "nas";
useDHCP = false;
interfaces.eth0.useDHCP = true;
interfaces.wlan0.useDHCP = true;
firewall = {
interfaces.tailscale0.allowedTCPPorts = [ 22 80 443 445 ];
};
};
environment.systemPackages = with pkgs; [ vim ];
services.openssh = {
enable = true;
openFirewall = false;
permitRootLogin = "yes";
challengeResponseAuthentication = false;
};
services.samba = {
enable = true;
enableNmbd = false;
enableWinbindd = false;
extraConfig = ''
workgroup = WORKGROUP
server string = nas
disable netbios = yes
guest account = nobody
map to guest = bad user
min protocol = SMB2
vfs objects = catia fruit streams_xattr
fruit:metadata = stream
'';
shares.backup = {
path = "/nas/backup";
browseable = "yes";
"writeable" = "yes";
"guest ok" = "yes";
"guest only" = "yes";
"force user" = "akhil";
"vfs objects" = "catia fruit streams_xattr";
"fruit:time machine" = "yes";
};
};
services.zfs = {
autoScrub.enable = true;
autoSnapshot.enable = true;
};
services.plex = {
enable = true;
openFirewall = true;
};
nixpkgs.config.allowUnfree = true;
services.tailscale.enable = true;
systemd.services.sshd.wantedBy = pkgs.lib.mkForce [ "multi-user.target" ];
users.users.akhil = {
isNormalUser = true;
home = "/home/akhil";
extraGroups = [ "wheel" "networkmanager" ];
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9RwUBWWGe67XSDenCkGBjO/GUSFNYgq1EMPAcoQkcf1Dl8Q5Mf84JBUwpbdIZdR1AayBg+Af5E7c+ywtxrq7tMaTQhomVSyMcJteWrTBUJTfm1wSh5yxSZaGv+uDHbuRmJ3CknCLD7A/CY+/hjO8wMU1Em4oG2phm4gSSV1GKifD/3ExrigJHBpArNwR27RBUGq49/1BQbi+1mgPAI4k7Cqvpz5+FMkHiPHfYI1nt1eSvVGJpIlhbec9WraAH5nu1kT+ZAOoQstEAfkA5j52o2/uls/yC5MrrWTVRzRjRL7w8aWcGkdSORaeTkvBMkM8BtTDQ2RgSbBkHt8NKYRwh akhil@Akhils-MacBook-Air.local" ];
};
security.sudo.wheelNeedsPassword = false;
# Enable GPU acceleration
hardware.raspberry-pi."4".fkms-3d.enable = true;
services.xserver.enable = false;
hardware.pulseaudio.enable = true;
services.home-assistant = {
enable = true;
openFirewall = true;
package = (pkgs.home-assistant.override {
extraPackages = py: with py; [
pyipp
PyChromecast
aioshelly
aiohttp-cors
aiodiscover
sqlalchemy
plexapi
];
}).overrideAttrs (_: {
doInstallCheck = false;
});
config = {
homeassistant = {
name = "Home";
unit_system = "metric";
time_zone = "America/New_York";
auth_providers = [
{ type = "trusted_networks";
trusted_networks = ["0.0.0.0/0"];
allow_bypass_login = true;
}
{ type = "homeassistant"; }
];
};
default_config = {};
met = {};
http = {};
};
lovelaceConfig = {
title = "Home";
views = [
{
path = "default_view";
title = "Home";
cards = [
{
type = "light";
entity = "light.shellydimmer2_e8db84d4833d";
name = "Akhil's Bedroom Light";
}
{
type = "sensor";
entity = "sensor.shellydimmer2_e8db84d4833d_device_temperature";
name = "Shelly Temperature";
graph = "line";
}
{
type = "weather-forecast";
entity = "weather.home";
show_forecast = true;
}
];
}
];
};
};
}