2024-01-11 14:51:11 +01:00
|
|
|
|
# Edit this configuration file to define what should be installed on
|
|
|
|
|
# your system. Help is available in the configuration.nix(5) man page
|
|
|
|
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
2024-01-08 15:58:04 +01:00
|
|
|
|
{
|
2024-01-11 23:51:46 +01:00
|
|
|
|
inputs,
|
|
|
|
|
outputs,
|
|
|
|
|
lib,
|
2024-01-08 15:58:04 +01:00
|
|
|
|
config,
|
|
|
|
|
pkgs,
|
|
|
|
|
...
|
|
|
|
|
}: {
|
2024-01-08 16:24:38 +01:00
|
|
|
|
imports = [
|
2024-01-12 00:08:07 +01:00
|
|
|
|
inputs.home-manager.nixosModules.home-manager
|
|
|
|
|
|
2024-01-08 16:24:38 +01:00
|
|
|
|
./hardware-configuration.nix
|
2024-01-30 12:03:29 +01:00
|
|
|
|
|
2024-02-22 13:06:08 +01:00
|
|
|
|
# Import shared configurations
|
|
|
|
|
../../shared
|
2024-12-02 20:44:03 +01:00
|
|
|
|
# ../../../disko/wheatley
|
2024-12-03 01:05:20 +01:00
|
|
|
|
inputs.nixos-hardware.nixosModules.raspberry-pi-4
|
2024-01-08 16:24:38 +01:00
|
|
|
|
];
|
|
|
|
|
|
2024-01-11 14:51:11 +01:00
|
|
|
|
boot.loader.generic-extlinux-compatible.enable = true;
|
2024-01-16 12:29:40 +01:00
|
|
|
|
boot.loader.generic-extlinux-compatible.configurationLimit = 5;
|
2024-01-11 14:51:11 +01:00
|
|
|
|
boot.loader.grub.enable = false;
|
2024-01-14 16:07:44 +01:00
|
|
|
|
boot.tmp.cleanOnBoot = true;
|
2024-01-11 14:51:11 +01:00
|
|
|
|
|
2024-01-12 00:15:08 +01:00
|
|
|
|
# boot.extraModulePackages = [
|
|
|
|
|
# (pkgs.callPackage ./rtl8189es.nix {
|
|
|
|
|
# kernel = config.boot.kernelPackages.kernel;
|
|
|
|
|
# })
|
|
|
|
|
# ];
|
2024-01-08 16:24:38 +01:00
|
|
|
|
nixpkgs = {
|
|
|
|
|
# You can add overlays here
|
|
|
|
|
overlays = [
|
2024-12-03 00:33:20 +01:00
|
|
|
|
(final: super: {
|
|
|
|
|
makeModulesClosure = x:
|
|
|
|
|
super.makeModulesClosure (x // {allowMissing = true;});
|
|
|
|
|
})
|
2024-01-08 16:24:38 +01:00
|
|
|
|
];
|
|
|
|
|
# Configure your nixpkgs instance
|
|
|
|
|
config = {
|
|
|
|
|
# Disable if you don't want unfree packages
|
|
|
|
|
allowUnfree = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-01-08 15:58:04 +01:00
|
|
|
|
|
2024-12-03 00:33:20 +01:00
|
|
|
|
hardware.raspberry-pi."4".fkms-3d.enable = true;
|
|
|
|
|
|
2024-01-12 17:21:29 +01:00
|
|
|
|
sops.defaultSopsFile = ./secrets/sops.yaml;
|
|
|
|
|
|
|
|
|
|
sops.secrets."wireless.env".mode = "0440";
|
|
|
|
|
sops.secrets."wireless.env".owner = config.users.users.root.name;
|
|
|
|
|
|
2024-01-08 15:58:04 +01:00
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
age
|
|
|
|
|
git
|
2024-01-16 09:56:38 +01:00
|
|
|
|
htop
|
2024-12-03 00:33:20 +01:00
|
|
|
|
libraspberrypi
|
2024-01-08 15:58:04 +01:00
|
|
|
|
];
|
|
|
|
|
|
2024-01-11 14:51:11 +01:00
|
|
|
|
boot.kernelParams = [
|
|
|
|
|
"console=ttyS0,115200n8"
|
|
|
|
|
];
|
|
|
|
|
|
2024-01-08 16:24:38 +01:00
|
|
|
|
nix = {
|
|
|
|
|
gc = {
|
|
|
|
|
automatic = true;
|
|
|
|
|
dates = "weekly";
|
|
|
|
|
options = "--delete-older-than 7d";
|
|
|
|
|
};
|
|
|
|
|
# This will add each flake input as a registry
|
|
|
|
|
# To make nix3 commands consistent with your flake
|
|
|
|
|
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
|
|
|
|
|
|
|
|
|
|
# This will additionally add your inputs to the system's legacy channels
|
|
|
|
|
# Making legacy nix commands consistent as well, awesome!
|
|
|
|
|
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
|
|
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
|
# Enable flakes and new 'nix' command
|
|
|
|
|
experimental-features = "nix-command flakes";
|
|
|
|
|
# Deduplicate and optimize nix store
|
|
|
|
|
auto-optimise-store = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-01-11 14:51:11 +01:00
|
|
|
|
|
2024-01-12 17:21:29 +01:00
|
|
|
|
networking.wireless.enable = true;
|
2024-12-03 00:33:20 +01:00
|
|
|
|
networking.networkmanager.wifi.powersave = false;
|
2024-12-02 20:44:03 +01:00
|
|
|
|
# networking.wireless.environmentFile = config.sops.secrets."wireless.env".path;
|
|
|
|
|
# networking.wireless.networks."KPNAA6306" = {
|
|
|
|
|
# hidden = true;
|
|
|
|
|
# auth = ''
|
|
|
|
|
# key_mgmt=WPA-PSK
|
|
|
|
|
# password="@PSK_HOME@"
|
|
|
|
|
# '';
|
|
|
|
|
# };
|
2024-01-12 17:21:29 +01:00
|
|
|
|
|
2024-01-08 15:58:04 +01:00
|
|
|
|
networking.firewall.enable = true;
|
|
|
|
|
|
2024-01-12 16:58:45 +01:00
|
|
|
|
networking.firewall = {
|
2024-12-02 20:44:03 +01:00
|
|
|
|
allowedTCPPorts = [22 80 443 5335 8080 46899 46898];
|
|
|
|
|
allowedUDPPorts = [5335 46899 46898];
|
2024-01-12 16:58:45 +01:00
|
|
|
|
};
|
2024-01-08 15:58:04 +01:00
|
|
|
|
# Set your time zone.
|
|
|
|
|
time.timeZone = "Europe/Amsterdam";
|
|
|
|
|
|
|
|
|
|
programs.zsh = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
programs.git = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
home-manager = {
|
|
|
|
|
extraSpecialArgs = {inherit inputs outputs;};
|
|
|
|
|
users = {
|
|
|
|
|
# Import your home-manager configuration
|
2024-02-07 13:52:23 +01:00
|
|
|
|
lillian = import ../../../home-manager/hosts/wheatley;
|
2024-01-08 15:58:04 +01:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2024-01-11 14:51:11 +01:00
|
|
|
|
networking.hostName = "wheatley"; # Define your hostname
|
|
|
|
|
|
2024-12-03 00:33:20 +01:00
|
|
|
|
boot.kernelPackages = lib.mkForce pkgs.linuxKernel.packages.linux_rpi4;
|
|
|
|
|
boot.supportedFilesystems = lib.mkForce ["vfat" "btrfs" "tmpfs"];
|
2024-01-14 15:58:21 +01:00
|
|
|
|
networking.wireless.interfaces = ["enu1u1"];
|
2024-01-11 14:51:11 +01:00
|
|
|
|
|
|
|
|
|
# powerManagement.cpuFreqGovernor = "powersave";
|
|
|
|
|
powerManagement.cpufreq.max = 648000;
|
2024-01-08 15:58:04 +01:00
|
|
|
|
|
2024-01-11 14:51:11 +01:00
|
|
|
|
# This value determines the NixOS release with which your system is to be
|
|
|
|
|
# compatible, in order to avoid breaking some software such as database
|
|
|
|
|
# servers. You should change this only after NixOS release notes say you
|
|
|
|
|
# should.
|
|
|
|
|
system.stateVersion = "unstable"; # Did you read the comment?
|
2024-01-08 15:58:04 +01:00
|
|
|
|
}
|