From ad5107997bf30c3064e1129c10b991aeada47460 Mon Sep 17 00:00:00 2001 From: nyxerinys Date: Wed, 14 Oct 2026 11:19:59 -0500 Subject: [PATCH 1/2] add python --- hosts/servers/iris/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/servers/iris/default.nix b/hosts/servers/iris/default.nix index 8ba9eab..f567054 100644 --- a/hosts/servers/iris/default.nix +++ b/hosts/servers/iris/default.nix @@ -13,6 +13,7 @@ environment.systemPackages = with pkgs; [ swiftpm + python3 ]; boot.initrd.availableKernelModules = [ "usbhid" ]; From b6117d062b214736bf667e0de919f78f79083c42 Mon Sep 17 00:00:00 2001 From: nyxerinys Date: Fri, 16 Oct 2026 21:25:19 -0500 Subject: [PATCH 2/2] rpi --- flake.lock | 103 +++++++++++++++++++++++++++++++++ flake.nix | 15 ++++- hosts/artemis/default.nix | 1 + hosts/servers/iris/default.nix | 53 ++++++++++++++--- 4 files changed, 162 insertions(+), 10 deletions(-) diff --git a/flake.lock b/flake.lock index d31f48b..9df9dfa 100644 --- a/flake.lock +++ b/flake.lock @@ -33,6 +33,22 @@ "type": "github" } }, + "argononed": { + "flake": false, + "locked": { + "lastModified": 1729566243, + "narHash": "sha256-DPNI0Dpk5aym3Baf5UbEe5GENDrSmmXVdriRSWE+rgk=", + "owner": "nvmd", + "repo": "argononed", + "rev": "16dbee54d49b66d5654d228d1061246b440ef7cf", + "type": "github" + }, + "original": { + "owner": "nvmd", + "repo": "argononed", + "type": "github" + } + }, "brew-src": { "flake": false, "locked": { @@ -66,6 +82,21 @@ "type": "github" } }, + "flake-compat_2": { + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -594,6 +625,76 @@ "type": "github" } }, + "nixos-hardware": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1791721963, + "narHash": "sha256-BYhx89XJltnRyQeuDKHVL5eSqbbfAcOKuDts7QRsrxQ=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "60a624466c08787ee8303393b7d4752d1826f14f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixos-hardware", + "type": "github" + } + }, + "nixos-images": { + "inputs": { + "nixos-stable": [ + "nixos-raspberrypi", + "nixpkgs" + ], + "nixos-unstable": [ + "nixos-raspberrypi", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1747747741, + "narHash": "sha256-LUOH27unNWbGTvZFitHonraNx0JF/55h30r9WxqrznM=", + "owner": "nvmd", + "repo": "nixos-images", + "rev": "cbbd6db325775096680b65e2a32fb6187c09bbb4", + "type": "github" + }, + "original": { + "owner": "nvmd", + "ref": "sdimage-installer", + "repo": "nixos-images", + "type": "github" + } + }, + "nixos-raspberrypi": { + "inputs": { + "argononed": "argononed", + "flake-compat": "flake-compat_2", + "nixos-images": "nixos-images", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1785596452, + "narHash": "sha256-KT/OleUMpSKsWgi0eTuqS/0GD4ucPQcvLgmvlw8ZuCM=", + "owner": "nvmd", + "repo": "nixos-raspberrypi", + "rev": "7e39508bcf9c1da82cf11c1e22f74f9d9fd0fe10", + "type": "github" + }, + "original": { + "owner": "nvmd", + "ref": "main", + "repo": "nixos-raspberrypi", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1790822859, @@ -679,6 +780,8 @@ "hyprland-plugins": "hyprland-plugins", "nix-darwin": "nix-darwin", "nix-homebrew": "nix-homebrew", + "nixos-hardware": "nixos-hardware", + "nixos-raspberrypi": "nixos-raspberrypi", "nixpkgs": "nixpkgs_2", "nur": "nur", "secrets": "secrets", diff --git a/flake.nix b/flake.nix index 59b399f..0a79388 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,11 @@ inputs = { # Nix main stuff - nixpkgs = { url = "github:nixos/nixpkgs/nixos-26.05"; }; + nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05"; + nixos-hardware = { + url = "github:NixOS/nixos-hardware"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nur = { url = "github:nix-community/NUR"; inputs.nixpkgs.follows = "nixpkgs"; @@ -48,6 +52,10 @@ url = "github:zjeffer/split-monitor-workspaces"; flake = false; }; + nixos-raspberrypi = { + url = "github:nvmd/nixos-raspberrypi/main"; + inputs.nixpkgs.follows = "nixpkgs"; + }; # secrets sops-nix = { @@ -60,7 +68,7 @@ }; }; - outputs = { self, nixpkgs, nix-darwin, home-manager, ... } @ inputs: + outputs = { self, nixpkgs, nix-darwin, nixos-raspberrypi, home-manager, ... } @ inputs: let blades = import ./hosts/servers/blades/systems.nix { inherit inputs; }; in @@ -75,10 +83,11 @@ ]; specialArgs = { inherit inputs; }; }; - iris = nixpkgs.lib.nixosSystem { + iris = nixos-raspberrypi.lib.nixosSystem { modules = [ ./hosts/base.nix ./hosts/servers/iris + nixos-raspberrypi.nixosModules.raspberry-pi-3.base ]; specialArgs = { inherit inputs; }; }; diff --git a/hosts/artemis/default.nix b/hosts/artemis/default.nix index 438d78b..1408426 100644 --- a/hosts/artemis/default.nix +++ b/hosts/artemis/default.nix @@ -50,6 +50,7 @@ cores = 6; }; }; + systems = [ "aarch64-linux" ]; }; # Necessary for using flakes on this system. diff --git a/hosts/servers/iris/default.nix b/hosts/servers/iris/default.nix index f567054..4ae8e24 100644 --- a/hosts/servers/iris/default.nix +++ b/hosts/servers/iris/default.nix @@ -8,25 +8,64 @@ networking.hostName = "iris"; + system.nixos.tags = let + cfg = config.boot.loader.raspberry-pi; + in [ + "raspberry-pi-${cfg.variant}" + cfg.bootloader + config.boot.kernelPackages.kernel.version + ]; + boot.loader.grub.enable = false; - boot.loader.generic-extlinux-compatible.enable = true; + boot.loader.raspberry-pi.bootloader = "kernel"; environment.systemPackages = with pkgs; [ swiftpm - python3 + (python3.withPackages (ps: with ps; [ gpiozero rpi-gpio ])) ]; + services.udev.extraRules = '' + SUBSYSTEM=="gpio", KERNEL=="gpiochip*", GROUP="gpio", MODE="0660" + SUBSYSTEM=="gpiomem", GROUP="gpio", MODE="0660" + ''; + nix.settings = { + substituters = [ + "https://nixos-raspberrypi.cachix.org" + ]; + trusted-public-keys = [ + "nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI=" + ]; + }; + + users.groups.gpio = {}; + users.users.nyxerinys.extraGroups = [ "gpio" ]; + + boot.supportedFilesystems.zfs = false; boot.initrd.availableKernelModules = [ "usbhid" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-label/NIXOS_SD"; + fsType = "ext4"; + }; - swapDevices = [ ]; + fileSystems."/boot/firmware" = { + device = "/dev/disk/by-label/FIRMWARE"; + fsType = "vfat"; + options = [ + "nofail" + "fmask=0077" + "dmask=0077" + "flush" + ]; + }; + + swapDevices = [{ + device = "/swapfile"; + size = 8 * 1024; # Adjust size in MiB as needed + }]; nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; } \ No newline at end of file