fix typos, lint, format

This commit is contained in:
Kiara Grouwstra 2025-07-03 20:23:04 +02:00
parent ba047997f2
commit d185d5f94f
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU
2 changed files with 12 additions and 14 deletions

View file

@ -40,7 +40,7 @@ in
_class = "fediversity-resource-policy";
options = {
extra-config = mkOptions {
extra-config = mkOption {
description = "Any options from NixOS";
};
apply = mkOption {
@ -88,12 +88,12 @@ in
requests:
let
# Filter out requests that need wheel if policy doesn't allow it
validRequests = lib.filterAttrs (name: req: !req.wheel || config.wheel) requests;
validRequests = lib.filterAttrs (_name: req: !req.wheel || config.wheel) requests;
in
lib.optionalAttrs (validRequests != { }) {
${config.username} = {
isNormalUser = true;
packages = with lib; concatMapAttrs (name: request: attrValues request.packages) validRequests;
packages = with lib; concatMapAttrs (_name: request: attrValues request.packages) validRequests;
extraGroups = lib.optional config.wheel "wheel";
};
};
@ -133,10 +133,10 @@ in
inputs.nixops4-nixos.modules.nixops4Resource.nixos
];
nixos.module =
{ pkgs, ... }:
{ ... }:
{
users.users = config.resources.shell.login-shell.apply (
lib.filterAttrs (name: value: value ? login-shell) requests
lib.filterAttrs (_name: value: value ? login-shell) requests
);
};
};
@ -164,8 +164,7 @@ in
{
inherit (fediversity) example-deployment;
};
expected =
{
expected = {
};
};
}

View file

@ -10,7 +10,6 @@ let
attrsOf
attrTag
deferredModuleWith
submoduleWith
submodule
optionType
functionTo
@ -37,7 +36,7 @@ in
description = "Collection of deployment resources that can be required by applications and policed by hosting providers";
type = attrsOf (
submodule (
{ config, ... }:
{ ... }:
{
_class = "fediversity-resource";
options = {
@ -56,7 +55,7 @@ in
{
_class = "fediversity-resource-policy";
options.apply = mkOption {
desciption = "Apply the policy to a request";
description = "Apply the policy to a request";
};
}
];
@ -161,13 +160,13 @@ in
description = "Configuration type declaring options to be set by operators";
type = optionType;
readOnly = true;
default = submodule (configuration: {
default = submodule {
options = {
enable = lib.mkEnableOption {
description = "your Fediversity configuration";
};
applications = lib.mapAttrs (
name: application:
_name: application:
mkOption {
description = application.description;
type = submodule application.module;
@ -175,7 +174,7 @@ in
}
) config.applications;
};
});
};
};
};
}