perf: Home-manager to module

feat: Optionise config
This commit is contained in:
2025-02-02 14:57:36 +03:00
parent f2c215460b
commit ea39ab9992
97 changed files with 395 additions and 488 deletions

20
host/modules/common.nix Normal file
View File

@ -0,0 +1,20 @@
{ lib, inputs, hostname }: {
imports = [
inputs.sops-nix.nixosModules.sops
../${hostname}/hardware-configuration.nix
../../modules/host.nix
./packages.nix
];
options = {
host.laptop = lib.mkEnableOption "laptop mode";
};
config = {
networking.hostName = hostname;
time.timeZone = lib.mkDefault "Europe/Moscow";
i18n.defaultLocale = lib.mkDefault "ru_RU.UTF-8";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "23.05";
};
}

27
host/modules/nvidia.nix Normal file
View File

@ -0,0 +1,27 @@
{ config, pkgs, lib, ... }: {
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [nvidia-vaapi-driver intel-media-driver];
extraPackages32 = with pkgs.pkgsi686Linux; [nvidia-vaapi-driver intel-media-driver];
};
nvidia = {
modesetting.enable = true;
powerManagement = {
enable = true;
finegrained = false;
};
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.beta;
prime = lib.optionalAttrs config.host.laptop {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
};
}

34
host/modules/packages.nix Normal file
View File

@ -0,0 +1,34 @@
{ pkgs, inputs, ... }: {
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
file
tree
wget
git
(btop.override { cudaSupport = true; })
unzip
yazi
zip
lazygit
httpie
ncdu
tldr
helix
];
fonts.packages = with pkgs; [
jetbrains-mono
noto-fonts
noto-fonts-emoji
noto-fonts-cjk-sans
twemoji-color-font
font-awesome
powerline-fonts
powerline-symbols
ubuntu_font_family
unifont
nerd-fonts.symbols-only
corefonts
];
}