Format the Nix files

This commit is contained in:
Gabriel Arazas 2021-11-29 17:58:02 +08:00
parent e2699c2cea
commit 2cf96cb1f3
4 changed files with 54 additions and 51 deletions

View File

@ -86,5 +86,7 @@
}) (libExtended.filterAttrs (n: v: !libExtended.elem n excludedModules) }) (libExtended.filterAttrs (n: v: !libExtended.elem n excludedModules)
(libExtended.filesToAttr ./users)); (libExtended.filesToAttr ./users));
packages = forAllSystems
(system: import ./pkgs { pkgs = import nixpkgs { inherit system; }; });
}; };
} }

View File

@ -132,7 +132,8 @@ in rec {
getUsers = users: getUsers = users:
let let
userModules = filesToAttr ../users; userModules = filesToAttr ../users;
validUsers = lib.filter (user: lib.elem user (lib.attrNames userModules)) users; validUsers =
lib.filter (user: lib.elem user (lib.attrNames userModules)) users;
in lib.filterAttrs (n: _: lib.elem n validUsers) userModules; in lib.filterAttrs (n: _: lib.elem n validUsers) userModules;
/* Create an attribute set from two lists (or a zip). /* Create an attribute set from two lists (or a zip).

View File

@ -64,8 +64,7 @@ in {
}; };
}; };
fonts = with pkgs; fonts = with pkgs; [
[
iosevka iosevka
# Noto font family # Noto font family

View File

@ -17,21 +17,20 @@ let
xdg.enable = true; xdg.enable = true;
}; };
in in {
{
users.users.${user} = { users.users.${user} = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" ]; extraGroups = [ "wheel" ];
}; };
home-manager.users.${user} = userModule // defaultConfig; home-manager.users.${user} = userModule // defaultConfig;
}; };
in in {
{
options.modules.users = { options.modules.users = {
users = lib.mkOption { users = lib.mkOption {
default = []; default = [ ];
type = with lib.types; listOf str; type = with lib.types; listOf str;
description = "A list of users from the `./users` directory to be included in the NixOS config."; description =
"A list of users from the `./users` directory to be included in the NixOS config.";
}; };
}; };
@ -52,7 +51,9 @@ in
config = { config = {
assertions = [{ assertions = [{
assertion = (builtins.length nonexistentUsers) < 1; assertion = (builtins.length nonexistentUsers) < 1;
message = "${lib.concatMapStringsSep ", " (u: "'${u}'") nonexistentUsers} is not found in the `./users` directory."; message = "${
lib.concatMapStringsSep ", " (u: "'${u}'") nonexistentUsers
} is not found in the `./users` directory.";
}]; }];
}; };
} }