-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpiConfiguration.nix
114 lines (99 loc) · 2.54 KB
/
piConfiguration.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
{ pkgs, user, ... }:
{
imports = [ (./. + "/hardware/${user.host}" + "/hardware-configuration.nix") ];
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
nix.extraOptions = "experimental-features = nix-command flakes";
nixpkgs.buildPlatform = {
config = "x86_64-unknown-linux-gnu";
system = "x86_64-linux";
};
networking.hostName = "munin";
networking.wireless.enable = true;
networking.wireless.interfaces = [ "wlan0" ];
networking.wireless.networks.${user.network1}.psk = user.psk;
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [
21
80
443
];
networking.firewall.allowedTCPPortRanges = [
{
from = 51000;
to = 51999;
}
];
time.timeZone = "Europe/Paris";
security.sudo.wheelNeedsPassword = false;
users.users.vhs = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBhw5g6xfxbwPcjThdsTYAk6fH/juhIXameVa21j+seG ${user.email}"
];
};
programs.vim.defaultEditor = true;
# gpg
services.pcscd.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryFlavor = "gtk2";
};
services.openssh.enable = true;
services.openssh.settings.PasswordAuthentication = true;
services.vsftpd = {
enable = true;
writeEnable = true;
localRoot = "/home/vhs/Data";
localUsers = true;
userlist = [ "vhs" ];
extraConfig = ''
pasv_enable=Yes
pasv_min_port=51000
pasv_max_port=51999
'';
};
services.bbrf = {
enable = true;
user = "vhs";
faderValue = 60;
port = 8898;
};
services.nginx = {
enable = true;
virtualHosts = {
localhost = {
forceSSL = false;
enableACME = false;
locations."/" = {
proxyPass = "http://localhost:8898";
};
};
};
};
environment.variables.EDITOR = "vim";
environment.systemPackages = with pkgs; [
vim
wget
git
curl
];
systemd.services.mount-drive-2010 = {
enable = true;
after = [ "local-fs.target" ];
serviceConfig = {
ExecStart = "${pkgs.util-linux}/bin/mount /dev/disk/by-label/DRIVE2010 /home/vhs/Data/Drive2010";
ExecStartPre = "${pkgs.coreutils}/bin/sleep 50";
Type = "oneshot";
RemainAfterExit = true;
};
};
systemd.timers.mount-drive-2010 = {
wantedBy = [ "timers.target" ];
timerConfig.OnBootSec = "2min";
timerConfig.Unit = "test";
};
system.stateVersion = "23.05";
}