systant/flake.nix
ryan b6769abbe9 Restructure as monorepo and add flake packages/apps
- Move Elixir code to server/ subdirectory for monorepo structure
- Update flake.nix to provide packages and apps outputs for nix run support
- Update nix/package.nix to accept src parameter instead of fetchgit
- Add NixOS module export for easy consumption

Now supports: nix run, nix build, and nix develop from git repo

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 19:54:17 -07:00

64 lines
1.3 KiB
Nix

{
description = "Elixir system monitor daemon";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
system = system;
config.allowUnfree = true;
};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
elixir
erlang
claude-code
aider-chat
nodejs_20
yarn
deno
python311
python311Packages.pip
python311Packages.ipython
];
shellHook = ''
echo "Elixir development environment loaded"
elixir --version
'';
};
packages = {
default = pkgs.callPackage ./nix/package.nix {
src = ./server;
};
systant = pkgs.callPackage ./nix/package.nix {
src = ./server;
};
};
apps = {
default = {
type = "app";
program = "${self.packages.${system}.default}/bin/systant";
};
};
}
) // {
nixosModules.default = import ./nix/nixos-module.nix;
};
}