srx.astro.nix/flake.nix

52 lines
1.3 KiB
Nix
Raw Normal View History

2022-12-22 23:31:21 +01:00
{
2023-03-30 01:14:12 +02:00
description = "nobbz.dev - Website";
2022-12-22 23:31:21 +01:00
inputs = {
2023-03-30 01:14:12 +02:00
nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable";
d2n.url = "github:nix-community/dream2nix";
d2n.inputs.all-cabal-json.follows = "nixpkgs";
nix-filter.url = "github:numtide/nix-filter";
flake-parts.url = "github:hercules-ci/flake-parts";
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
2022-12-22 23:31:21 +01:00
outputs = {
2023-03-30 01:14:12 +02:00
d2n,
nix-filter,
flake-parts,
pre-commit,
2022-12-22 23:31:21 +01:00
...
2023-03-30 01:14:12 +02:00
} @ inputs: let
systems = ["x86_64-linux" "aarch64-linux"];
in
flake-parts.lib.mkFlake {inherit inputs;} {
inherit systems;
2023-03-30 01:14:12 +02:00
imports = [d2n.flakeModuleBeta pre-commit.flakeModule ./nix/site.nix ./nix/hooks.nix];
2023-03-30 01:14:12 +02:00
dream2nix.config.projectRoot = ./.;
2023-03-30 01:14:12 +02:00
perSystem = {
2023-03-30 01:43:22 +02:00
self',
2023-03-30 01:14:12 +02:00
config,
pkgs,
system,
...
}: {
apps.serve.program = "${pkgs.writeShellScript "serve" ''
${pkgs.miniserve}/bin/miniserve -p 3001 --index index.html ${self'.packages.default}
''}";
2023-03-30 01:14:12 +02:00
packages.default = self'.packages.srx_dev;
2023-03-30 01:14:12 +02:00
devShells.default = pkgs.mkShell {
packages = builtins.attrValues {
inherit (pkgs) yarn;
inherit (pkgs) alejandra nil;
};
shellHook = config.pre-commit.installationScript;
2022-12-22 23:31:21 +01:00
};
2023-03-30 01:14:12 +02:00
};
};
2022-12-22 23:31:21 +01:00
}