1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-12-18 15:49:45 +01:00
nixos-hardware/starfive/visionfive/v2
2023-04-18 09:19:48 +02:00
..
default.nix starfive visionfive2: Fix deviceTree name 2023-04-18 09:15:12 +02:00
firmware.nix Init starfive visionfive 2 2023-04-16 23:18:18 +02:00
fix-memory-size.patch Init starfive visionfive 2 2023-04-16 23:18:18 +02:00
linux_6_3.nix Init starfive visionfive 2 2023-04-16 23:18:18 +02:00
opensbi.nix Init starfive visionfive 2 2023-04-16 23:18:18 +02:00
README.md starfive-visionfive2: Add README.md 2023-04-16 23:18:29 +02:00
sd-image-installer.nix Init starfive visionfive 2 2023-04-16 23:18:18 +02:00
sd-image.nix Init starfive visionfive 2 2023-04-16 23:18:18 +02:00
spl-tool.nix starfive visionfive2: Update spl_tool 2023-04-18 09:19:48 +02:00
uboot.nix Init starfive visionfive 2 2023-04-16 23:18:18 +02:00

Creating a SD-Image

Create and configure the flake.nix file:

{
  # Kernel is broken on riscv64 see https://github.com/NixOS/nixpkgs/issues/225756
  inputs.nixpkgs.url =
    "github:nixos/nixpkgs/c3e12e57c3e3d5c84cc500420be4507b3de33e90";
  inputs.nixos-hardware.url = "github:nixos/nixos-hardware";
  inputs.flake-utils.url = "github:numtide/flake-utils";
  outputs = { self, nixpkgs, nixos-hardware, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      rec {
        packages.default = packages.sd-image;
        packages.sd-image = (import "${nixpkgs}/nixos" {
          configuration =
            { config, ... }: {
              imports = [
                "${nixos-hardware}/starfive/visionfive/v2/sd-image-installer.nix"
              ];

              # If you want to use ssh set a password
              # users.users.nixos.password = "super secure password";
              # OR add your public ssh key
              # users.users.nixos.openssh.authorizedKeys.keys = [ "ssh-rsa ..." ];

              # AND configure networking
              # networking.interfaces.end0.useDHCP = true;
              # networking.interfaces.end1.useDHCP = true;

              # If you have the 2A variant uncomment the following line
              # hardware.deviceTree.name =
              #   lib.mkDefault "starfive/jh7110-starfive-visionfive-2-v1.2a.dtb";

              # Additional configuration goes here

              sdImage.compressImage = false;

              nixpkgs.crossSystem = {
                config = "riscv64-unknown-linux-gnu";
                system = "riscv64-linux";
              };

              system.stateVersion = "23.05";
            };
          inherit system;
        }).config.system.build.sdImage;
      });
}

Build the sd image.

nix build .#