Files
mango/configuration.nix
2026-02-17 02:43:59 +09:00

165 lines
4.1 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
let
nvidia_grid_version = "535.288.01";
nvidia_grid_sha256 = "06jbq7hmzynrysxwac34sm0700137k2lliw789q1lkxb7dvzxyg7";
in
{
imports =
[ # Include the results of the hardware scan.
/etc/nixos/hardware-configuration.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_6_12;
boot.blacklistedKernelModules = [ "nouveau" ];
boot.supportedFilesystems = [ "nfs" ];
services.rpcbind.enable = true; # needed for NFS
systemd.mounts = [{
type = "nfs";
mountConfig = {
Options = "noatime";
};
what = "192.168.0.137:/mnt/user1/book";
where = "/book";
}];
systemd.automounts = [{
wantedBy = [ "multi-user.target" ];
automountConfig = {
TimeoutIdleSec = "600";
};
where = "/book";
}];
networking.hostName = "nixos"; # Define your hostname.
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Asia/Seoul";
# Select internationalisation properties.
i18n.defaultLocale = "ko_KR.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "ko_KR.UTF-8";
LC_IDENTIFICATION = "ko_KR.UTF-8";
LC_MEASUREMENT = "ko_KR.UTF-8";
LC_MONETARY = "ko_KR.UTF-8";
LC_NAME = "ko_KR.UTF-8";
LC_NUMERIC = "ko_KR.UTF-8";
LC_PAPER = "ko_KR.UTF-8";
LC_TELEPHONE = "ko_KR.UTF-8";
LC_TIME = "ko_KR.UTF-8";
};
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
#services.displayManager.sddm.enable = true;
#services.displayManager.sddm.wayland.enable = true;
hardware.graphics.enable = true; # Required for graphics acceleration
# 2. NVIDIA 드라이버 설정
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
open = false;
# GRID 드라이버 패키지 오버라이드
package = config.boot.kernelPackages.nvidiaPackages.stable.overrideAttrs (oldAttrs: {
version = nvidia_grid_version;
src = pkgs.fetchurl {
url = "file:///home/bangae1/mango/NVIDIA-Linux-x86_64-${nvidia_grid_version}-grid.run";
sha256 = nvidia_grid_sha256;
};
});
# GRID 기능을 위한 필수 설정
modesetting.enable = true;
powerManagement.enable = false;
};
boot.kernelParams = [ "nvidia.NVreg_EnableVideoMemorySelfRefresh=1" "nvidia.NVreg_OpenRm=0" ];
systemd.services.nvidia-gridd = {
description = "NVIDIA Grid Daemon";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "forking";
# 드라이버 패키지 경로에서 gridd 바이너리를 찾아 실행합니다.
ExecStart = "${config.hardware.nvidia.package}/bin/nvidia-gridd";
Restart = "on-failure";
};
};
# Define a user account. Don't forget to set a password with passwd.
users.users.bangae1 = {
isNormalUser = true;
description = "bangae1";
extraGroups = [ "networkmanager" "wheel" "input" "video" ];
packages = with pkgs; [];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
code
git
unzip
fish
eza
nfs-utils
ydotool
grim
kime
wlr-randr
kitty
sunshine
];
fonts.packages = with pkgs; [
nerd-fonts.jetbrains-mono
];
environment.etc."nvidia/gridd.conf".text = ''
ServerAddress=192.168.0.216
ServerPort=443
FeatureType=1
'';
nix.settings.experimental-features = [ "nix-command" "flakes" ];
programs.firefox.enable = true;
programs.fish.enable = true;
programs.nano.nanorc = ''
set tabsize 2
set tabstospaces
'';
services.openssh.enable = true;
system.stateVersion = "25.11"; # Did you read the comment?
}