🏡 my personal home lab
1
fork

Configure Feed

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

initial commit

okkdev a0b3e6e5

+253
+21
common/common.nix
··· 1 + { config, lib, pkgs, ... }: 2 + 3 + { 4 + # Set your time zone. 5 + time.timeZone = "Europe/Zurich"; 6 + 7 + users.users.root = { 8 + openssh.authorizedKeys.keys = [ 9 + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGjSSxTbR4cq3IqMX3VKkB4inGeBmmE9UtO0IHwxg92O dev@stehlik.me" 10 + ]; 11 + }; 12 + 13 + environment.systemPackages = with pkgs; [ vim ]; 14 + 15 + # Enable the OpenSSH daemon. 16 + services.openssh = { 17 + enable = true; 18 + settings.PasswordAuthentication = false; 19 + settings.PermitRootLogin = "prohibit-password"; 20 + }; 21 + }
+113
flake.lock
··· 1 + { 2 + "nodes": { 3 + "deploy-rs": { 4 + "inputs": { 5 + "flake-compat": "flake-compat", 6 + "nixpkgs": "nixpkgs", 7 + "utils": "utils" 8 + }, 9 + "locked": { 10 + "lastModified": 1708091384, 11 + "narHash": "sha256-dTGGw2y8wvfjr+J9CjQbfdulOq72hUG17HXVNxpH1yE=", 12 + "owner": "serokell", 13 + "repo": "deploy-rs", 14 + "rev": "0a0187794ac7f7a1e62cda3dabf8dc041f868790", 15 + "type": "github" 16 + }, 17 + "original": { 18 + "owner": "serokell", 19 + "repo": "deploy-rs", 20 + "type": "github" 21 + } 22 + }, 23 + "flake-compat": { 24 + "flake": false, 25 + "locked": { 26 + "lastModified": 1696426674, 27 + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", 28 + "owner": "edolstra", 29 + "repo": "flake-compat", 30 + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", 31 + "type": "github" 32 + }, 33 + "original": { 34 + "owner": "edolstra", 35 + "repo": "flake-compat", 36 + "type": "github" 37 + } 38 + }, 39 + "nixpkgs": { 40 + "locked": { 41 + "lastModified": 1702272962, 42 + "narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=", 43 + "owner": "NixOS", 44 + "repo": "nixpkgs", 45 + "rev": "e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d", 46 + "type": "github" 47 + }, 48 + "original": { 49 + "owner": "NixOS", 50 + "ref": "nixpkgs-unstable", 51 + "repo": "nixpkgs", 52 + "type": "github" 53 + } 54 + }, 55 + "nixpkgs_2": { 56 + "locked": { 57 + "lastModified": 1708566995, 58 + "narHash": "sha256-e/THimsoxxMAHSbwMKov5f5Yg+utTj6XVGEo24Lhx+0=", 59 + "owner": "nixos", 60 + "repo": "nixpkgs", 61 + "rev": "3cb4ae6689d2aa3f363516234572613b31212b78", 62 + "type": "github" 63 + }, 64 + "original": { 65 + "owner": "nixos", 66 + "ref": "nixos-23.11", 67 + "repo": "nixpkgs", 68 + "type": "github" 69 + } 70 + }, 71 + "root": { 72 + "inputs": { 73 + "deploy-rs": "deploy-rs", 74 + "nixpkgs": "nixpkgs_2" 75 + } 76 + }, 77 + "systems": { 78 + "locked": { 79 + "lastModified": 1681028828, 80 + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 81 + "owner": "nix-systems", 82 + "repo": "default", 83 + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 84 + "type": "github" 85 + }, 86 + "original": { 87 + "owner": "nix-systems", 88 + "repo": "default", 89 + "type": "github" 90 + } 91 + }, 92 + "utils": { 93 + "inputs": { 94 + "systems": "systems" 95 + }, 96 + "locked": { 97 + "lastModified": 1701680307, 98 + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", 99 + "owner": "numtide", 100 + "repo": "flake-utils", 101 + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", 102 + "type": "github" 103 + }, 104 + "original": { 105 + "owner": "numtide", 106 + "repo": "flake-utils", 107 + "type": "github" 108 + } 109 + } 110 + }, 111 + "root": "root", 112 + "version": 7 113 + }
+44
flake.nix
··· 1 + { 2 + description = "A very basic flake"; 3 + 4 + inputs = { 5 + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; 6 + deploy-rs.url = "github:serokell/deploy-rs"; 7 + }; 8 + 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 ]; 18 + }; 19 + }; 20 + 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; 29 + }; 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; 38 + }; 39 + }; 40 + 41 + }; 42 + 43 + }; 44 + }
+31
hardware/cm4/hardware-configuration.nix
··· 1 + { config, lib, pkgs, modulesPath, ... }: 2 + 3 + { 4 + boot = { 5 + kernelPackages = pkgs.linuxKernel.packages.linux_rpi4; 6 + initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ]; 7 + loader = { 8 + grub.enable = false; 9 + generic-extlinux-compatible.enable = true; 10 + }; 11 + }; 12 + 13 + fileSystems."/" = { 14 + device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; 15 + fsType = "ext4"; 16 + }; 17 + 18 + swapDevices = [ ]; 19 + 20 + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 21 + # (the default) this is the recommended approach. When using systemd-networkd it's 22 + # still possible to use this option, but it's recommended to use it in conjunction 23 + # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. 24 + networking.useDHCP = lib.mkDefault true; 25 + # networking.interfaces.end0.useDHCP = lib.mkDefault true; 26 + # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; 27 + 28 + hardware.enableRedistributableFirmware = lib.mkDefault true; 29 + 30 + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; 31 + }
+22
machines/nix-node-1.nix
··· 1 + { config, lib, pkgs, ... }: 2 + 3 + { 4 + imports = [ 5 + ../hardware/cm4/hardware-configuration.nix 6 + ../common/common.nix 7 + ]; 8 + 9 + # Use the extlinux boot loader. (NixOS wants to enable GRUB by default) 10 + boot.loader.grub.enable = false; 11 + # Enables the generation of /boot/extlinux/extlinux.conf 12 + boot.loader.generic-extlinux-compatible.enable = true; 13 + 14 + nix.settings.experimental-features = [ "nix-command" "flakes" ]; 15 + 16 + networking = { 17 + hostName = "nix-node-1"; 18 + networkmanager.enable = true; 19 + }; 20 + 21 + system.stateVersion = "23.11"; 22 + }
+22
machines/nix-node-2.nix
··· 1 + { config, lib, pkgs, ... }: 2 + 3 + { 4 + imports = [ 5 + ../hardware/cm4/hardware-configuration.nix 6 + ../common/common.nix 7 + ]; 8 + 9 + # Use the extlinux boot loader. (NixOS wants to enable GRUB by default) 10 + boot.loader.grub.enable = false; 11 + # Enables the generation of /boot/extlinux/extlinux.conf 12 + boot.loader.generic-extlinux-compatible.enable = true; 13 + 14 + nix.settings.experimental-features = [ "nix-command" "flakes" ]; 15 + 16 + networking = { 17 + hostName = "nix-node-2"; 18 + networkmanager.enable = true; 19 + }; 20 + 21 + system.stateVersion = "23.11"; 22 + }