From 1f965038fc8e18f16b93b38f164efc37ec3d2e9f Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 7 Nov 2024 21:53:00 +0100 Subject: [PATCH] Added firmware package --- .gitignore | 1 + MMDVMFirmware/default.nix | 33 +++++++++++++++++++ .../0001-patch-install-path.patch | 0 .../0002-fix-missing-include.patch | 0 .../0003-fix-null-controller.patch | 0 default.nix => MMDVMHost/default.nix | 2 +- module.nix => MMDVMHost/module.nix | 0 flake.nix | 11 ++++--- result | 1 - 9 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 .gitignore create mode 100644 MMDVMFirmware/default.nix rename 0001-patch-install-path.patch => MMDVMHost/0001-patch-install-path.patch (100%) rename 0002-fix-missing-include.patch => MMDVMHost/0002-fix-missing-include.patch (100%) rename 0003-fix-null-controller.patch => MMDVMHost/0003-fix-null-controller.patch (100%) rename default.nix => MMDVMHost/default.nix (99%) rename module.nix => MMDVMHost/module.nix (100%) delete mode 120000 result diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e2f5dd2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result \ No newline at end of file diff --git a/MMDVMFirmware/default.nix b/MMDVMFirmware/default.nix new file mode 100644 index 0000000..fc233c6 --- /dev/null +++ b/MMDVMFirmware/default.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchFromGitHub, gcc-arm-embedded, ... }: + +stdenv.mkDerivation { + pname = "MMDVMFirmware"; + version = "yolo"; + + src = fetchFromGitHub { + owner = "g4klx"; + repo = "MMDVM"; + rev = "c3246dbcb771c0f9ead3bbe40e78fba1bfe5debc"; + sha256 = "sha256-UKhdSYvOZQNgOCjEOv+Q7cLB/+PrFQl8kKVkQOKrK5M="; + fetchSubmodules = true; + }; + + buildInputs = [ gcc-arm-embedded ]; + + buildPhase = '' + cat Makefile + make f4m + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/firmware + cp -v bin/* $out/firmware/ + + runHook postInstall + ''; + + + +} diff --git a/0001-patch-install-path.patch b/MMDVMHost/0001-patch-install-path.patch similarity index 100% rename from 0001-patch-install-path.patch rename to MMDVMHost/0001-patch-install-path.patch diff --git a/0002-fix-missing-include.patch b/MMDVMHost/0002-fix-missing-include.patch similarity index 100% rename from 0002-fix-missing-include.patch rename to MMDVMHost/0002-fix-missing-include.patch diff --git a/0003-fix-null-controller.patch b/MMDVMHost/0003-fix-null-controller.patch similarity index 100% rename from 0003-fix-null-controller.patch rename to MMDVMHost/0003-fix-null-controller.patch diff --git a/default.nix b/MMDVMHost/default.nix similarity index 99% rename from default.nix rename to MMDVMHost/default.nix index 8c7338d..6233cb6 100644 --- a/default.nix +++ b/MMDVMHost/default.nix @@ -17,4 +17,4 @@ stdenv.mkDerivation { ./0003-fix-null-controller.patch ]; -} \ No newline at end of file +} diff --git a/module.nix b/MMDVMHost/module.nix similarity index 100% rename from module.nix rename to MMDVMHost/module.nix diff --git a/flake.nix b/flake.nix index 7104a40..dc7ec58 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "A flake for mmdvm DL0XK patches."; + description = "A flake for MMDVMHost for DB0KL."; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/24.05"; }; @@ -14,13 +14,14 @@ packages = { x86_64-linux = { - default = nixpkgs.legacyPackages.x86_64-linux.callPackage ./default.nix { }; + MMDVMHost = nixpkgs.legacyPackages.x86_64-linux.callPackage ./MMDVMHost/default.nix { }; + MMDVMFirmware = nixpkgs.legacyPackages.x86_64-linux.callPackage ./MMDVMFirmware/default.nix { }; }; }; - nixosModules.default = { config, pkgs, ... }: { - imports = [ ./module.nix ]; - _module.args.mmdvm_host = self.packages; + nixosModules.MMDVMHost = { config, pkgs, ... }: { + imports = [ ./MMDVMHost/module.nix ]; + _module.args.mmdvm_host = self.packages.x86_64-linux.MMDVMHost; }; }; } diff --git a/result b/result deleted file mode 120000 index dcec265..0000000 --- a/result +++ /dev/null @@ -1 +0,0 @@ -/nix/store/qq596qk2sm7jkn7kwpagq38aq4pggmph-MMDVMHost-yolo \ No newline at end of file