rename shared to modules
This commit is contained in:
42
hosts/modules/fonts.nix
Normal file
42
hosts/modules/fonts.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{ pkgs, inputs, ... }: {
|
||||
|
||||
fonts = {
|
||||
packages = with pkgs; [
|
||||
material-icons
|
||||
material-design-icons
|
||||
roboto
|
||||
work-sans
|
||||
comic-neue
|
||||
source-sans
|
||||
twemoji-color-font
|
||||
comfortaa
|
||||
inter
|
||||
lato
|
||||
lexend
|
||||
jost
|
||||
dejavu_fonts
|
||||
iosevka-bin
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
noto-fonts-emoji
|
||||
jetbrains-mono
|
||||
(nerdfonts.override { fonts = [ "FiraCode" "Meslo" ]; })
|
||||
inputs.apple-fonts.packages.${pkgs.system}.sf-pro-nerd
|
||||
inputs.apple-fonts.packages.${pkgs.system}.sf-mono-nerd
|
||||
openmoji-color
|
||||
];
|
||||
|
||||
enableDefaultPackages = false;
|
||||
|
||||
# this fixes emoji stuff
|
||||
fontconfig = {
|
||||
defaultFonts = {
|
||||
monospace = [ "FiraCode Nerd Font Mono" "Noto Color Emoji" ];
|
||||
sansSerif = [ "SFProDisplay Nerd Font" "Noto Color Emoji" ];
|
||||
serif = [ "SFProDisplay Nerd Font" "Noto Color Emoji" ];
|
||||
emoji = [ "Noto Color Emoji" ];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
17
hosts/modules/nginx.nix
Normal file
17
hosts/modules/nginx.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts = {
|
||||
"test.anotherhadi.com" = {
|
||||
locations."/" = {
|
||||
proxy_set_header = [
|
||||
"X-Real-IP $remote_addr"
|
||||
"proxy_set_header Host $host"
|
||||
"proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
|
||||
];
|
||||
proxyPass = "http://192.168.2.22:80";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
52
hosts/modules/nvidia.nix
Normal file
52
hosts/modules/nvidia.nix
Normal file
@@ -0,0 +1,52 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
let
|
||||
nvidiaDriverChannel =
|
||||
config.boot.kernelPackages.nvidiaPackages.beta; # stable, latest, etc.
|
||||
in {
|
||||
# Load nvidia driver for Xorg and Wayland
|
||||
services.xserver.videoDrivers = [ "nvidia" ]; # or "nvidiaLegacy470 etc.
|
||||
boot.kernelParams =
|
||||
lib.optionals (lib.elem "nvidia" config.services.xserver.videoDrivers) [
|
||||
"nvidia-drm.modeset=1"
|
||||
"nvidia_drm.fbdev=1"
|
||||
];
|
||||
environment.variables = {
|
||||
VK_DRIVER_FILES =
|
||||
/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json;
|
||||
GBM_BACKEND = "nvidia-drm";
|
||||
WLR_NO_HARDWARE_CURSORS = "1";
|
||||
LIBVA_DRIVER_NAME = "nvidia"; # hardware acceleration
|
||||
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
||||
};
|
||||
nixpkgs.config = {
|
||||
nvidia.acceptLicense = true;
|
||||
allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
"cudatoolkit"
|
||||
"nvidia-persistenced"
|
||||
"nvidia-settings"
|
||||
"nvidia-x11"
|
||||
];
|
||||
};
|
||||
hardware = {
|
||||
nvidia = {
|
||||
open = false;
|
||||
nvidiaSettings = false;
|
||||
powerManagement.enable =
|
||||
false; # This can cause sleep/suspend to fail and saves entire VRAM to /tmp/
|
||||
modesetting.enable = true;
|
||||
package = nvidiaDriverChannel;
|
||||
};
|
||||
opengl = {
|
||||
enable = true;
|
||||
package = nvidiaDriverChannel;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
extraPackages = with pkgs; [
|
||||
nvidia-vaapi-driver
|
||||
vaapiVdpau
|
||||
libvdpau-va-gl
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
6
hosts/modules/openssh.nix
Normal file
6
hosts/modules/openssh.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [ 22 ];
|
||||
};
|
||||
}
|
||||
13
hosts/modules/prime.nix
Normal file
13
hosts/modules/prime.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
hardware.nvidia.prime = {
|
||||
# offload = {
|
||||
# enable = true;
|
||||
# enableOffloadCmd = true;
|
||||
# };
|
||||
|
||||
sync.enable = true;
|
||||
|
||||
amdgpuBusId = "PCI:5:0:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
};
|
||||
}
|
||||
29
hosts/modules/tuigreet.nix
Normal file
29
hosts/modules/tuigreet.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{ pkgs, ... }: {
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
default_session = {
|
||||
command =
|
||||
"${pkgs.greetd.tuigreet}/bin/tuigreet --remember --asterisks --container-padding 2 --time --time-format '%I:%M %p | %a • %h | %F' --cmd Hyprland";
|
||||
user = "greeter";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [ greetd.tuigreet ];
|
||||
|
||||
# this is a life saver.
|
||||
# literally no documentation about this anywhere.
|
||||
# might be good to write about this...
|
||||
# https://www.reddit.com/r/NixOS/comments/u0cdpi/tuigreet_with_xmonad_how/
|
||||
systemd.services.greetd.serviceConfig = {
|
||||
Type = "idle";
|
||||
StandardInput = "tty";
|
||||
StandardOutput = "tty";
|
||||
StandardError = "journal"; # Without this errors will spam on screen
|
||||
# Without these bootlogs will spam on screen
|
||||
TTYReset = true;
|
||||
TTYVHangup = true;
|
||||
TTYVTDisallocate = true;
|
||||
};
|
||||
}
|
||||
8
hosts/modules/variables-config.nix
Normal file
8
hosts/modules/variables-config.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ lib, ... }: {
|
||||
options = {
|
||||
var = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user