srvos/dev/flake.nix
Jörg Thalheim 0255510812
apply deadnix (#224)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-08-24 10:31:22 +02:00

64 lines
1.9 KiB
Nix

{
description = "srvos dev flake";
inputs.srvos.url = "path:../";
inputs.nixpkgs.follows = "srvos/nixpkgs";
inputs.nixos-23_05.url = "github:NixOS/nixpkgs/nixos-23.05";
inputs.mkdocs-numtide.url = "github:numtide/mkdocs-numtide";
inputs.mkdocs-numtide.inputs.nixpkgs.follows = "nixpkgs";
inputs.treefmt-nix.url = "github:numtide/treefmt-nix";
inputs.treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-compat.url = "github:nix-community/flake-compat";
outputs = { nixpkgs, nixos-23_05, mkdocs-numtide, treefmt-nix, srvos, ... }:
let
inherit (nixpkgs) lib;
eachSystem = f:
lib.genAttrs
srvos.lib.supportedSystems
(system: f nixpkgs.legacyPackages.${system});
treefmtCfg = eachSystem (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
treefmt = eachSystem (pkgs: treefmtCfg.${pkgs.system}.config.build.wrapper);
in
{
devShells = eachSystem (pkgs: {
default = pkgs.mkShellNoCC {
packages = [
mkdocs-numtide.packages.${pkgs.system}.default
pkgs.nix-eval-jobs
treefmt.${pkgs.system}
];
};
});
packages = eachSystem (pkgs: {
treefmt = treefmt.${pkgs.system};
docs = mkdocs-numtide.lib.${pkgs.system}.mkDocs {
name = "srvos";
src = toString srvos;
};
});
checks = eachSystem (pkgs:
{
treefmt = treefmtCfg.${pkgs.system}.config.build.check srvos;
} // (lib.optionalAttrs pkgs.stdenv.isLinux (import ./checks.nix {
inherit srvos nixpkgs;
prefix = "nixos";
system = pkgs.system;
})) // (lib.optionalAttrs pkgs.stdenv.isLinux (import ./checks.nix {
inherit srvos;
nixpkgs = nixos-23_05;
prefix = "nixos-23_05";
system = pkgs.system;
})));
};
}