Refactor directory structure
This commit is contained in:
17
modules/system/hardware/amd.nix
Normal file
17
modules/system/hardware/amd.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
|
||||
hardware.opengl.extraPackages = with pkgs; [
|
||||
amdvlk
|
||||
];
|
||||
|
||||
hardware.opengl.extraPackages32 = with pkgs; [
|
||||
driversi686Linux.amdvlk
|
||||
];
|
||||
|
||||
programs.gamemode.enable = true;
|
||||
}
|
15
modules/system/hardware/bluetooth.nix
Normal file
15
modules/system/hardware/bluetooth.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
settings = {
|
||||
General = {
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.blueman.enable = true;
|
||||
}
|
9
modules/system/hardware/firewall.nix
Normal file
9
modules/system/hardware/firewall.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 53317 ];
|
||||
allowedUDPPorts = [ 53317 ];
|
||||
};
|
||||
}
|
33
modules/system/hardware/fprint.nix
Normal file
33
modules/system/hardware/fprint.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.fprintd.enable = true;
|
||||
|
||||
security.pam.services.hyprlock = {
|
||||
text = ''
|
||||
auth sufficient pam_unix.so try_first_pass likeauth nullok
|
||||
auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so
|
||||
auth include login
|
||||
'';
|
||||
};
|
||||
|
||||
security.pam.services.greetd = {
|
||||
text = ''
|
||||
account required pam_unix.so # unix (order 10900)
|
||||
|
||||
# Authentication management.
|
||||
auth sufficient pam_unix.so likeauth nullok try_first_pass # unix (order 11600)
|
||||
auth sufficient /nix/store/bz12s6mba297725i9y35p73lvsic8gd3-fprintd-1.94.2/lib/security/pam_fprintd.so # fprintd (order 11400)
|
||||
auth required pam_deny.so # deny (order 12400)
|
||||
|
||||
# Password management.
|
||||
password sufficient pam_unix.so nullok yescrypt # unix (order 10200)
|
||||
|
||||
# Session management.
|
||||
session required pam_env.so conffile=/etc/pam/environment readenv=0 # env (order 10100)
|
||||
session required pam_unix.so # unix (order 10200)
|
||||
session required pam_loginuid.so # loginuid (order 10300)
|
||||
session optional /nix/store/dzp7d4k1d94s1x49p9171mvcsfyxr7bj-systemd-254.6/lib/security/pam_systemd.so # systemd (order 12000) login
|
||||
'';
|
||||
};
|
||||
}
|
11
modules/system/hardware/garbage-collection.nix
Normal file
11
modules/system/hardware/garbage-collection.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 1w";
|
||||
};
|
||||
|
||||
nix.settings.auto-optimise-store = true;
|
||||
}
|
18
modules/system/hardware/laptop.nix
Normal file
18
modules/system/hardware/laptop.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.auto-cpufreq.enable = true;
|
||||
services.auto-cpufreq.settings = {
|
||||
battery = {
|
||||
governor = "powersave";
|
||||
turbo = "never";
|
||||
};
|
||||
charger = {
|
||||
governor = "performance";
|
||||
turbo = "auto";
|
||||
};
|
||||
};
|
||||
|
||||
powerManagement.powertop.enable = true;
|
||||
}
|
||||
|
21
modules/system/hardware/locale.nix
Normal file
21
modules/system/hardware/locale.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Amsterdam";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "nl_NL.UTF-8";
|
||||
LC_IDENTIFICATION = "nl_NL.UTF-8";
|
||||
LC_MEASUREMENT = "nl_NL.UTF-8";
|
||||
LC_MONETARY = "nl_NL.UTF-8";
|
||||
LC_NAME = "nl_NL.UTF-8";
|
||||
LC_NUMERIC = "nl_NL.UTF-8";
|
||||
LC_PAPER = "nl_NL.UTF-8";
|
||||
LC_TELEPHONE = "nl_NL.UTF-8";
|
||||
LC_TIME = "nl_NL.UTF-8";
|
||||
};
|
||||
}
|
39
modules/system/hardware/nvidia.nix
Normal file
39
modules/system/hardware/nvidia.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{ config, lib, pkgs, nixpkgs, ... }:
|
||||
|
||||
{
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
"nvidia-x11"
|
||||
"nvidia-settings"
|
||||
];
|
||||
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = ["nvidia"]; # or "nvidiaLegacy470 etc.
|
||||
|
||||
hardware.nvidia = {
|
||||
|
||||
modesetting.enable = true;
|
||||
|
||||
powerManagement.enable = false;
|
||||
|
||||
# Fine-grained power management. Turns off GPU when not in use.
|
||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
||||
powerManagement.finegrained = false;
|
||||
|
||||
# Use the NVidia open source kernel module (not to be confused with the
|
||||
# independent third-party "nouveau" open source driver).
|
||||
# Support is limited to the Turing and later architectures. Full list of
|
||||
# supported GPUs is at:
|
||||
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
|
||||
# Only available from driver 515.43.04+
|
||||
# Currently alpha-quality/buggy, so false is currently the recommended setting.
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
}
|
8
modules/system/hardware/printing.nix
Normal file
8
modules/system/hardware/printing.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
services.printing = {
|
||||
enable = true;
|
||||
drivers = [ pkgs.hplip ];
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user