systant/flake.nix
ryan 08bf13cc32 fix: pass src from flake to package.nix
Relative paths in package.nix don't resolve correctly when
the flake is used as an input in another flake. Pass src
explicitly from the flake instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 20:30:06 -08:00

60 lines
1.3 KiB
Nix

{
description = "Systant - System monitoring agent with MQTT and Home Assistant integration";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs =
{
self,
nixpkgs,
flake-utils,
...
}:
{
# NixOS module (system-independent)
nixosModules.default = import ./nix/nixos-module.nix;
# Overlay to add systant to pkgs
overlays.default = final: prev: {
systant = final.callPackage ./nix/package.nix { src = self; };
};
}
//
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [ self.overlays.default ];
};
in
{
packages = {
systant = pkgs.systant;
default = pkgs.systant;
};
apps.default = {
type = "app";
program = "${pkgs.systant}/bin/systant";
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
bashInteractive
glibcLocales
git
bun
inotify-tools
];
shellHook = ''
export PROJECT_ROOT=$PWD
'';
};
}
);
}