srx.astro.nix/flake.nix

45 lines
1.2 KiB
Nix
Raw Normal View History

2022-12-22 23:31:21 +01:00
{
2024-03-03 13:45:20 +01:00
description = "srx.digital - Website";
2023-03-30 01:14:12 +02:00
2022-12-22 23:31:21 +01:00
inputs = {
2024-05-07 17:20:50 +02:00
nixpkgs.url = "nixpkgs/nixos-unstable";
2023-03-30 01:14:12 +02:00
flake-parts.url = "github:hercules-ci/flake-parts";
2024-05-07 17:20:50 +02:00
treefmt-nix.url = "github:numtide/treefmt-nix";
2024-03-03 13:45:20 +01:00
nix-filter.url = "github:numtide/nix-filter";
2023-03-30 01:14:12 +02:00
pre-commit.url = "github:cachix/pre-commit-hooks.nix";
2022-12-22 23:31:21 +01:00
};
2023-03-30 01:14:12 +02:00
2024-05-07 17:20:50 +02:00
outputs = { self, flake-parts, treefmt-nix, pre-commit, ... }@inputs:
let systems = [ "x86_64-linux" "aarch64-linux" ];
in flake-parts.lib.mkFlake { inherit inputs; } {
2023-03-30 01:14:12 +02:00
inherit systems;
imports = [
pre-commit.flakeModule
2024-05-07 17:20:50 +02:00
treefmt-nix.flakeModule
./nix/hooks.nix
./nix/devshell.nix
2024-03-03 13:45:20 +01:00
./nix/package.nix
];
2024-05-07 17:20:50 +02:00
perSystem = { config, pkgs, self', ... }: {
apps = {
serve.program = "${pkgs.writeShellScript "serve" ''
${pkgs.miniserve}/bin/miniserve -p 3001 --index index.html ${self'.packages.default}
''}";
};
2024-05-07 17:20:50 +02:00
packages.default = self'.packages.srx-digital;
treefmt.config = {
projectRootFile = "flake.nix";
programs.nixpkgs-fmt.enable = true;
2022-12-22 23:31:21 +01:00
};
2024-05-07 17:20:50 +02:00
formatter = config.treefmt.build.wrapper;
2023-03-30 01:14:12 +02:00
};
2024-05-07 17:20:50 +02:00
flake.hydraJobs = { inherit (self) packages; };
2023-03-30 01:14:12 +02:00
};
2022-12-22 23:31:21 +01:00
}