Commit 4addc337 authored by fpletz's avatar fpletz 🚧
Browse files

luftschleuse: fix boot, add dnsmasq for wifi

parent 6ffac2cf
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
imports = [ boot = {
"${fetchTarball "https://github.com/NixOS/nixos-hardware/archive/9886a06e4745edb31587d0e9481ad82d35f0d593.tar.gz"}/raspberry-pi/4" loader = {
]; grub.enable = false;
generic-extlinux-compatible.enable = true;
};
initrd.availableKernelModules = [ "vc4" ];
kernelParams = [ "console=tty0" ];
};
hardware.enableRedistributableFirmware = false;
hardware.firmware = [ pkgs.firmwareLinuxNonfree ];
fileSystems = { fileSystems = {
"/" = { "/" = {
...@@ -18,6 +26,10 @@ ...@@ -18,6 +26,10 @@
useNetworkd = true; useNetworkd = true;
useDHCP = false; useDHCP = false;
interfaces.eth0.useDHCP = true; interfaces.eth0.useDHCP = true;
interfaces.wlan0 = {
ipv4.addresses = [ { address = "192.168.2.2"; prefixLength = 24; } ];
};
firewall.trustedInterfaces = [ "wlan0" "eth0" ];
}; };
systemd.network.networks."40-eth0" = { systemd.network.networks."40-eth0" = {
...@@ -26,11 +38,6 @@ ...@@ -26,11 +38,6 @@
boot.tmpOnTmpfs = true; boot.tmpOnTmpfs = true;
zramSwap = {
enable = true;
memoryPercent = 100;
};
environment.systemPackages = with pkgs; [ colmena lm_sensors ]; environment.systemPackages = with pkgs; [ colmena lm_sensors ];
users = { users = {
...@@ -40,14 +47,24 @@ ...@@ -40,14 +47,24 @@
]; ];
}; };
services.dnsmasq = {
enable = true;
extraConfig = ''
bind-interfaces
interface=wlan0
bogus-priv
no-resolv
dhcp-range=192.168.2.10,192.168.2.200,1h
no-ping
'';
};
services.hostapd = { services.hostapd = {
enable = true; enable = true;
interface = "wlan0";
countryCode = "DE"; countryCode = "DE";
ssid = "luftschleuse3"; ssid = "luftschleuse3";
channel = 7; channel = 7;
wpa = false; wpa = false;
extraConfig = ''
auth_alg=0
'';
}; };
} }
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
wget curl htop iftop tmux tcpdump rsync git wget curl htop iftop tmux tcpdump rsync git
alacritty.terminfo alacritty.terminfo
]; ];
documentation.nixos.enable = false;
programs.bash.enableCompletion = true; programs.bash.enableCompletion = true;
programs.vim.defaultEditor = true; programs.vim.defaultEditor = true;
programs.zsh.enable = true; programs.zsh.enable = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment