Refactor Nix configurations for improved readability and organization; update package declarations to use 'with pkgs;' syntax and remove unnecessary builtins.attrValues.

This commit is contained in:
2025-07-23 14:18:20 -03:00
parent 5c62858c37
commit 6268fe3b00
29 changed files with 256 additions and 233 deletions

View File

@@ -4,8 +4,7 @@
lib,
pkgs,
...
}:
{
}: {
imports = lib.flatten [
(map lib.custom.relativeToRoot [
"modules/common/host-spec.nix"
@@ -23,7 +22,7 @@
username = "user";
};
fileSystems."/boot".options = [ "umask=0077" ]; # Removes permissions and security warnings.
fileSystems."/boot".options = ["umask=0077"]; # Removes permissions and security warnings.
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot = {
enable = true;
@@ -44,14 +43,12 @@
"systemd.journald.forward_to_console=1"
];
environment.systemPackages = builtins.attrValues {
inherit (pkgs)
wget
curl
rsync
git
;
};
environment.systemPackages = with pkgs; [
wget
curl
rsync
git
];
networking = {
networkmanager.enable = true;
@@ -61,15 +58,15 @@
qemuGuest.enable = true;
openssh = {
enable = true;
ports = [ 22 ];
ports = [22];
settings.PermitRootLogin = "yes";
authorizedKeysFiles = lib.mkForce [ "/etc/ssh/authorized_keys.d/%u" ];
authorizedKeysFiles = lib.mkForce ["/etc/ssh/authorized_keys.d/%u"];
};
};
nix = {
# registry and nixPath shouldn't be required here because flakes but removal results in warning spam on build
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
settings = {