7b65fbe22c
- nix/package.nix: derivation for personal-backlog server + webapp
- nix/module.nix: NixOS module for services.personal-backlog
- Expose packages and nixosModules in flake.nix
Usage in NixOS configuration:
services.personal-backlog = {
enable = true;
port = 8080;
dataDir = "/var/lib/personal-backlog";
openFirewall = false;
};
68 lines
1.4 KiB
Nix
68 lines
1.4 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs";
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
git-hooks.url = "github:cachix/git-hooks.nix";
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
flake-parts,
|
|
git-hooks,
|
|
...
|
|
}@inputs:
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
systems = [
|
|
"x86_64-linux"
|
|
];
|
|
|
|
flake = {
|
|
nixosModules.default = import ./nix/module.nix;
|
|
nixosModules.personal-backlog = import ./nix/module.nix;
|
|
};
|
|
|
|
perSystem =
|
|
{
|
|
system,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
pre-commit-check = git-hooks.lib.${system}.run {
|
|
src = ./.;
|
|
hooks = {
|
|
nixfmt.enable = true;
|
|
};
|
|
};
|
|
in
|
|
{
|
|
formatter = pkgs.nixfmt-tree;
|
|
|
|
packages = {
|
|
default = pkgs.callPackage ./nix/package.nix { };
|
|
personal-backlog = pkgs.callPackage ./nix/package.nix { };
|
|
};
|
|
|
|
checks = {
|
|
inherit pre-commit-check;
|
|
};
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
inherit (pre-commit-check) shellHook;
|
|
|
|
buildInputs = with pkgs; [
|
|
pre-commit
|
|
gitleaks
|
|
|
|
nixd
|
|
nodejs_22
|
|
|
|
opencode
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|