|
| 1 | +# |
| 2 | +# nixos/arm/pi5-1-os |
| 3 | +# |
| 4 | + |
| 5 | +#{ config, lib, pkgs, ... }: |
| 6 | +{ inputs, config, lib, pkgs, ... }: |
| 7 | + |
| 8 | +{ |
| 9 | + imports = [ |
| 10 | + #./hardware-configuration.nix |
| 11 | + ./il8n.nix |
| 12 | + ./nodeExporter.nix |
| 13 | + ./hosts.nix |
| 14 | + ./docker-daemon.nix |
| 15 | + ]; |
| 16 | + |
| 17 | + # Use the GRUB 2 boot loader. |
| 18 | + #boot.loader.grub.enable = false; |
| 19 | + # boot.loader.grub.efiSupport = true; |
| 20 | + # boot.loader.grub.efiInstallAsRemovable = true; |
| 21 | + # boot.loader.efi.efiSysMountPoint = "/boot/efi"; |
| 22 | + # Define on which hard drive you want to install Grub. |
| 23 | + # boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only |
| 24 | + # Enables the generation of /boot/extlinux/extlinux.conf |
| 25 | + #boot.loader.generic-extlinux-compatible.enable = true; |
| 26 | + |
| 27 | + #boot.loader.efi.canTouchEfiVariables = false; |
| 28 | + |
| 29 | + # kernel comes from the community package |
| 30 | + # https://nixos.wiki/wiki/Linux_kernel |
| 31 | + #boot.kernelPackages = pkgs.linuxPackages; |
| 32 | + #boot.kernelPackages = pkgs.linuxPackages_latest; |
| 33 | + #boot.kernelPackages = pkgs.linuxPackages_rpi5; |
| 34 | + #boot.kernelPackages = (import (builtins.fetchTarball https://gitlab.com/vriska/nix-rpi5/-/archive/main.tar.gz)).legacyPackages.aarch64-linux.linuxPackages_rpi5; |
| 35 | + |
| 36 | + nix = { |
| 37 | + gc = { |
| 38 | + automatic = true; # Enable automatic execution of the task |
| 39 | + dates = "weekly"; # Schedule the task to run weekly |
| 40 | + options = "--delete-older-than 10d"; # Specify options for the task: delete files older than 10 days |
| 41 | + randomizedDelaySec = "14m"; # Introduce a randomized delay of up to 14 minutes before executing the task |
| 42 | + }; |
| 43 | + settings = { |
| 44 | + auto-optimise-store = true; |
| 45 | + experimental-features = [ "nix-command" "flakes" ]; |
| 46 | + # https://gitlab.com/engmark/root/-/merge_requests/785/diffs |
| 47 | + download-buffer-size = "500000000"; |
| 48 | + }; |
| 49 | + }; |
| 50 | + |
| 51 | + networking.hostName = "pi5-1"; |
| 52 | + |
| 53 | + networking.networkmanager.enable = false; |
| 54 | + |
| 55 | + services.lldpd.enable = true; |
| 56 | + services.avahi = { |
| 57 | + enable = true; |
| 58 | + nssmdns4 = true; |
| 59 | + ipv4 = true; |
| 60 | + ipv6 = true; |
| 61 | + openFirewall = true; |
| 62 | + }; |
| 63 | + # Pick only one of the below networking options. |
| 64 | + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. |
| 65 | + # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. |
| 66 | + |
| 67 | + time.timeZone = "America/Los_Angeles"; |
| 68 | + |
| 69 | + # Configure network proxy if necessary |
| 70 | + # networking.proxy.default = "http://user:password@proxy:port/"; |
| 71 | + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; |
| 72 | + |
| 73 | + # Select internationalisation properties. |
| 74 | + i18n.defaultLocale = "en_US.UTF-8"; |
| 75 | + # console = { |
| 76 | + # font = "Lat2-Terminus16"; |
| 77 | + # keyMap = "us"; |
| 78 | + # useXkbConfig = true; # use xkb.options in tty. |
| 79 | + # }; |
| 80 | + |
| 81 | + # Enable the X11 windowing system. |
| 82 | + # services.xserver.enable = true; |
| 83 | + |
| 84 | + # Configure keymap in X11 |
| 85 | + # services.xserver.xkb.layout = "us"; |
| 86 | + # services.xserver.xkb.options = "eurosign:e,caps:escape"; |
| 87 | + |
| 88 | + # Enable CUPS to print documents. |
| 89 | + # services.printing.enable = true; |
| 90 | + |
| 91 | + users.users.das = { |
| 92 | + isNormalUser = true; |
| 93 | + description = "das"; |
| 94 | + extraGroups = [ "wheel" "networkmanager" "kvm" "libvirtd" "docker" "video" ]; |
| 95 | + # users.extraGroups.docker.members = [ "das" ]; |
| 96 | + packages = with pkgs; [ |
| 97 | + ]; |
| 98 | + # https://nixos.wiki/wiki/SSH_public_key_authentication |
| 99 | + openssh.authorizedKeys.keys = [ |
| 100 | + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGMCFUMSCFJX95eLfm7P9r72NBp9I1FiXwNwJ+x/HGPV das@t" |
| 101 | + ]; |
| 102 | + }; |
| 103 | + |
| 104 | + environment.sessionVariables = { |
| 105 | + TERM = "xterm-256color"; |
| 106 | + #MY_VARIABLE = "my-value"; |
| 107 | + #ANOTHER_VARIABLE = "another-value"; |
| 108 | + }; |
| 109 | + |
| 110 | + # List packages installed in system profile. To search, run: |
| 111 | + # $ nix search wget |
| 112 | + environment.systemPackages = with pkgs; [ |
| 113 | + vim |
| 114 | + wget |
| 115 | + htop |
| 116 | + btop |
| 117 | + neofetch |
| 118 | + tcpdump |
| 119 | + iproute2 |
| 120 | + hw-probe |
| 121 | + lshw |
| 122 | + gnumake |
| 123 | + ]; |
| 124 | + |
| 125 | + # Some programs need SUID wrappers, can be configured further or are |
| 126 | + # started in user sessions. |
| 127 | + # programs.mtr.enable = true; |
| 128 | + # programs.gnupg.agent = { |
| 129 | + # enable = true; |
| 130 | + # enableSSHSupport = true; |
| 131 | + # }; |
| 132 | + |
| 133 | + # List services that you want to enable: |
| 134 | + |
| 135 | + # Enable the OpenSSH daemon. |
| 136 | + services.openssh.enable = true; |
| 137 | + |
| 138 | + services.timesyncd.enable = true; |
| 139 | + |
| 140 | + services.fstrim.enable = true; |
| 141 | + |
| 142 | + # Open ports in the firewall. |
| 143 | + # networking.firewall.allowedTCPPorts = [ ... ]; |
| 144 | + # networking.firewall.allowedUDPPorts = [ ... ]; |
| 145 | + # Or disable the firewall altogether. |
| 146 | + # networking.firewall.enable = false; |
| 147 | + |
| 148 | + # Copy the NixOS configuration file and link it from the resulting system |
| 149 | + # (/run/current-system/configuration.nix). This is useful in case you |
| 150 | + # accidentally delete configuration.nix. |
| 151 | + # system.copySystemConfiguration = true; |
| 152 | + |
| 153 | + # This option defines the first version of NixOS you have installed on this particular machine, |
| 154 | + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. |
| 155 | + # |
| 156 | + # Most users should NEVER change this value after the initial install, for any reason, |
| 157 | + # even if you've upgraded your system to a new NixOS release. |
| 158 | + # |
| 159 | + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, |
| 160 | + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how |
| 161 | + # to actually do that. |
| 162 | + # |
| 163 | + # This value being lower than the current NixOS release does NOT mean your system is |
| 164 | + # out of date, out of support, or vulnerable. |
| 165 | + # |
| 166 | + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, |
| 167 | + # and migrated your data accordingly. |
| 168 | + # |
| 169 | + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . |
| 170 | + nixpkgs.config.allowUnfree = true; |
| 171 | + system.stateVersion = "24.11"; # Did you read the comment? |
| 172 | + |
| 173 | +} |
| 174 | + |
0 commit comments