73 lines
1.6 KiB
Nix
73 lines
1.6 KiB
Nix
{
|
|
description = "nix-hamburg.de - Website";
|
|
|
|
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";
|
|
};
|
|
nix-filter.url = "github:numtide/nix-filter";
|
|
pre-commit = {
|
|
url = "github:cachix/pre-commit-hooks.nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
{ self
|
|
, flake-parts
|
|
, treefmt-nix
|
|
, pre-commit
|
|
, ...
|
|
}@inputs:
|
|
let
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
];
|
|
in
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
inherit systems;
|
|
|
|
imports = [
|
|
pre-commit.flakeModule
|
|
treefmt-nix.flakeModule
|
|
./nix/devshell.nix
|
|
./nix/pre-commit.nix
|
|
./nix/package.nix
|
|
];
|
|
|
|
perSystem =
|
|
{ config
|
|
, pkgs
|
|
, self'
|
|
, ...
|
|
}:
|
|
{
|
|
apps = {
|
|
serve.program = "${pkgs.writeShellScript "serve" ''
|
|
${pkgs.miniserve}/bin/miniserve -p 3001 --index index.html ${self'.packages.default}
|
|
''}";
|
|
};
|
|
|
|
packages.default = self'.packages.nix-hamburg;
|
|
|
|
treefmt.config = {
|
|
projectRootFile = "flake.nix";
|
|
programs.nixpkgs-fmt.enable = true;
|
|
};
|
|
|
|
formatter = config.treefmt.build.wrapper;
|
|
};
|
|
|
|
flake.hydraJobs = {
|
|
inherit (self) checks packages;
|
|
};
|
|
};
|
|
}
|