about summary refs log tree commit diff
path: root/nix/hosts/pi2
diff options
context:
space:
mode:
authorEmile <git@emile.space>2024-08-16 23:33:53 +0200
committerEmile <git@emile.space>2024-08-16 23:33:53 +0200
commitcea6896788a42c0ea40f99deb4b5987d6741e360 (patch)
tree7b65658ce082cab4f552b0a42fa171745f003bd2 /nix/hosts/pi2
parentdcfc18774fe2d4207c2996b2d16ea67499b70228 (diff)
big dump, forgot to commit...
Diffstat (limited to 'nix/hosts/pi2')
-rw-r--r--nix/hosts/pi2/default.nix47
l---------nix/hosts/pi2/result1
2 files changed, 48 insertions, 0 deletions
diff --git a/nix/hosts/pi2/default.nix b/nix/hosts/pi2/default.nix
new file mode 100644
index 0000000..939027f
--- /dev/null
+++ b/nix/hosts/pi2/default.nix
@@ -0,0 +1,47 @@
+# build the sd image for the pi using
+# ; nix-build '<nixpkgs/nixos>' -A config.system.build.sdImage -I nixos-config='./default.nix'
+
+# after booting
+# ; nix-channel --list
+# ; nix-channel --remove nixos
+# ; nix-channel --add https://channels.nixos.org/nixos-unstable nixos
+# ; nix-channel --update nixos
+# (this takes quite some time)
+# ; nixos-rebuild switch
+
+{ lib, pkgs, ... }:
+
+{
+  imports = [
+    <nixpkgs/nixos/modules/installer/sd-card/sd-image-raspberrypi.nix>
+    # <nixpkgs/nixos/modules/installer/sd-card/sd-image-armv7l-multiplatform.nix>
+    # <nixpkgs/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix>
+
+    # For nixpkgs cache
+    # <nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
+  ];
+
+  users.users = {
+    emile = {
+      isNormalUser = true;
+      hashedPassword = "$y$j9T$gKt6Iovrn.SAkMxnTCqqV1$55.sKRrjWTbe7Z6Xi17G0e3G7GbAGc65YXtX9zD5AR3";
+      extraGroups = [ "wheel" ];
+    };
+  };
+
+  nixpkgs = {
+    # crossSystem = lib.systems.examples.raspberryPi;
+    crossSystem = lib.systems.examples.armv7l-hf-multiplatform;
+    # localSystem = { system = "x86_64-linux"; };
+    localSystem = { system = "aarch64-darwin"; };
+    overlays = [
+      (final: super: {
+        # Due to https://github.com/NixOS/nixpkgs/issues/154163#issuecomment-1350599022
+        makeModulesClosure = x:
+          super.makeModulesClosure (x // { allowMissing = true; });
+      })
+    ];
+  };
+  system.stateVersion = "24.05";
+}
+
diff --git a/nix/hosts/pi2/result b/nix/hosts/pi2/result
new file mode 120000
index 0000000..8da9c2f
--- /dev/null
+++ b/nix/hosts/pi2/result
@@ -0,0 +1 @@
+/nix/store/k4i56ilirmnfdg0izgpq40hwz45x2lmw-nixos-sd-image-23.05pre482756.12ba1a5f90b-armv6l-linux.img-armv6l-unknown-linux-gnueabihf
\ No newline at end of file