2024-09-17 23:21:29 -07:00
|
|
|
|
# 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,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
{
|
|
|
|
|
imports = [
|
|
|
|
|
# Include the results of the hardware scan.
|
|
|
|
|
./hardware-configuration.nix
|
|
|
|
|
];
|
2024-12-15 17:50:53 -08:00
|
|
|
|
services.fprintd.enable = true;
|
|
|
|
|
security.pam.services.login.fprintAuth = true;
|
2025-04-27 02:36:35 -07:00
|
|
|
|
hardware.graphics.extraPackages = with pkgs; [
|
|
|
|
|
vaapiIntel
|
|
|
|
|
intel-media-driver
|
|
|
|
|
];
|
|
|
|
|
hardware.graphics.enable32Bit = true;
|
|
|
|
|
hardware.opengl = {
|
2025-03-07 12:18:43 -08:00
|
|
|
|
enable = true;
|
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
|
# your Open GL, Vulkan and VAAPI drivers
|
2025-04-27 02:36:35 -07:00
|
|
|
|
vpl-gpu-rt # for newer GPUs on NixOS >24.05 or unstable
|
2025-03-07 12:18:43 -08:00
|
|
|
|
# onevpl-intel-gpu # for newer GPUs on NixOS <= 24.05
|
|
|
|
|
# intel-media-sdk # for older GPUs
|
|
|
|
|
];
|
|
|
|
|
};
|
2025-01-17 16:23:19 -08:00
|
|
|
|
|
2024-11-27 20:22:18 -08:00
|
|
|
|
hardware = {
|
|
|
|
|
pulseaudio.support32Bit = true;
|
2025-02-08 01:14:57 -08:00
|
|
|
|
openrazer.enable = true;
|
2024-11-27 20:22:18 -08:00
|
|
|
|
};
|
2025-03-07 12:18:43 -08:00
|
|
|
|
virtualisation.podman = {
|
|
|
|
|
enable = true;
|
|
|
|
|
dockerCompat = true;
|
|
|
|
|
};
|
2025-06-03 21:50:23 -07:00
|
|
|
|
nixpkgs.config.permittedInsecurePackages = [
|
|
|
|
|
"olm-3.2.16"
|
|
|
|
|
];
|
2024-12-03 17:30:36 -08:00
|
|
|
|
boot = {
|
|
|
|
|
# Bootloader.
|
|
|
|
|
loader.systemd-boot.enable = true;
|
|
|
|
|
loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
plymouth = {
|
|
|
|
|
enable = true;
|
2024-12-15 17:50:53 -08:00
|
|
|
|
font = "${config.stylix.fonts.monospace.package}/share/fonts/truetype/NerdFonts/CaskaydiaCove/CaskaydiaCoveNerdFontMono-Regular.ttf";
|
2024-12-03 17:30:36 -08:00
|
|
|
|
};
|
|
|
|
|
consoleLogLevel = 3;
|
|
|
|
|
initrd.systemd.enable = true;
|
|
|
|
|
initrd.verbose = false;
|
|
|
|
|
kernelParams = [
|
|
|
|
|
"quiet"
|
|
|
|
|
"splash"
|
|
|
|
|
"boot.shell_on_fail"
|
|
|
|
|
"rd.systemd.show_status=false"
|
|
|
|
|
"rd.udev.log_level=3"
|
|
|
|
|
"udev.log_priority=3"
|
|
|
|
|
"mem_sleep_default=deep"
|
|
|
|
|
];
|
|
|
|
|
};
|
2024-09-17 23:21:29 -07:00
|
|
|
|
virtualisation.waydroid.enable = true;
|
2025-01-17 16:23:19 -08:00
|
|
|
|
|
|
|
|
|
boot.kernelPackages = pkgs.linuxPackages_zen;
|
|
|
|
|
|
2024-09-17 23:21:29 -07:00
|
|
|
|
networking.hostName = "shiroko"; # Define your hostname.
|
2024-11-27 20:22:18 -08:00
|
|
|
|
|
|
|
|
|
services.printing.enable = true;
|
|
|
|
|
services.avahi = {
|
|
|
|
|
enable = true;
|
|
|
|
|
nssmdns4 = true;
|
|
|
|
|
openFirewall = true;
|
|
|
|
|
};
|
2024-12-03 17:30:36 -08:00
|
|
|
|
|
|
|
|
|
services.keyd = {
|
|
|
|
|
enable = true;
|
|
|
|
|
keyboards.default = {
|
|
|
|
|
ids = [ "*" ];
|
|
|
|
|
settings = {
|
|
|
|
|
main = {
|
|
|
|
|
capslock = "esc";
|
|
|
|
|
leftalt = "leftcontrol";
|
|
|
|
|
leftcontrol = "leftalt";
|
|
|
|
|
y = "z";
|
|
|
|
|
z = "y";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-11-19 08:07:14 -08:00
|
|
|
|
#security yargen
|
|
|
|
|
#If i become a twat
|
2024-11-05 10:25:03 -08:00
|
|
|
|
services.desktopManager.plasma6.enable = false;
|
2024-09-24 21:17:49 -07:00
|
|
|
|
|
2024-09-17 23:21:29 -07:00
|
|
|
|
# Configure network proxy if necessary
|
|
|
|
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
|
|
|
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
2024-09-18 10:28:09 -07:00
|
|
|
|
security.polkit.enable = true;
|
2024-09-17 23:21:29 -07:00
|
|
|
|
# Enable networking
|
|
|
|
|
networking.networkmanager.enable = true;
|
|
|
|
|
|
2024-11-19 08:07:14 -08:00
|
|
|
|
#Here's my Attempt of Sleep XD
|
|
|
|
|
systemd.sleep.extraConfig = ''
|
|
|
|
|
AllowSuspend=yes
|
|
|
|
|
AllowHibernation=yes
|
|
|
|
|
AllowHybridSleep=yes
|
|
|
|
|
AllowSuspendThenHibernate=yes
|
|
|
|
|
'';
|
2025-01-10 15:29:27 -08:00
|
|
|
|
#Conclusion: Intel Hates Me
|
2024-11-19 08:07:14 -08:00
|
|
|
|
|
|
|
|
|
#laptop Optmization
|
|
|
|
|
powerManagement.enable = true;
|
|
|
|
|
services.tlp = {
|
|
|
|
|
enable = true;
|
|
|
|
|
settings = {
|
|
|
|
|
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
2025-07-01 20:55:29 -07:00
|
|
|
|
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
2024-11-19 08:07:14 -08:00
|
|
|
|
|
2025-07-01 20:55:29 -07:00
|
|
|
|
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
2024-11-19 08:07:14 -08:00
|
|
|
|
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
|
|
|
|
|
|
|
|
|
CPU_MIN_PERF_ON_AC = 0;
|
|
|
|
|
CPU_MAX_PERF_ON_AC = 100;
|
|
|
|
|
CPU_MIN_PERF_ON_BAT = 0;
|
|
|
|
|
CPU_MAX_PERF_ON_BAT = 20;
|
|
|
|
|
|
|
|
|
|
#Optional helps save long term battery health
|
|
|
|
|
START_CHARGE_THRESH_BAT0 = 20; # 40 and bellow it starts to charge
|
2024-11-27 20:22:18 -08:00
|
|
|
|
STOP_CHARGE_THRESH_BAT0 = 98; # 80 and above it stops charging
|
2024-11-19 08:07:14 -08:00
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
};
|
2025-01-24 11:51:11 -08:00
|
|
|
|
environment.systemPackages = with pkgs; [
|
2025-02-08 01:14:57 -08:00
|
|
|
|
openrazer-daemon
|
2025-03-07 12:18:43 -08:00
|
|
|
|
distrobox
|
2025-01-24 11:51:11 -08:00
|
|
|
|
];
|
2024-09-17 23:21:29 -07:00
|
|
|
|
# Set your time zone.
|
2025-01-09 10:53:15 -08:00
|
|
|
|
time.timeZone = "America/Los_Angeles"; # Asia/Taipei lib.mkDefault
|
2024-12-27 20:52:26 +08:00
|
|
|
|
#services.automatic-timezoned.enable = true;
|
2025-01-09 10:53:15 -08:00
|
|
|
|
#time.timeZone = lib.mkForce null;
|
|
|
|
|
#services.timesyncd.enable = true;
|
2025-01-05 15:37:29 +08:00
|
|
|
|
systemd.services = {
|
|
|
|
|
# Ensure network uplink on boot
|
|
|
|
|
NetworkManager-wait-online.enable = true;
|
2024-09-17 23:21:29 -07:00
|
|
|
|
|
2025-01-05 15:37:29 +08:00
|
|
|
|
# Automatic time zone switching
|
|
|
|
|
updateTimezone = {
|
|
|
|
|
description = "Automatically update timezone using `timedatectl` and `tzupdate`";
|
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
after = [ "network-online.target" ];
|
|
|
|
|
requires = [ "network-online.target" ];
|
|
|
|
|
script = ''
|
|
|
|
|
timedatectl set-timezone $("${pkgs.tzupdate}/bin/tzupdate" -p)
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-09-17 23:21:29 -07:00
|
|
|
|
# Select internationalisation properties.
|
2025-03-07 12:18:43 -08:00
|
|
|
|
|
2025-04-27 02:36:35 -07:00
|
|
|
|
networking.firewall = {
|
2025-03-07 12:18:43 -08:00
|
|
|
|
allowedUDPPorts = [ 51820 ]; # Clients and peers can use the same port, see listenport
|
|
|
|
|
};
|
|
|
|
|
# Enable WireGuard
|
|
|
|
|
# networking.wireguard.interfaces = {
|
|
|
|
|
# # "wg0" is the network interface name. You can name the interface arbitrarily.
|
|
|
|
|
# wg0 = {
|
|
|
|
|
# # Determines the IP address and subnet of the client's end of the tunnel interface.
|
|
|
|
|
# ips = [ "10.100.0.2/24" ];
|
|
|
|
|
# listenPort = 51820; # to match firewall allowedUDPPorts (without this wg uses random port numbers)
|
|
|
|
|
#
|
|
|
|
|
# # Path to the private key file.
|
|
|
|
|
# #
|
|
|
|
|
# # Note: The private key can also be included inline via the privateKey option,
|
|
|
|
|
# # but this makes the private key world-readable; thus, using privateKeyFile is
|
|
|
|
|
# # recommended.
|
|
|
|
|
# privateKeyFile = "path to private key file";
|
|
|
|
|
#
|
|
|
|
|
# peers = [
|
|
|
|
|
# # For a client configuration, one peer entry for the server will suffice.
|
|
|
|
|
#
|
|
|
|
|
# {
|
|
|
|
|
# # Public key of the server (not a file path).
|
|
|
|
|
# publicKey = "{server public key}";
|
|
|
|
|
#
|
|
|
|
|
# # Forward all the traffic via VPN.
|
|
|
|
|
# allowedIPs = [ "0.0.0.0/0" ];
|
|
|
|
|
# # Or forward only particular subnets
|
|
|
|
|
# #allowedIPs = [ "10.100.0.1" "91.108.12.0/22" ];
|
|
|
|
|
#
|
|
|
|
|
# # Set this to the server IP and port.
|
|
|
|
|
# endpoint = "{server ip}:51820"; # ToDo: route to endpoint not automatically configured https://wiki.archlinux.org/index.php/WireGuard#Loop_routing https://discourse.nixos.org/t/solved-minimal-firewall-setup-for-wireguard-client/7577
|
|
|
|
|
#
|
|
|
|
|
# # Send keepalives every 25 seconds. Important to keep NAT tables alive.
|
|
|
|
|
# persistentKeepalive = 25;
|
|
|
|
|
# }
|
|
|
|
|
# ];
|
|
|
|
|
# };
|
|
|
|
|
# };
|
2025-04-27 02:36:35 -07:00
|
|
|
|
i18n.defaultLocale = "en_US.UTF-8";
|
2024-09-17 23:21:29 -07:00
|
|
|
|
|
|
|
|
|
i18n.extraLocaleSettings = {
|
|
|
|
|
LC_ADDRESS = "en_US.UTF-8";
|
|
|
|
|
LC_IDENTIFICATION = "en_US.UTF-8";
|
|
|
|
|
LC_MEASUREMENT = "en_US.UTF-8";
|
|
|
|
|
LC_MONETARY = "en_US.UTF-8";
|
|
|
|
|
LC_NAME = "en_US.UTF-8";
|
|
|
|
|
LC_NUMERIC = "en_US.UTF-8";
|
|
|
|
|
LC_PAPER = "en_US.UTF-8";
|
|
|
|
|
LC_TELEPHONE = "en_US.UTF-8";
|
|
|
|
|
LC_TIME = "en_US.UTF-8";
|
|
|
|
|
};
|
2025-04-27 02:36:35 -07:00
|
|
|
|
|
2024-09-17 23:21:29 -07:00
|
|
|
|
# Some programs need SUID wrappers, can be configured further or are
|
|
|
|
|
# started in user sessions.
|
|
|
|
|
# programs.mtr.enable = true;
|
|
|
|
|
|
|
|
|
|
# List services that you want to enable:
|
|
|
|
|
|
|
|
|
|
# Open ports in the firewall.
|
|
|
|
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
|
|
|
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
|
|
|
|
# Or disable the firewall altogether.
|
|
|
|
|
# networking.firewall.enable = false;
|
|
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
|
|
|
system.stateVersion = "24.11"; # Did you read the comment?
|
|
|
|
|
}
|