130 lines
3.4 KiB
Nix
130 lines
3.4 KiB
Nix
# Edit this configuration file to define what should be installed on
|
||
# your system. Help is available in the configuration.nix(5) man page, on
|
||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||
|
||
{
|
||
config,
|
||
lib,
|
||
pkgs,
|
||
...
|
||
}:
|
||
|
||
let
|
||
user = "matt";
|
||
password = "$y$j9T$EkPXmsmIMFFZ.WRrBYCxS1$P0kwo6e4.WM5DsqUcEqWC3MrZp5KfCjxffraMFZWu06";
|
||
SSID = "Joey’s Jungle";
|
||
SSIDpassword = "kR8v&3Qd";
|
||
interface = "wlan0";
|
||
timezone = "America/Chicago";
|
||
hostname = "pi4";
|
||
in
|
||
{
|
||
imports = [
|
||
# Include the results of the hardware scan.
|
||
./hardware-configuration.nix
|
||
../default.nix
|
||
];
|
||
|
||
# Enable nix flakes and nix-command tools
|
||
nix.settings.experimental-features = [
|
||
"nix-command"
|
||
"flakes"
|
||
];
|
||
|
||
nix.settings.trusted-users = [ "@wheel" ];
|
||
|
||
boot = {
|
||
kernelPackages = pkgs.linuxPackages_latest;
|
||
initrd.availableKernelModules = [
|
||
"xhci_pci"
|
||
"usbhid"
|
||
"usb_storage"
|
||
];
|
||
loader = {
|
||
systemd-boot.enable = true;
|
||
generic-extlinux-compatible.enable = lib.mkForce false;
|
||
};
|
||
# kernelParams = [
|
||
# "snd_bcm2835.enable_hdmi=1"
|
||
# ];
|
||
};
|
||
|
||
# hardware = {
|
||
# raspberry-pi."4".fkms-3d.enable = true;
|
||
# raspberry-pi."4".apply-overlays-dtmerge.enable = true;
|
||
# raspberry-pi."4".audio.enable = true;
|
||
# deviceTree = {
|
||
# enable = true;
|
||
# filter = "*rpi-4-*.dtb";
|
||
# };
|
||
# pulseaudio.enable = true;
|
||
# };
|
||
|
||
# Set your time zone.
|
||
time.timeZone = timezone;
|
||
|
||
sound.enable = true;
|
||
|
||
networking = {
|
||
hostName = hostname;
|
||
wireless = {
|
||
enable = true;
|
||
networks."${SSID}".psk = SSIDpassword;
|
||
interfaces = [ interface ];
|
||
};
|
||
};
|
||
|
||
systemd.services.btattach = {
|
||
before = [ "bluetooth.service" ];
|
||
after = [ "dev-ttyAMA0.device" ];
|
||
wantedBy = [ "multi-user.target" ];
|
||
serviceConfig = {
|
||
ExecStart = "${pkgs.bluez}/bin/btattach -B /dev/ttyAMA0 -P bcm -S 3000000";
|
||
};
|
||
};
|
||
|
||
environment.systemPackages = with pkgs; [
|
||
vim
|
||
libraspberrypi
|
||
raspberrypi-eeprom
|
||
htop
|
||
git
|
||
];
|
||
|
||
services.openssh.enable = true;
|
||
|
||
users = {
|
||
mutableUsers = false;
|
||
users."${user}" = {
|
||
isNormalUser = true;
|
||
initialHashedPassword = password;
|
||
extraGroups = [
|
||
"wheel"
|
||
"docker"
|
||
];
|
||
shell = pkgs.zsh;
|
||
};
|
||
};
|
||
|
||
virtualisation.docker.enable = true;
|
||
|
||
# This option defines the first version of NixOS you have installed on this particular machine,
|
||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||
#
|
||
# Most users should NEVER change this value after the initial install, for any reason,
|
||
# even if you've upgraded your system to a new NixOS release.
|
||
#
|
||
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
||
# to actually do that.
|
||
#
|
||
# This value being lower than the current NixOS release does NOT mean your system is
|
||
# out of date, out of support, or vulnerable.
|
||
#
|
||
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||
# and migrated your data accordingly.
|
||
#
|
||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||
system.stateVersion = "24.05"; # Did you read the comment?
|
||
}
|