Gen 402: created system config for my laptop
This commit is contained in:
10
glasshouse-laptop/sys/bootloader.nix
Normal file
10
glasshouse-laptop/sys/bootloader.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
boot = {
|
||||
loader.systemd-boot.enable = true;
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
loader.systemd-boot.configurationLimit = 10;
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
};
|
||||
}
|
||||
69
glasshouse-laptop/sys/default.nix
Normal file
69
glasshouse-laptop/sys/default.nix
Normal file
@@ -0,0 +1,69 @@
|
||||
{ inputs, pkgs, config, self, username, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (import ./bootloader.nix) ]
|
||||
++ [ (import ./fonts.nix) ]
|
||||
++ [ (import ./hardware.nix) ]
|
||||
++ [ (import ./network.nix) ]
|
||||
++ [ (import ./packages.nix) ]
|
||||
++ [ (import ./programs.nix) ]
|
||||
++ [ (import ./services.nix) ]
|
||||
++ [ (import ./system.nix) ]
|
||||
++ [ (import ./users.nix) ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
acpi
|
||||
brightnessctl
|
||||
cpupower-gui
|
||||
powertop
|
||||
];
|
||||
|
||||
services = {
|
||||
power-profiles-daemon.enable = true;
|
||||
|
||||
upower = {
|
||||
enable = true;
|
||||
percentageLow = 20;
|
||||
percentageCritical = 5;
|
||||
percentageAction = 3;
|
||||
criticalPowerAction = "PowerOff";
|
||||
};
|
||||
|
||||
tlp.settings = {
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC = "power";
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||
|
||||
CPU_BOOST_ON_AC = 1;
|
||||
CPU_BOOST_ON_BAT = 1;
|
||||
|
||||
CPU_HWP_DYN_BOOST_ON_AC = 1;
|
||||
CPU_HWP_DYN_BOOST_ON_BAT = 1;
|
||||
|
||||
PLATFORM_PROFILE_ON_AC = "performance";
|
||||
PLATFORM_PROFILE_ON_BAT = "performance";
|
||||
|
||||
INTEL_GPU_MIN_FREQ_ON_AC=500;
|
||||
INTEL_GPU_MIN_FREQ_ON_BAT=500;
|
||||
# INTEL_GPU_MAX_FREQ_ON_AC=0;
|
||||
# INTEL_GPU_MAX_FREQ_ON_BAT=0;
|
||||
# INTEL_GPU_BOOST_FREQ_ON_AC=0;
|
||||
# INTEL_GPU_BOOST_FREQ_ON_BAT=0;
|
||||
|
||||
PCIE_ASPM_ON_AC = "default";
|
||||
PCIE_ASPM_ON_BAT = "powersupersave";
|
||||
};
|
||||
};
|
||||
|
||||
powerManagement.cpuFreqGovernor = "performance";
|
||||
|
||||
boot = {
|
||||
kernelModules = ["acpi_call"];
|
||||
extraModulePackages = with config.boot.kernelPackages;
|
||||
[
|
||||
acpi_call
|
||||
cpupower
|
||||
]
|
||||
++ [pkgs.cpupower-gui];
|
||||
};
|
||||
}
|
||||
9
glasshouse-laptop/sys/fonts.nix
Normal file
9
glasshouse-laptop/sys/fonts.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
fonts.packages = with pkgs; [
|
||||
times-newer-roman
|
||||
nerdfonts
|
||||
jetbrains-mono
|
||||
];
|
||||
}
|
||||
55
glasshouse-laptop/sys/hardware.nix
Normal file
55
glasshouse-laptop/sys/hardware.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, modulesPath, username, ... }:
|
||||
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "uas" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/a687e4e2-8665-43f1-9d62-3e3f21423579";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/6EAD-2C48";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
fileSystems."/home" =
|
||||
{ device = "/dev/nvme0n1p5";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/home/${username}/steamlib" =
|
||||
{ device = "/dev/nvme0n1p1";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp14s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp15s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware = {
|
||||
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
keyboard.uhk.enable = true;
|
||||
amdgpu.amdvlk.enable = true;
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
15
glasshouse-laptop/sys/network.nix
Normal file
15
glasshouse-laptop/sys/network.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
hostName = "glasshaus";
|
||||
hosts = {
|
||||
"192.168.1.163" = [ "glasshaus.info" ];
|
||||
};
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 30000 ];
|
||||
};
|
||||
};
|
||||
}
|
||||
72
glasshouse-laptop/sys/packages.nix
Normal file
72
glasshouse-laptop/sys/packages.nix
Normal file
@@ -0,0 +1,72 @@
|
||||
{ pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
alsa-lib
|
||||
alsa-utils
|
||||
bc
|
||||
cava
|
||||
clang
|
||||
clang-tools
|
||||
cmake
|
||||
fail2ban
|
||||
feh
|
||||
ffmpeg-full
|
||||
fuse
|
||||
fzf
|
||||
git
|
||||
gnumake
|
||||
gst_all_1.gstreamer
|
||||
htop
|
||||
hyprland
|
||||
hyprland-workspaces
|
||||
hyprpaper
|
||||
hyprpicker
|
||||
imagemagick
|
||||
inetutils
|
||||
kitty
|
||||
libclang
|
||||
libcxx
|
||||
lolcat
|
||||
lsof
|
||||
lua-language-server
|
||||
luarocks
|
||||
mesa
|
||||
mpd
|
||||
mullvad
|
||||
neofetch
|
||||
nix-index
|
||||
nix-prefetch-scripts
|
||||
nixos-option
|
||||
nix-search-cli
|
||||
openssl
|
||||
p7zip
|
||||
jq
|
||||
pamixer
|
||||
parted
|
||||
pass
|
||||
pavucontrol
|
||||
pkg-config
|
||||
playerctl
|
||||
protonmail-bridge
|
||||
protontricks
|
||||
pyright
|
||||
quintom-cursor-theme
|
||||
socat
|
||||
sox
|
||||
stress
|
||||
tor
|
||||
tree
|
||||
unrar
|
||||
unzip
|
||||
usbutils
|
||||
vim
|
||||
vscode-langservers-extracted
|
||||
vulkan-loader
|
||||
wget
|
||||
wine
|
||||
wl-clipboard
|
||||
xpad
|
||||
libnotify
|
||||
];
|
||||
}
|
||||
20
glasshouse-laptop/sys/programs.nix
Normal file
20
glasshouse-laptop/sys/programs.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
steam.enable = true;
|
||||
hyprland.enable = true;
|
||||
zsh.enable = true;
|
||||
nix-ld = {
|
||||
enable = true;
|
||||
libraries = with pkgs; [
|
||||
stdenv.cc.cc
|
||||
ffmpeg-full
|
||||
];
|
||||
};
|
||||
gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
18
glasshouse-laptop/sys/services.nix
Normal file
18
glasshouse-laptop/sys/services.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ pkgs, ...}:
|
||||
|
||||
{
|
||||
services = {
|
||||
pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
wireplumber.enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
};
|
||||
udev.enable = true;
|
||||
dbus.enable = true;
|
||||
mullvad-vpn.enable = true;
|
||||
blueman.enable = true;
|
||||
openssh.enable = true;
|
||||
};
|
||||
}
|
||||
34
glasshouse-laptop/sys/system.nix
Normal file
34
glasshouse-laptop/sys/system.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
system.stateVersion = "24.05";
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nix = {
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
substituters = [ "https://nix-gaming.cachix.org" ];
|
||||
};
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 7d";
|
||||
};
|
||||
};
|
||||
|
||||
environment = {
|
||||
variables = {
|
||||
XCURSOR_SIZE = "24";
|
||||
PATH = "${pkgs.clang-tools}/bin:$PATH";
|
||||
};
|
||||
shells = with pkgs; [
|
||||
zsh
|
||||
bash
|
||||
];
|
||||
};
|
||||
|
||||
time.timeZone = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
}
|
||||
|
||||
34
glasshouse-laptop/sys/users.nix
Normal file
34
glasshouse-laptop/sys/users.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{ config, inputs, pkgs, username, ... }:
|
||||
|
||||
{
|
||||
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
||||
home-manager = {
|
||||
useUserPackages = true;
|
||||
useGlobalPkgs = true;
|
||||
backupFileExtension = "backup";
|
||||
extraSpecialArgs = { inherit inputs username; };
|
||||
users.${username} = {
|
||||
programs.home-manager.enable = true;
|
||||
imports = [ ./../home ];
|
||||
home = {
|
||||
username = "${username}";
|
||||
homeDirectory = "/home/${username}";
|
||||
stateVersion = "24.05";
|
||||
pointerCursor = {
|
||||
name = "Quintom_Ink";
|
||||
size = 36;
|
||||
package = pkgs.quintom-cursor-theme;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [ "wheel" ];
|
||||
};
|
||||
security.sudo.extraConfig = ''
|
||||
${username} ALL=(ALL) NOPASSWD: /run/current-system/sw/bin/nixos-rebuild
|
||||
'';
|
||||
nix.settings.allowed-users = [ "${username}" ];
|
||||
}
|
||||
Reference in New Issue
Block a user