nix-hamburg.astro.nix/flake.nix

73 lines
1.6 KiB
Nix
Raw Normal View History

2023-04-07 16:32:36 +02:00
{
description = "nix-hamburg.de - Website";
2023-04-07 16:32:36 +02:00
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-04-07 16:32:36 +02:00
nix-filter.url = "github:numtide/nix-filter";
pre-commit = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-04-07 16:32:36 +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-04-07 16:32:36 +02:00
inherit systems;
imports = [
pre-commit.flakeModule
treefmt-nix.flakeModule
./nix/devshell.nix
./nix/pre-commit.nix
./nix/package.nix
];
2023-04-07 16:32:36 +02:00
perSystem =
{ config
, pkgs
, self'
, ...
}:
{
apps = {
serve.program = "${pkgs.writeShellScript "serve" ''
${pkgs.miniserve}/bin/miniserve -p 3001 --index index.html ${self'.packages.default}
''}";
};
2023-04-07 16:32:36 +02:00
packages.default = self'.packages.nix-hamburg;
2023-04-07 16:32:36 +02:00
treefmt.config = {
projectRootFile = "flake.nix";
programs.nixpkgs-fmt.enable = true;
2023-04-07 16:32:36 +02:00
};
formatter = config.treefmt.build.wrapper;
2023-04-07 16:32:36 +02:00
};
flake.hydraJobs = {
inherit (self) checks packages;
2023-04-07 16:32:36 +02:00
};
};
2023-04-07 16:32:36 +02:00
}