180 lines
4.5 KiB
Nix
180 lines
4.5 KiB
Nix
# Edit this configuration file to define what should be installed on your system. Help is available in the configuration.nix(5) man page, on
|
||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||
|
||
{ config, lib, pkgs, inputs, ... }:
|
||
|
||
let
|
||
myRizin = pkgs.rizin.passthru.withPlugins
|
||
(plugins: [ plugins.jsdec plugins.rz-ghidra ]);
|
||
in {
|
||
imports = [
|
||
./hardware-configuration.nix
|
||
./services/virtual.nix
|
||
./services/x.nix
|
||
./services/sound.nix
|
||
./programs/hyprland.nix
|
||
];
|
||
|
||
services.logind = {
|
||
lidSwitch = "suspend-then-hibernate";
|
||
lidSwitchExternalPower = "suspend";
|
||
lidSwitchDocked = "ignore";
|
||
powerKey = "poweroff";
|
||
powerKeyLongPress = "poweroff";
|
||
};
|
||
|
||
systemd.sleep.extraConfig = ''
|
||
HibernateDelaySec=30min
|
||
SuspendState=mem
|
||
'';
|
||
|
||
services.tlp = {
|
||
enable = true;
|
||
settings = {
|
||
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
||
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||
CPU_BOOST_ON_BAT = 0;
|
||
CPU_BOOST_ON_AC = 1;
|
||
PLATFORM_PROFILE_ON_AC = "performance";
|
||
PLATFORM_PROFILE_ON_BAT = "low-power";
|
||
START_CHARGE_THRESH_BAT0 = 75;
|
||
STOP_CHARGE_THRESH_BAT0 =
|
||
80; # remove these two if your laptop doesn't support charge thresholds
|
||
};
|
||
};
|
||
powerManagement.enable = true;
|
||
|
||
services.power-profiles-daemon.enable = false;
|
||
|
||
nixpkgs.config.allowUnfree = true;
|
||
|
||
boot.kernel.sysctl = { "net.ipv4.ip_forward" = 1; };
|
||
|
||
#boot.loader.grub.device = "/dev/nvme1n1p1";
|
||
boot.loader = {
|
||
systemd-boot.enable = false;
|
||
efi = {
|
||
canTouchEfiVariables = true;
|
||
efiSysMountPoint = "/boot";
|
||
};
|
||
grub = {
|
||
enable = true;
|
||
device = "nodev";
|
||
efiSupport = true;
|
||
useOSProber = true;
|
||
};
|
||
};
|
||
|
||
networking.hostName = "haskell"; # Define your hostname.
|
||
|
||
programs.steam.enable = true;
|
||
|
||
programs.fish.enable = true;
|
||
programs.nix-ld = {
|
||
enable = true;
|
||
libraries = import ./modules/ld.nix { inherit pkgs; };
|
||
};
|
||
|
||
time.timeZone = "Asia/Seoul";
|
||
|
||
i18n.defaultLocale = "en_US.UTF-8";
|
||
i18n.inputMethod = {
|
||
type = "fcitx5";
|
||
enable = true;
|
||
fcitx5.addons = with pkgs; [ fcitx5-gtk fcitx5-hangul ];
|
||
};
|
||
# console = {
|
||
# font = "Lat2-Terminus16";
|
||
# keyMap = "us";
|
||
# useXkbConfig = true; # use xkb.options in tty.
|
||
# };
|
||
|
||
services.udev.packages = [ pkgs.libwacom pkgs.probe-rs-tools ];
|
||
|
||
services.usbmuxd = {
|
||
enable = false;
|
||
package = pkgs.usbmuxd2;
|
||
};
|
||
|
||
fonts.packages = with pkgs; [ nerd-fonts.monaspace ];
|
||
|
||
# Enable touchpad support (enabled default in most desktopManager).
|
||
# services.libinput.enable = true;
|
||
|
||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||
users.users.allen = {
|
||
isNormalUser = true;
|
||
extraGroups = [ "wheel" "podman" "dialout" ]; # Enable ‘sudo’ for the user.
|
||
shell = pkgs.fish;
|
||
home = "/home/allen";
|
||
packages = with pkgs; [ tree ];
|
||
};
|
||
|
||
users.groups.libvirtd.members = [ "allen" ];
|
||
users.groups.plugdev.members = [ "allen" ];
|
||
|
||
programs.firefox.enable = true;
|
||
|
||
# List packages installed in system profile.
|
||
# You can use https://search.nixos.org/ to find more packages (and options).
|
||
environment.systemPackages = with pkgs; [
|
||
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||
pkg-config
|
||
wget
|
||
ntfs3g
|
||
openssl
|
||
gnome-tweaks
|
||
xf86_input_wacom
|
||
glfw
|
||
wacomtablet
|
||
libimobiledevice
|
||
ifuse
|
||
git
|
||
bash
|
||
libopus
|
||
xmousepasteblock
|
||
libglvnd
|
||
libGL
|
||
openal
|
||
myRizin
|
||
libgit2
|
||
inputs.helix.packages."${pkgs.system}".helix
|
||
openmodelica
|
||
];
|
||
|
||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||
nix.settings.trusted-users = [ "root" "allen" ];
|
||
|
||
nix.settings = {
|
||
substituters =
|
||
[ "https://allen-nixpkgs.cachix.org" "https://cache.nixos.org" ];
|
||
trusted-public-keys = [
|
||
"allen-nixpkgs.cachix.org-1:GS5qDYVloEiC6oeJQNijR3hsMKPqDSGbYUz35qtbMpg="
|
||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||
];
|
||
};
|
||
|
||
environment.variables = {
|
||
LD_LIBRARY_PATH = lib.makeLibraryPath [
|
||
pkgs.libglvnd
|
||
pkgs.libGL
|
||
pkgs.glfw
|
||
pkgs.pulseaudio
|
||
pkgs.libgit2
|
||
];
|
||
HELLO = "WORLD";
|
||
};
|
||
|
||
environment.variables.EDITOR = "vim";
|
||
|
||
services.openssh.enable = true;
|
||
services.netbird.enable = true;
|
||
|
||
networking.firewall.enable = false;
|
||
|
||
system.stateVersion = "25.05"; # Did you read the comment?
|
||
|
||
}
|