Skip to content

Commit

Permalink
add code for building docs
Browse files Browse the repository at this point in the history
  • Loading branch information
marenz2569 committed Nov 20, 2023
1 parent cd0104c commit 5e122e7
Showing 1 changed file with 46 additions and 55 deletions.
101 changes: 46 additions & 55 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}

0 comments on commit 5e122e7

Please sign in to comment.