headplane/flake.nix
Igor Ramazanov 8268de92c4 feat: do not rely on git for versioning
It causes lots of pain when building with `nix` for a local `flake.nix`.

Not sure if it's a good general solution:
* now it requires a manual step of updating `./version` on each release.
* we're losing commit hash abbreviation, like `0.5.3-5-gbe5a291`

I guess, this can be fixed by installing git-pre-commit-hook, but even
then it'd be wrong, because the output of `git describe --tags --always`
won't be the same before and after commit.
2025-03-11 22:49:18 +00:00

66 lines
1.6 KiB
Nix

rec {
description = "headplane";
inputs = {
devshell = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:numtide/devshell";
};
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs = {
devshell,
flake-utils,
nixpkgs,
...
}:
flake-utils.lib.eachSystem [
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
]
(system: let
pkgs = import nixpkgs {
inherit system;
overlays = [devshell.overlays.default];
};
in {
formatter = pkgs.alejandra;
packages = {
headplane = pkgs.callPackage ./nix/package.nix {};
headplane-agent = pkgs.callPackage ./nix/agent.nix {};
};
devShell = pkgs.devshell.mkShell rec {
name = description;
motd = let
providedPackages = pkgs.lib.concatStringsSep "\n" (
pkgs.lib.map
(pkg: "\t* ${pkgs.lib.getName pkg}")
(pkgs.lib.reverseList packages)
);
in ''
Entered '${description}' development environment.
Provided packages:
${providedPackages}
'';
packages = [
pkgs.go
pkgs.nodejs-slim_22
pkgs.pnpm_10
pkgs.typescript-language-server
];
env = [];
};
})
// {
overlays.default = final: prev: {
headplane = final.callPackage ./nix/package.nix {};
headplane-agent = final.callPackage ./nix/agent.nix {};
};
nixosModules.headplane = import ./nix/module.nix;
};
}