osds-site/flake.nix

103 lines
2.8 KiB
Nix

{
description = '''';
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
emanote.url = "github:srid/emanote";
emanote.inputs.nixpkgs.follows = "nixpkgs";
git-hooks-nix.url = "github:cachix/git-hooks.nix";
git-hooks-nix.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [
# To import a flake module
# 1. Add foo to inputs
# 2. Add foo as a parameter to the outputs function
# 3. Add here: foo.flakeModule
inputs.emanote.flakeModule
inputs.git-hooks-nix.flakeModule
inputs.treefmt-nix.flakeModule
];
systems = [
"x86_64-linux"
# "aarch64-linux"
# "aarch64-darwin"
# "x86_64-darwin"
];
flake = {
# The usual flake attributes can be defined here, including system-
# agnostic ones like nixosModule and system-enumerating ones, although
# those are more easily expressed in perSystem.
};
perSystem = {
config,
self',
inputs',
pkgs,
system,
...
}: {
# Per-system attributes can be defined here. The self' and inputs'
# module parameters provide easy access to attributes of the same
# system.
# Equivalent to inputs'.nixpkgs.legacyPackages.hello;
# packages.default = pkgs.hello;
packages.default = self'.packages.osds-site;
apps.default = self'.apps.osds-site;
devShells.default = pkgs.mkShell {
packages = with pkgs; [
cowsay
alejandra
];
shellHook = ''
${config.pre-commit.installationScript}
echo 1>&2 "Welcome to the development shell!"
'';
};
emanote.sites = {
osds-site = {
layers = [
{
path = ./osds-src;
pathString = "osds-src";
}
];
baseUrl = "localhost";
port = 12513;
};
};
pre-commit = {
settings.hooks = {
alejandra.enable = true;
mdformat.enable = true;
prettier.enable = true;
prettier.excludes = [".*\.md" "flake.lock"];
stylish-haskell.enable = true;
};
};
treefmt = {
programs = {
alejandra.enable = true;
mdformat.enable = true;
prettier.enable = true;
prettier.excludes = ["*.md"];
stylish-haskell.enable = true;
};
};
};
};
}