systant/flake.nix
ryan 1629c8d5d2 refactor: switch to home-manager module
Systant is a userspace controller, so it makes sense to manage it
via home-manager rather than as a system service. This allows:
- Declarative per-user configuration
- Access to user's environment, PATH, and session
- Proper handling of audio, display, and other user resources

Usage in home-manager config:
  imports = [ inputs.systant.homeManagerModules.default ];
  services.systant.enable = true;
  services.systant.settings = { ... };

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:02:09 -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,
...
}:
{
# Home Manager module (system-independent)
homeManagerModules.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
'';
};
}
);
}