🏡 my personal home lab
1
fork

Configure Feed

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

revamp and add rk1 nodes

+239 -101
+16
README.md
··· 1 + # My homelab 2 + 3 + ## Deploy 4 + 5 + All nodes 6 + 7 + ```sh 8 + nix run 9 + ``` 10 + 11 + Specific node 12 + 13 + ```sh 14 + nix run . -- .#cm4-node-1 15 + ``` 16 +
common/common.nix modules/common.nix
-26
common/nomad.nix
··· 1 - { config, lib, pkgs, ... }: { 2 - services.nomad = { 3 - enable = true; 4 - package = pkgs.nomad_1_6; 5 - enableDocker = true; 6 - dropPrivileges = false; 7 - 8 - settings = { 9 - datacenter = "home"; 10 - bind_addr = "0.0.0.0"; 11 - client = { 12 - enabled = true; 13 - servers = [ "127.0.0.1" ]; 14 - }; 15 - server = { 16 - enabled = true; 17 - bootstrap_expect = 2; 18 - server_join = { retry_join = [ "10.0.0.11" "10.0.0.12" ]; }; 19 - }; 20 - }; 21 - }; 22 - 23 - virtualisation = { docker.enable = true; }; 24 - 25 - networking.firewall = { allowedTCPPorts = [ 4646 4647 4648 ]; }; 26 - }
+55 -17
flake.lock
··· 7 7 "utils": "utils" 8 8 }, 9 9 "locked": { 10 - "lastModified": 1708091384, 11 - "narHash": "sha256-dTGGw2y8wvfjr+J9CjQbfdulOq72hUG17HXVNxpH1yE=", 10 + "lastModified": 1770019181, 11 + "narHash": "sha256-hwsYgDnby50JNVpTRYlF3UR/Rrpt01OrxVuryF40CFY=", 12 12 "owner": "serokell", 13 13 "repo": "deploy-rs", 14 - "rev": "0a0187794ac7f7a1e62cda3dabf8dc041f868790", 14 + "rev": "77c906c0ba56aabdbc72041bf9111b565cdd6171", 15 15 "type": "github" 16 16 }, 17 17 "original": { ··· 23 23 "flake-compat": { 24 24 "flake": false, 25 25 "locked": { 26 - "lastModified": 1696426674, 27 - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", 26 + "lastModified": 1733328505, 27 + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", 28 28 "owner": "edolstra", 29 29 "repo": "flake-compat", 30 - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", 30 + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", 31 31 "type": "github" 32 32 }, 33 33 "original": { ··· 36 36 "type": "github" 37 37 } 38 38 }, 39 + "nixos-hardware": { 40 + "locked": { 41 + "lastModified": 1770631810, 42 + "narHash": "sha256-b7iK/x+zOXbjhRqa+XBlYla4zFvPZyU5Ln2HJkiSnzc=", 43 + "owner": "nixos", 44 + "repo": "nixos-hardware", 45 + "rev": "2889685785848de940375bf7fea5e7c5a3c8d502", 46 + "type": "github" 47 + }, 48 + "original": { 49 + "owner": "nixos", 50 + "ref": "master", 51 + "repo": "nixos-hardware", 52 + "type": "github" 53 + } 54 + }, 39 55 "nixpkgs": { 40 56 "locked": { 41 - "lastModified": 1702272962, 42 - "narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=", 57 + "lastModified": 1743014863, 58 + "narHash": "sha256-jAIUqsiN2r3hCuHji80U7NNEafpIMBXiwKlSrjWMlpg=", 43 59 "owner": "NixOS", 44 60 "repo": "nixpkgs", 45 - "rev": "e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d", 61 + "rev": "bd3bac8bfb542dbde7ffffb6987a1a1f9d41699f", 46 62 "type": "github" 47 63 }, 48 64 "original": { ··· 54 70 }, 55 71 "nixpkgs_2": { 56 72 "locked": { 57 - "lastModified": 1709309926, 58 - "narHash": "sha256-VZFBtXGVD9LWTecGi6eXrE0hJ/mVB3zGUlHImUs2Qak=", 73 + "lastModified": 1770617025, 74 + "narHash": "sha256-1jZvgZoAagZZB6NwGRv2T2ezPy+X6EFDsJm+YSlsvEs=", 59 75 "owner": "nixos", 60 76 "repo": "nixpkgs", 61 - "rev": "79baff8812a0d68e24a836df0a364c678089e2c7", 77 + "rev": "2db38e08fdadcc0ce3232f7279bab59a15b94482", 62 78 "type": "github" 63 79 }, 64 80 "original": { 65 81 "owner": "nixos", 66 - "ref": "nixos-23.11", 82 + "ref": "nixos-25.11", 67 83 "repo": "nixpkgs", 68 84 "type": "github" 69 85 } ··· 71 87 "root": { 72 88 "inputs": { 73 89 "deploy-rs": "deploy-rs", 74 - "nixpkgs": "nixpkgs_2" 90 + "nixos-hardware": "nixos-hardware", 91 + "nixpkgs": "nixpkgs_2", 92 + "turing-rk1": "turing-rk1" 75 93 } 76 94 }, 77 95 "systems": { ··· 89 107 "type": "github" 90 108 } 91 109 }, 110 + "turing-rk1": { 111 + "inputs": { 112 + "nixpkgs": [ 113 + "nixpkgs" 114 + ] 115 + }, 116 + "locked": { 117 + "lastModified": 1767801599, 118 + "narHash": "sha256-NxTPVcfpkNpC0KOrEvAKcBJiM0HJWdNJePlenstssSQ=", 119 + "owner": "GiyoMoon", 120 + "repo": "nixos-turing-rk1", 121 + "rev": "7e9b89303b3177b64a2a4725fc40bad2e64e6f9b", 122 + "type": "github" 123 + }, 124 + "original": { 125 + "owner": "GiyoMoon", 126 + "repo": "nixos-turing-rk1", 127 + "type": "github" 128 + } 129 + }, 92 130 "utils": { 93 131 "inputs": { 94 132 "systems": "systems" 95 133 }, 96 134 "locked": { 97 - "lastModified": 1701680307, 98 - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", 135 + "lastModified": 1731533236, 136 + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 99 137 "owner": "numtide", 100 138 "repo": "flake-utils", 101 - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", 139 + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 102 140 "type": "github" 103 141 }, 104 142 "original": {
+84 -29
flake.nix
··· 1 1 { 2 - description = "A very basic flake"; 2 + description = "my homelab"; 3 3 4 4 inputs = { 5 - nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; 5 + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; 6 + nixos-hardware.url = "github:nixos/nixos-hardware/master"; 6 7 deploy-rs.url = "github:serokell/deploy-rs"; 8 + turing-rk1 = { 9 + url = "github:GiyoMoon/nixos-turing-rk1"; 10 + inputs.nixpkgs.follows = "nixpkgs"; 11 + }; 7 12 }; 8 13 9 - outputs = { self, nixpkgs, deploy-rs, ... }: { 10 - nixosConfigurations = { 11 - nix-node-1 = nixpkgs.lib.nixosSystem { 12 - system = "aarch64-linux"; 13 - modules = [ ./machines/nix-node-1.nix ]; 14 - }; 15 - nix-node-2 = nixpkgs.lib.nixosSystem { 16 - system = "aarch64-linux"; 17 - modules = [ ./machines/nix-node-2.nix ]; 14 + outputs = 15 + { 16 + self, 17 + nixpkgs, 18 + deploy-rs, 19 + nixos-hardware, 20 + turing-rk1, 21 + ... 22 + }: 23 + { 24 + nixosConfigurations = { 25 + cm4-node-1 = nixpkgs.lib.nixosSystem { 26 + system = "aarch64-linux"; 27 + modules = [ 28 + nixos-hardware.nixosModules.raspberry-pi-4 29 + ./hosts/cm4-node-1.nix 30 + ]; 31 + }; 32 + cm4-node-2 = nixpkgs.lib.nixosSystem { 33 + system = "aarch64-linux"; 34 + modules = [ 35 + nixos-hardware.nixosModules.raspberry-pi-4 36 + ./hosts/cm4-node-2.nix 37 + ]; 38 + }; 39 + rk1-node-1 = nixpkgs.lib.nixosSystem { 40 + system = "aarch64-linux"; 41 + modules = [ 42 + turing-rk1.nixosModules.turing-rk1 43 + ./hosts/rk1-node-1.nix 44 + ]; 45 + }; 46 + rk1-node-2 = nixpkgs.lib.nixosSystem { 47 + system = "aarch64-linux"; 48 + modules = [ 49 + turing-rk1.nixosModules.turing-rk1 50 + ./hosts/rk1-node-2.nix 51 + ]; 52 + }; 18 53 }; 19 - }; 20 54 21 - deploy.nodes = { 22 - nix-node-1 = { 23 - hostname = "10.0.0.11"; 24 - profiles.system = { 25 - sshUser = "root"; 26 - user = "root"; 27 - path = deploy-rs.lib.aarch64-linux.activate.nixos 28 - self.nixosConfigurations.nix-node-1; 55 + deploy.nodes = { 56 + cm4-node-1 = { 57 + hostname = "10.0.0.11"; 58 + profiles.system = { 59 + sshUser = "root"; 60 + user = "root"; 61 + path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.cm4-node-1; 62 + }; 29 63 }; 30 - }; 31 - nix-node-2 = { 32 - hostname = "10.0.0.12"; 33 - profiles.system = { 34 - sshUser = "root"; 35 - user = "root"; 36 - path = deploy-rs.lib.aarch64-linux.activate.nixos 37 - self.nixosConfigurations.nix-node-2; 64 + cm4-node-2 = { 65 + hostname = "10.0.0.12"; 66 + profiles.system = { 67 + sshUser = "root"; 68 + user = "root"; 69 + path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.cm4-node-2; 70 + }; 71 + }; 72 + rk1-node-1 = { 73 + hostname = "10.0.0.13"; 74 + profiles.system = { 75 + sshUser = "root"; 76 + user = "root"; 77 + path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.rk1-node-1; 78 + }; 79 + }; 80 + rk1-node-2 = { 81 + hostname = "10.0.0.14"; 82 + profiles.system = { 83 + sshUser = "root"; 84 + user = "root"; 85 + path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.rk1-node-2; 86 + }; 38 87 }; 39 88 }; 89 + 90 + packages.x86_64-linux = { 91 + deploy-rs = deploy-rs.packages.x86_64-linux.deploy-rs; 92 + default = self.packages.x86_64-linux.deploy-rs; 93 + }; 94 + 95 + checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; 40 96 }; 41 - }; 42 97 }
+6
hardware/cm4/default.nix
··· 1 + { pkgs, ... }: 2 + { 3 + imports = [ ./hardware-configuration.nix ]; 4 + 5 + hardware.raspberry-pi."4".fkms-3d.enable = true; 6 + }
+12 -3
hardware/cm4/hardware-configuration.nix
··· 1 - { config, lib, pkgs, modulesPath, ... }: 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + modulesPath, 6 + ... 7 + }: 2 8 3 9 { 4 10 boot = { 5 - kernelPackages = pkgs.linuxKernel.packages.linux_rpi4; 6 - initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ]; 11 + initrd.availableKernelModules = [ 12 + "xhci_pci" 13 + "usbhid" 14 + "usb_storage" 15 + ]; 7 16 loader = { 8 17 grub.enable = false; 9 18 generic-extlinux-compatible.enable = true;
+17
hosts/cm4-node-1.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: 7 + 8 + { 9 + imports = [ 10 + ../hardware/cm4 11 + ../modules/common.nix 12 + ]; 13 + 14 + networking.hostName = "cm4-node-1"; 15 + 16 + system.stateVersion = "23.11"; 17 + }
+17
hosts/cm4-node-2.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: 7 + 8 + { 9 + imports = [ 10 + ../hardware/cm4/hardware-configuration.nix 11 + ../modules/common.nix 12 + ]; 13 + 14 + networking.hostName = "cm4-node-2"; 15 + 16 + system.stateVersion = "23.11"; 17 + }
+16
hosts/rk1-node-1.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: 7 + 8 + { 9 + imports = [ 10 + ../modules/common.nix 11 + ]; 12 + 13 + networking.hostName = "rk1-node-1"; 14 + 15 + system.stateVersion = "25.11"; 16 + }
+16
hosts/rk1-node-2.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: 7 + 8 + { 9 + imports = [ 10 + ../modules/common.nix 11 + ]; 12 + 13 + networking.hostName = "rk1-node-1"; 14 + 15 + system.stateVersion = "25.11"; 16 + }
-13
machines/nix-node-1.nix
··· 1 - { config, lib, pkgs, ... }: 2 - 3 - { 4 - imports = [ 5 - ../hardware/cm4/hardware-configuration.nix 6 - ../common/common.nix 7 - ../common/nomad.nix 8 - ]; 9 - 10 - networking.hostName = "nix-node-1"; 11 - 12 - system.stateVersion = "23.11"; 13 - }
-13
machines/nix-node-2.nix
··· 1 - { config, lib, pkgs, ... }: 2 - 3 - { 4 - imports = [ 5 - ../hardware/cm4/hardware-configuration.nix 6 - ../common/common.nix 7 - ../common/nomad.nix 8 - ]; 9 - 10 - networking.hostName = "nix-node-2"; 11 - 12 - system.stateVersion = "23.11"; 13 - }