mirror of
https://github.com/zaphar/Heracles.git
synced 2025-07-22 12:09:48 -04:00
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:
parent
847413f4f5
commit
fe162968e5
@ -8,4 +8,5 @@ in
|
||||
}
|
||||
) {
|
||||
src = ./.;
|
||||
}).defaultNix
|
||||
})
|
||||
.defaultNix
|
||||
|
40
flake.nix
40
flake.nix
@ -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"];
|
||||
|
Loading…
x
Reference in New Issue
Block a user