Add framework_configuration.nix

This commit is contained in:
Max Gialanella 2024-08-16 18:23:24 -07:00
commit 16265c137d

326
framework_configuration.nix Normal file
View File

@ -0,0 +1,326 @@
{ config, pkgs, lib, ... }:
{
imports =
[
./hardware-configuration.nix
<nixos-hardware/framework/13-inch/7040-amd>
# ./amd-gpu.nix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# https://git.exozy.me/a/zenpower3
boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.supportedFilesystems = [ "btrfs" "ext2" "ext3" "ext4" "exfat" "f2fs" "fat8" "fat16" "fat32" "ntfs" "xfs" ]; # "zfs"
# Workaround for SuspendThenHibernate: https://lore.kernel.org/linux-kernel/20231106162310.85711-1-mario.limonciello@amd.com/
boot.kernelParams = [
"amdgpu.sg_display=0" # reported to help with flashing display issues
"rtc_cmos.use_acpi_alarm=1"
"amd_pstate=active"
"mem_sleep_default=deep" # Force S3 sleep mode. See README.wiki for details.
] ;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# AMD has better battery life with PPD over TLP:
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
services.power-profiles-daemon.enable = lib.mkDefault true;
# https://github.com/AdnanHodzic/auto-cpufreq
# services.auto-cpufreq.enable = true;
# auto-tune on start
powerManagement.powertop.enable = true;
#services.tlp.enable = true;
# Vulcan enable
hardware.opengl.extraPackages = [ pkgs.rocm-opencl-icd pkgs.amdvlk ];
# For fingerprint support
services.fprintd.enable = lib.mkDefault true;
# Custom udev rules
services.udev.extraRules = ''
# Ethernet expansion card support
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20"
'';
# Fix font sizes in X
# services.xserver.dpi = 120;
# Needed for desktop environments to detect/manage display brightness
hardware.sensor.iio.enable = lib.mkDefault true;
# Fix TRRS headphones missing a mic
# https://community.frame.work/t/headset-microphone-on-linux/12387/3
boot.extraModprobeConfig = lib.mkIf (lib.versionOlder pkgs.linux.version "6.6.8") ''
options snd-hda-intel model=dell-headset-multi
'';
# enable networkings
networking = {
hostName = "NixWork";
hostId = "4b61cee0"; # cat /etc/machine-id, first 8 letters
networkmanager.enable = true;
};
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Set your time zone.
time.timeZone = "America/Phoenix";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
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";
};
# Enabke weekly trim
services.fstrim.enable = true;
# Enable the X11 windowing system.
services.xserver.enable = true;
services.touchegg.enable = true;
# Enable the KDE Plasma Desktop Environment.
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
# Setup Bluetooth
hardware.bluetooth.enable = true; # enables support for Bluetooth
hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot
# Configure keymap in X11
services.xserver = {
layout = "us";
xkbVariant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ 8000 ];
networking.firewall.allowedUDPPorts = [ 8000 ];
# 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. Its 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.05"; # Did you read the comment?
# Mount data partition and steam library, lsblk -o name,model,serial,uuid,size - list connected disks
fileSystems."/run/media/mab/BYTOIDS" = {
device = "/dev/disk/by-uuid/3afbf997-5c0e-4c6f-8145-bc16557f8781";
fsType = "ext4";
options = [ "nofail" ];
};
# garbage collect, delete old versions
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 10d";
};
# automatically optomise nix store
nix.optimise = {
automatic = true;
dates = [ "weekly" ];
};
networking.extraHosts =
''
192.168.1.15 dinx.local
192.168.1.6 tower.local
192.168.1.164 marvin.local
192.168.1.7 blarvin.local
52.89.99.61 redeye.dev
'';
# Tell programs to save config files locally, fixes a lot of gnome issues
# programs.dconf.enable = true;
# enable fish shell but only for this user
programs.fish.enable = true;
users.users.mab.shell = pkgs.fish;
# Make Firefox use the KDE file picker.
# Preferences source: https://wiki.archlinux.org/title/firefox#KDE_integration
programs.firefox = {
enable = true;
preferences = {
"widget.use-xdg-desktop-portal.file-picker" = 1;
};
};
# Enable steam
programs.steam.enable = true;
# programs.kdeconnect.enable = true;
services.auto-cpufreq.enable = true;
services.auto-cpufreq.settings = {
battery = {
governor = "powersave";
turbo = "never";
};
charger = {
governor = "performance";
turbo = "never";
};
};
programs.corectrl.enable = true; # enable core control
services.auto-epp.enable = true;
services.auto-epp.settings.Settings = {
# options performance, balance_performance, power
epp_state_for_AC = "power";
epp_state_for_BAT = "power";
};
# Define a user account. Don't forget to set a password with passwd.
users.users.mab = {
isNormalUser = true;
description = "Merb Girkbinella";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
# Utility
kate
vlc
gnome.cheese
#plasma-browser-integration
qdirstat # Check drive space with gui
fsearch # search all files fast
brave
appimage-run # App image runner for nixos
#libsForQt5.bismuth
# peazip # frontend unarchiver
# Programming
vscodium
copyq
autokey
dbeaver-bin
guake
zed-editor
# Social
signal-desktop
discord
slack
#zoom-us
# Fun
spotify
freetube
rpcs3
#yuzu-early-access
moonlight-qt # sunshine streaming client
pcsx2
#bullshit
#teams-for-linux
];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
programs.kdeconnect.enable = true; # Enable KDE Connect
# List packages installed in system profile.
environment.systemPackages = with pkgs; [
vim
wget
git
screen
thefuck
ollama
vorta # GUI for backup utility Borg Backup
direnv
pgcli # needed for dbeaver
postgresql_16 # needed for dbeaver
baekmuk-ttf # korean fonts
nmap
# autokey packages
python312
python312Packages.requests
# fonts!
corefonts
vistafonts
fira-code
fira-code-symbols
];
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
liberation_ttf
fira-code
fira-code-symbols
mplus-outline-fonts.githubRelease
dina-font
proggyfonts
];
fonts.enableDefaultPackages = true;
fonts.fontDir.enable = true;
# Tools you may use again android-tools, bluetuith, gparted, libgcc
# Enable Flatpak
#services.flatpak.enable = true;
# add flathub link for installing with flathub syntax
#system.activationScripts.flathub = "/run/current-system/sw/bin/flatpak remote-add --system --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo";
# How to use appimages -> https://nixos.wiki/wiki/Appimage
}