2024-07-11 01:10:35 +09:00
|
|
|
{
|
2024-09-04 17:03:21 +09:00
|
|
|
description = "fortify sandbox tool and nixos module";
|
2024-07-11 01:10:35 +09:00
|
|
|
|
|
|
|
inputs = {
|
2024-12-06 00:44:04 +09:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11-small";
|
2024-07-11 01:10:35 +09:00
|
|
|
};
|
|
|
|
|
2024-07-16 21:54:44 +09:00
|
|
|
outputs =
|
|
|
|
{ self, nixpkgs }:
|
2024-07-11 01:10:35 +09:00
|
|
|
let
|
2024-09-04 17:03:21 +09:00
|
|
|
supportedSystems = [
|
|
|
|
"aarch64-linux"
|
|
|
|
"i686-linux"
|
|
|
|
"x86_64-linux"
|
|
|
|
];
|
|
|
|
|
|
|
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
|
|
|
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
|
2024-07-11 01:10:35 +09:00
|
|
|
in
|
|
|
|
{
|
2024-09-04 17:03:21 +09:00
|
|
|
nixosModules.fortify = import ./nixos.nix;
|
|
|
|
|
|
|
|
packages = forAllSystems (
|
2024-07-16 21:54:44 +09:00
|
|
|
system:
|
|
|
|
let
|
2024-09-04 17:03:21 +09:00
|
|
|
pkgs = nixpkgsFor.${system};
|
2024-07-16 21:54:44 +09:00
|
|
|
in
|
|
|
|
{
|
2024-09-04 17:03:21 +09:00
|
|
|
default = self.packages.${system}.fortify;
|
2024-07-16 21:54:44 +09:00
|
|
|
|
2024-09-04 17:03:21 +09:00
|
|
|
fortify = pkgs.callPackage ./package.nix { };
|
2024-07-16 21:54:44 +09:00
|
|
|
}
|
|
|
|
);
|
2024-09-04 17:03:21 +09:00
|
|
|
|
|
|
|
devShells = forAllSystems (system: {
|
|
|
|
default = nixpkgsFor.${system}.mkShell {
|
2024-10-27 23:45:52 +09:00
|
|
|
buildInputs = with nixpkgsFor.${system}; self.packages.${system}.fortify.buildInputs;
|
2024-10-17 20:35:10 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
withPackage = nixpkgsFor.${system}.mkShell {
|
2024-09-17 23:15:33 +09:00
|
|
|
buildInputs =
|
|
|
|
with nixpkgsFor.${system};
|
2024-09-28 00:06:16 +09:00
|
|
|
self.packages.${system}.fortify.buildInputs ++ [ self.packages.${system}.fortify ];
|
2024-09-04 17:03:21 +09:00
|
|
|
};
|
2024-11-19 18:12:35 +09:00
|
|
|
|
|
|
|
generateDoc =
|
|
|
|
let
|
|
|
|
pkgs = nixpkgsFor.${system};
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
|
|
|
|
doc =
|
|
|
|
let
|
|
|
|
eval = lib.evalModules {
|
|
|
|
specialArgs = {
|
|
|
|
inherit pkgs;
|
|
|
|
};
|
|
|
|
modules = [ ./options.nix ];
|
|
|
|
};
|
|
|
|
cleanEval = lib.filterAttrsRecursive (n: v: n != "_module") eval;
|
|
|
|
in
|
|
|
|
pkgs.nixosOptionsDoc { inherit (cleanEval) options; };
|
|
|
|
docText = pkgs.runCommand "fortify-module-docs.md" { } ''
|
|
|
|
cat ${doc.optionsCommonMark} > $out
|
|
|
|
sed -i '/*Declared by:*/,+1 d' $out
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
nixpkgsFor.${system}.mkShell {
|
|
|
|
shellHook = ''
|
|
|
|
exec cat ${docText} > options.md
|
|
|
|
'';
|
|
|
|
};
|
2024-09-04 17:03:21 +09:00
|
|
|
});
|
2024-07-11 01:10:35 +09:00
|
|
|
};
|
2024-07-16 21:54:44 +09:00
|
|
|
}
|