cratedocs-mcp/flake.nix
Harald Hoyer 8440fc1c9a
Some checks failed
Rust / build (push) Failing after 15s
feat(nixos): add CrateDocs MCP service module
- Introduced a NixOS module for configuring the CrateDocs MCP server.
- Added options for enabling the service, setting the port, user, and group.
- Configured a hardened systemd service with security restrictions.
2025-05-27 17:28:53 +02:00

47 lines
1.6 KiB
Nix

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, rust-overlay, ... }:
let
namespace = "cratedocs";
overlays = [ rust-overlay.overlays.default ];
forEachSystem = systems: f: nixpkgs.lib.genAttrs systems f;
forAllSystems = function:
nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed
(system: function (import nixpkgs { inherit system overlays; }));
in
{
packages =
forAllSystems (pkgs: (self.overlays.default pkgs pkgs).${namespace});
cross = forAllSystems (pkgs:
(forEachSystem
(nixpkgs.lib.filter (sys: sys != pkgs.system)
nixpkgs.lib.systems.flakeExposed)
(crossSystem:
let
crossPkgs = import nixpkgs {
localSystem = pkgs.system;
inherit crossSystem;
};
in
(self.overlays.default crossPkgs crossPkgs).${namespace})));
devShells =
forAllSystems (pkgs: (self.overlays.default pkgs pkgs).devShells);
formatter = forAllSystems (pkgs: pkgs.nixpkgs-fmt);
overlays.default = final: prev:
let
pkgs = final;
cratedocs-mcp = pkgs.callPackage ./default.nix { };
in
{
devShells.default = pkgs.callPackage ./shell.nix { };
${namespace} = {
inherit cratedocs-mcp;
default = cratedocs-mcp;
};
};
nixosModules.default = import ./config.nix;
};
}