fix typos, lint, format

This commit is contained in:
Kiara Grouwstra 2025-07-03 20:23:04 +02:00
parent 4b031652f7
commit 307ff1d6ac
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU
2 changed files with 10 additions and 10 deletions

View file

@ -40,7 +40,7 @@ in
_class = "fediversity-resource-policy"; _class = "fediversity-resource-policy";
options = { options = {
extra-config = mkOptions { extra-config = mkOption {
description = "Any options from NixOS"; description = "Any options from NixOS";
}; };
apply = mkOption { apply = mkOption {
@ -88,12 +88,12 @@ in
requests: requests:
let let
# Filter out requests that need wheel if policy doesn't allow it # 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 in
lib.optionalAttrs (validRequests != { }) { lib.optionalAttrs (validRequests != { }) {
${config.username} = { ${config.username} = {
isNormalUser = true; 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"; extraGroups = lib.optional config.wheel "wheel";
}; };
}; };
@ -135,10 +135,10 @@ in
inputs.nixops4-nixos.modules.nixops4Resource.nixos inputs.nixops4-nixos.modules.nixops4Resource.nixos
]; ];
nixos.module = nixos.module =
{ pkgs, ... }: { ... }:
{ {
users.users = config.resources.shell.login-shell.apply ( users.users = config.resources.shell.login-shell.apply (
lib.filterAttrs (name: value: value ? login-shell) requests lib.filterAttrs (_name: value: value ? login-shell) requests
); );
}; };
}; };

View file

@ -33,7 +33,7 @@ in
description = "Collection of deployment resources that can be required by applications and policed by hosting providers"; description = "Collection of deployment resources that can be required by applications and policed by hosting providers";
type = attrsOf ( type = attrsOf (
submodule ( submodule (
{ config, ... }: { ... }:
{ {
_class = "fediversity-resource"; _class = "fediversity-resource";
options = { options = {
@ -52,7 +52,7 @@ in
{ {
_class = "fediversity-resource-policy"; _class = "fediversity-resource-policy";
options.apply = mkOption { options.apply = mkOption {
desciption = "Apply the policy to a request"; description = "Apply the policy to a request";
}; };
} }
]; ];
@ -177,13 +177,13 @@ in
description = "Configuration type declaring options to be set by operators"; description = "Configuration type declaring options to be set by operators";
type = optionType; type = optionType;
readOnly = true; readOnly = true;
default = submodule (configuration: { default = submodule {
options = { options = {
enable = lib.mkEnableOption { enable = lib.mkEnableOption {
description = "your Fediversity configuration"; description = "your Fediversity configuration";
}; };
applications = lib.mapAttrs ( applications = lib.mapAttrs (
name: application: _name: application:
mkOption { mkOption {
description = application.description; description = application.description;
type = submodule application.module; type = submodule application.module;
@ -191,7 +191,7 @@ in
} }
) config.applications; ) config.applications;
}; };
}); };
}; };
}; };
} }