From 5e122e74fa9380183428cc74bceb8ec0683dab74 Mon Sep 17 00:00:00 2001 From: Markus Schmidl Date: Mon, 20 Nov 2023 21:01:43 +0100 Subject: [PATCH] add code for building docs --- flake.nix | 101 +++++++++++++++++++++++++----------------------------- 1 file changed, 46 insertions(+), 55 deletions(-) diff --git a/flake.nix b/flake.nix index f8736c1..54cfc9d 100644 --- a/flake.nix +++ b/flake.nix @@ -8,65 +8,56 @@ }; outputs = inputs@{ self, utils, nixpkgs, ... }: - utils.lib.eachDefaultSystem - (system: - let - pkgs = nixpkgs.legacyPackages.${system}; + utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; - libenvpp = pkgs.callPackage ./pkgs/libenvpp.nix { }; - gnuradio-decoder = - let - gnuradio_unwrapped = pkgs.callPackage ./pkgs/gnuradio.nix { gnuradio = pkgs.gnuradio3_8; }; - in - pkgs.callPackage ./pkgs/gnuradio-decoder-cpp.nix { - inherit gnuradio_unwrapped libenvpp; - gnuradioPackages = pkgs.gnuradio3_8Packages; - }; - in - rec { - checks = packages; - packages = { - inherit gnuradio-decoder libenvpp; - default = gnuradio-decoder; + libenvpp = pkgs.callPackage ./pkgs/libenvpp.nix { }; + gnuradio-decoder = let + gnuradio_unwrapped = pkgs.callPackage ./pkgs/gnuradio.nix { + gnuradio = pkgs.gnuradio3_8; }; - devShells.default = pkgs.mkShell { - nativeBuildInputs = (with packages.gnuradio-decoder; buildInputs ++ nativeBuildInputs); - }; - } - ) // { - overlays.default = final: prev: { - inherit (self.packages.${prev.system}) - gnuradio-decoder; - }; + in pkgs.callPackage ./pkgs/gnuradio-decoder-cpp.nix { + inherit gnuradio_unwrapped libenvpp; + gnuradioPackages = pkgs.gnuradio3_8Packages; + }; + in rec { + checks = packages; + packages = { + inherit gnuradio-decoder libenvpp; + default = gnuradio-decoder; + docs = (pkgs.nixosOptionsDoc { + options = (nixpkgs.lib.nixosSystem { + inherit system; + modules = [ self.nixosModules.default ]; + }).options.TLMS; + }).optionsCommonMark; + }; + devShells.default = pkgs.mkShell { + nativeBuildInputs = + (with packages.gnuradio-decoder; buildInputs ++ nativeBuildInputs); + }; + }) // { + overlays.default = final: prev: { + inherit (self.packages.${prev.system}) gnuradio-decoder; + }; - nixosModules = rec { - default = gnuradio-decoder; - gnuradio-decoder = import ./nixos-module; - }; + nixosModules = rec { + default = gnuradio-decoder; + gnuradio-decoder = import ./nixos-module; + }; - hydraJobs = - let - hydraSystems = [ - "x86_64-linux" - "aarch64-linux" - ]; + hydraJobs = let + hydraSystems = [ "x86_64-linux" "aarch64-linux" ]; hydraBlacklist = [ ]; - in - builtins.foldl' - (hydraJobs: system: - builtins.foldl' - (hydraJobs: pkgName: - if builtins.elem pkgName hydraBlacklist - then hydraJobs - else - nixpkgs.lib.recursiveUpdate hydraJobs { - ${pkgName}.${system} = self.packages.${system}.${pkgName}; - } - ) + in builtins.foldl' (hydraJobs: system: + builtins.foldl' (hydraJobs: pkgName: + if builtins.elem pkgName hydraBlacklist then hydraJobs - (builtins.attrNames self.packages.${system}) - ) - { } - hydraSystems; - }; + else + nixpkgs.lib.recursiveUpdate hydraJobs { + ${pkgName}.${system} = self.packages.${system}.${pkgName}; + }) hydraJobs (builtins.attrNames self.packages.${system})) { } + hydraSystems; + }; }