fmt flake

This commit is contained in:
Robin Appelman 2022-06-25 15:40:12 +02:00
commit df88fd2102

View file

@ -4,7 +4,12 @@
naersk.url = "github:nix-community/naersk";
};
outputs = { self, nixpkgs, utils, naersk }:
outputs = {
self,
nixpkgs,
utils,
naersk,
}:
utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages."${system}";
naersk-lib = naersk.lib."${system}";
@ -29,12 +34,18 @@
# `nix develop`
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ rustc cargo ];
nativeBuildInputs = with pkgs; [rustc cargo];
};
}) // {
nixosModule = { config, lib, pkgs, ... }:
with lib;
let cfg = config.palantir.services.palantir;
})
// {
nixosModule = {
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.palantir.services.palantir;
in {
options.palantir.services.palantir = {
enable = mkEnableOption "Enables the palantir service";
@ -48,22 +59,23 @@
};
config = mkIf cfg.enable {
networking.firewall.allowedTCPPorts = [ cfg.port ];
networking.firewall.allowedTCPPorts = [cfg.port];
users.groups.palantir = {};
users.groups.powermonitoring = {};
users.users.palantir = {
isSystemUser = true;
group = "palantir";
extraGroups = [ "powermonitoring" ];
extraGroups = ["powermonitoring"];
};
services.udev.packages = [ self.defaultPackage.${pkgs.system} ];
services.udev.packages = [self.defaultPackage.${pkgs.system}];
systemd.services."palantir" = {
wantedBy = [ "multi-user.target" ];
wantedBy = ["multi-user.target"];
serviceConfig = let pkg = self.defaultPackage.${pkgs.system};
serviceConfig = let
pkg = self.defaultPackage.${pkgs.system};
in {
Restart = "on-failure";
ExecStart = "${pkg}/bin/palantir";