Nix Flakes configuration for MacOS, NixOS and WSL
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

wip: minecraft server

+64 -45
+1 -1
README.md
··· 35 35 | :----------- | :-------------------------------- | :------------------- | :---------------- | :--: | :-: | :------: | :----: | 36 36 | `hydrogen` | ASUS ROG STRIX B760-I GAMING WIFI | Intel i5 13600kf | Nvidia 4070ti | 32Go | ❄️ | 🎮️ | 🟢️ | 37 37 | `helium` | - | Apple M2 Pro | Apple M2 Pro | 32Go | 🍎️ | ⌨️ | 🟢️ | 38 - | `lithium` | Raspberry Pi4 b+ | - | - | 1Go | ❄️ | 🧨️ | 🟠 | 38 + | `lithium` | Raspberry Pi3 b+ | - | - | 1Go | ❄️ | 🧨️ | 🟠 | 39 39 | `beryllium` | WSL | - | - | 8Go | ❄️ | ⌨️ | 🟢️ | 40 40 | `boron` | Aorus B450 Elite | AMD Ryzen 3 3300X | Nvidia 1060 | 16Go | ❄️ | 🎮️ / ⌨️ | 🔴 | 41 41 | `carbon` | HP ProDesk 400 G1 DM | Intel Pentium G3250T | - | 8Go | ❄️ | 💾️ | 🔴 |
+1
config/darwin/helium/homebrew/casks.nix
··· 11 11 "font-hack-nerd-font" # move this to nix installation 12 12 "1password" 13 13 "discord" # use this one since nixpkgs doesn't have krisp 14 + "modrinth" 14 15 ]; 15 16 }
+62 -44
config/nixos/lithium/default.nix
··· 1 - { self, inputs, pkgs, hostname, ... }: 1 + { config, pkgs, inputs, lib, hostname,... }: 2 2 { 3 - # Force update to the last linux kernel avalaible 4 - boot.kernelPackages = pkgs.linuxPackages_latest; 3 + imports = [ 4 + # Raspberry Pi 3 hardware module 5 + inputs.hardware.nixosModules.raspberry-pi-3 6 + ]; 7 + 8 + # Disable some modules 9 + disabledModules = [ "profiles/base.nix" ]; 10 + 11 + # Used to build image/version 12 + nixpkgs.hostPlatform.system = "aarch64-linux"; 13 + 14 + # Allow licensed firmware to be update 15 + hardware.enableRedistributableFirmware = true; 5 16 6 - # Special hardware config for raspberry 7 - hardware = { 8 - raspberry-pi."4".apply-overlays-dtmerge.enable = true; 9 - raspberry-pi."4".fkms-3d.enable = true; # Enable hardware acceleration 10 - deviceTree = { 11 - enable = true; 12 - filter = "*rpi-4-*.dtb"; 13 - }; 14 - }; 17 + # Early boot 18 + boot.initrd.kernelModules = [ "vc4" "bcm2835_dma" "i2c_bcm2835" ]; 15 19 16 - # Networking configuration 17 - # networking.networkmanager.enable = true; 20 + # Network 18 21 networking.hostName = hostname; 19 - networking.interfaces."wlan0".useDHCP = true; 20 - networking.wireless = { 21 - enable = true; 22 - interfaces = [ "wlan0" ]; 23 - }; 24 22 25 - users.users."rpi" = { 26 - isNormalUser = true; 27 - extraGroups = [ "wheel" ]; 28 - hashedPassword = "$y$j9T$rg0syrPPtjaLILPTTplI3/$5uykqP9tXjAsvOocbfosUeN6j6dMrHRUtwudKd4QaA5"; # password generated with `mkpasswd` command 23 + # Time 24 + time.timeZone = "Europe/Paris"; 29 25 30 - # User wide packages 31 - packages = []; 32 - }; 26 + # Enable ssh 27 + services.openssh.enable = true; 28 + 33 29 34 - # System wide packages 30 + # Auto login to magnetis user on startup 31 + services.displayManager.autoLogin.enable = true; 32 + services.displayManager.autoLogin.user = "magnetis"; 33 + services.getty.autologinUser = "magnetis"; 34 + 35 + # Environment wide packages 35 36 environment.systemPackages = with pkgs; [ 36 37 libraspberrypi 37 - raspberrypi-eeprom 38 + git 38 39 ]; 39 40 40 - # Garbage collector 41 - nix.gc = { 42 - automatic = true; 43 - dates = "weekly"; 44 - options = "--delete-older-than 7d"; 41 + # Configure users 42 + users.mutableUsers = true; 43 + users.users.cosmeak = { 44 + isNormalUser = true; 45 + extraGroups = [ "networkmanager" "wheel" ]; # wheel = admin 45 46 }; 46 47 47 - nix.settings = { 48 - auto-optimise-store = true; # Related to garbage collector 49 - experimental-features = "nix-command flakes"; # Enable flakes 48 + # Nix settings 49 + nix.settings.experimental-features = "nix-command flakes"; 50 + 51 + # Perform garbage collection weekly to maintain low disk usage 52 + gems.system.garbageCollector.enable = true; 53 + gems.system.autoUpdate.enable = false; 54 + 55 + # Optimize storage 56 + nix.settings.auto-optimise-store = true; 57 + 58 + # Minecraft Server 59 + services.minecraft-server = { 60 + enable = true; 61 + eula = true; 62 + openFirewall = true; # Opens the port the server is running on (by default 25565) 63 + declarative = true; 64 + serverProperties = { 65 + difficulty = 3; 66 + gamemode = 1; 67 + max-players = 5; 68 + motd = "NixOS Minecraft server!"; 69 + white-list = false; 70 + }; 50 71 }; 51 72 52 - # "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" creates a 53 - # disk with this label on first boot. Therefore, we need to keep it. It is the 54 - # only information from the installer image that we need to keep persistent 55 - fileSystems."/" = { 56 - device = "/dev/disk/by-label/NIXOS_SD"; 57 - fsType = "ext4"; 58 - }; 73 + # Swap file 74 + swapDevices = [{ 75 + device = "/swapfile"; 76 + size = 1024; # 1GB 77 + }]; 59 78 60 79 # This value determines the NixOS release from which the default 61 80 # settings for stateful data, like file locations and database versions ··· 63 82 # this value at the release version of the first install of this system. 64 83 # Before changing this value read the documentation for this option 65 84 # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). 66 - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion 67 85 system.stateVersion = "24.11"; # Did you read the comment? 68 86 }