Skip to content

Commit

Permalink
cleanup inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
misuzu committed Apr 8, 2024
1 parent b2c10e4 commit 3500c7b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 79 deletions.
55 changes: 1 addition & 54 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 14 additions & 25 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,12 @@
extra-trusted-public-keys = [ "cache.ztier.link-1:3P5j2ZB9dNgFFFVkCQWT3mh0E+S3rIWtZvoql64UaXM=" ];
};

inputs = {
nixpkgs = {
url = "github:NickCao/nixpkgs/riscv";
};
nixpkgs-native = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
linux-vf2-src = {
flake = false;
url = "github:starfive-tech/linux/JH7110_VisionFive2_upstream";
};
starfive-tools = {
flake = false;
url = "github:starfive-tech/Tools";
};
uboot-vf2-src = {
flake = false;
url = "github:u-boot/u-boot/v2024.04";
};
};
inputs.nixpkgs.url = "github:NickCao/nixpkgs/riscv";
inputs.nixpkgs-native.url = "github:NixOS/nixpkgs/nixos-unstable";

outputs = inputs: {
overlays.default = self: super: {
linuxPackages_vf2 = self.linuxPackagesFor (self.callPackage ./linux-vf2.nix {
src = inputs.linux-vf2-src;
kernelPatches = [ ];
});
};
Expand All @@ -43,9 +24,12 @@
};

overlays.firmware = self: super: {
uboot-vf2 = (super.buildUBoot {
version = inputs.uboot-vf2-src.shortRev;
src = inputs.uboot-vf2-src;
uboot-vf2 = (super.buildUBoot rec {
version = "2024.04";
src = super.fetchurl {
url = "https://ftp.denx.de/pub/u-boot/u-boot-${version}.tar.bz2";
hash = "sha256-GKhT/jn6160DqQzC1Cda6u1tppc13vrDSSuAUIhD3Uo=";
};
defconfig = "starfive_visionfive2_defconfig";
filesToInstall = [
"u-boot.itb"
Expand All @@ -59,7 +43,12 @@

spl-tool = self.stdenv.mkDerivation {
name = "spl-tool";
src = inputs.starfive-tools;
src = super.fetchFromGitHub {
owner = "starfive-tech";
repo = "Tools";
rev = "0747c0510e090f69bf7d2884f44903b77b3db5c5";
hash = "sha256-up58PtvnZTi6rGZcP2VwZrZBYajrZf4MzILixqaNKbE=";
};
installPhase = ''
runHook preInstall
Expand Down
14 changes: 14 additions & 0 deletions linux-vf2.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib
, buildLinux
, fetchFromGitHub
, ...
} @ args:

Expand All @@ -10,6 +11,13 @@ buildLinux (args // {
inherit modDirVersion;
version = "${modDirVersion}-vf2";

src = fetchFromGitHub {
owner = "starfive-tech";
repo = "linux";
rev = "076ede06c00a4069cd9f90d609eaf35bf1bdc68a";
hash = "sha256-oI048iCkvghEIiuDHbxNHtJz/krPwXPB/HB85YUaxL8=";
};

structuredExtraConfig = with lib.kernel; {
CPU_FREQ = yes;
CPUFREQ_DT = yes;
Expand Down Expand Up @@ -42,6 +50,12 @@ buildLinux (args // {
STARFIVE_HDMI = yes;

PL330_DMA = no;

# Disable some drivers that we don't need to make the build leaner
NET_VENDOR_MELLANOX = no;
NET_VENDOR_MARVELL = no;
DRM_NOUVEAU = no;
DRM_INTEL = no;
};

preferBuiltin = true;
Expand Down

0 comments on commit 3500c7b

Please sign in to comment.