maint: Run nix stuff through the formatter

There are several choices for formatting Nix code, but IMHO alejandra is the
right kind of opinionated: <https://github.com/kamadorueda/alejandra>.
This commit is contained in:
Lucas Bergman 2024-02-19 20:31:47 -06:00
parent 847413f4f5
commit fe162968e5
2 changed files with 153 additions and 136 deletions

View File

@ -8,4 +8,5 @@ in
}
) {
src = ./.;
}).defaultNix
})
.defaultNix

View File

@ -6,11 +6,20 @@
inputs.nixpkgs.follows = "nixpkgs";
};
naersk.url = "github:nix-community/naersk";
flake-compat = { url = github:edolstra/flake-compat; flake = false; };
flake-compat = {
url = github:edolstra/flake-compat;
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {nixpkgs, flake-utils, naersk, rust-overlay, ...}:
outputs = {
nixpkgs,
flake-utils,
naersk,
rust-overlay,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
overlays = [
rust-overlay.overlays.default
@ -26,17 +35,24 @@
verion = "0.0.1";
src = ./.;
nativeBuildInputs = [pkgs.pkg-config];
buildInputs = (
if pkgs.stdenv.isDarwin then
with pkgs.darwin.apple_sdk.frameworks; [ Security SystemConfiguration ]
else
[ pkgs.openssl ]) ++ [rust-bin];
buildInputs =
(
if pkgs.stdenv.isDarwin
then with pkgs.darwin.apple_sdk.frameworks; [Security SystemConfiguration]
else [pkgs.openssl]
)
++ [rust-bin];
};
in
{
in {
packages.default = heracles;
}) // {
nixosModule = {config, pkgs, lib}: with lib; {
})
// {
nixosModule = {
config,
pkgs,
lib,
}:
with lib; {
options = {
services.heracles.enable = mkEnableOption "enable heracles service";
services.heracles.listen = mkOption {
@ -134,7 +150,7 @@
config = mkIf config.services.heracles.enable {
environment.etc."heracles.yaml" = {
text = (generators.toYAML {} config.services.heracles.settings);
text = generators.toYAML {} config.services.heracles.settings;
};
systemd.services.heracles = {
wantedBy = ["multi-user.target" "default.target"];