nix: initial tooling; add NixOS module

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I5ff8dfa450ec405e2ead5d16e0de90856a6a6964
This commit is contained in:
raf 2026-01-31 01:52:29 +03:00
commit 05b3dea1c6
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
4 changed files with 217 additions and 0 deletions

36
flake.nix Normal file
View file

@ -0,0 +1,36 @@
{
description = "Troutbot - GitHub webhook bot";
inputs.nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
outputs = {
self,
nixpkgs,
}: let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forEachSystem = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
in {
nixosModules = {
troutbot = import ./nix/modules/nixos.nix self;
default = self.nixosModules.troutbot;
};
packages = forEachSystem (pkgs: {
troutbot = pkgs.callPackage ./nix/package.nix {};
default = self.packages.${pkgs.hostPlatform.system}.troutbot;
});
devShells = forEachSystem (pkgs: {
default = pkgs.mkShell {
name = "troutbot-dev";
packages = [pkgs.nodejs-slim pkgs.pnpm];
};
});
};
}