inital
This commit is contained in:
183
modules/system.nix
Normal file
183
modules/system.nix
Normal file
@@ -0,0 +1,183 @@
|
||||
# ./modules/system.nix
|
||||
# Define and configure high-level system settings.
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config = {
|
||||
# Configure the boot settings
|
||||
boot = {
|
||||
|
||||
# Configure the boot loader
|
||||
loader = {
|
||||
grub.enable = true;
|
||||
grub.device = "/dev/nvme0n1";
|
||||
grub.useOSProber = true;
|
||||
};
|
||||
|
||||
# Configure Plymouth
|
||||
plymouth = {
|
||||
enable = true;
|
||||
themePackages = with pkgs; [
|
||||
nixos-bgrt-plymouth
|
||||
];
|
||||
theme = "nixos-bgrt";
|
||||
};
|
||||
|
||||
# Enable 'Silent Boot'
|
||||
consoleLogLevel = 0;
|
||||
initrd.verbose = false;
|
||||
kernelParams = [
|
||||
"quiet"
|
||||
"splash"
|
||||
"boot.shell_on_fail"
|
||||
"loglevel=3"
|
||||
"rd.systemd.show_status=false"
|
||||
"rd.udev.log_level=3"
|
||||
"udev.log_priority=3"
|
||||
];
|
||||
};
|
||||
|
||||
# Configure Nix Garbage Collecter:
|
||||
# Run weekly and delete all but the three most recent generations.
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than +3";
|
||||
};
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Configure services
|
||||
services = {
|
||||
# Configure keymap in X11
|
||||
xserver.xkb = {
|
||||
layout = "us";
|
||||
variant = "";
|
||||
};
|
||||
|
||||
# Enable CUPS for printing
|
||||
printing.enable = true;
|
||||
|
||||
# Enable sound via Pipewire
|
||||
pulseaudio.enable = false;
|
||||
pipewire = {
|
||||
enable = true;
|
||||
alsa = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
};
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
# Enable GVFS
|
||||
gvfs.enable = true;
|
||||
};
|
||||
|
||||
# Enable hyprland and ly
|
||||
services.displayManager.ly.enable = true;
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
};
|
||||
programs.hyprlock.enable = true;
|
||||
|
||||
# Configure security settings
|
||||
security = {
|
||||
rtkit.enable = true;
|
||||
polkit.enable = true;
|
||||
pam.services.hyprlock = {};
|
||||
};
|
||||
|
||||
# Set host name.
|
||||
networking.hostName = "d5640-nixos";
|
||||
|
||||
# Set time zone.
|
||||
time.timeZone = "America/Chicago";
|
||||
|
||||
# Set 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";
|
||||
};
|
||||
|
||||
# Define environment variables and shell aliases.
|
||||
environment = {
|
||||
variables = {
|
||||
EDITOR = "hx";
|
||||
SYSTEMD_EDITOR = "hx";
|
||||
};
|
||||
|
||||
shellAliases = {
|
||||
using = "nix-shell --run fish -p";
|
||||
ccd = "clear; cd";
|
||||
reboot = "shutdown -r";
|
||||
};
|
||||
};
|
||||
|
||||
# Configure hardware settings
|
||||
hardware = {
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
settings = {
|
||||
General = {
|
||||
# Show battery charge of connected devices when able
|
||||
Experimental = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Declare packages installed in system profile
|
||||
environment.systemPackages = with pkgs; [
|
||||
bat
|
||||
direnv
|
||||
dunst
|
||||
helix
|
||||
htop
|
||||
hypridle
|
||||
hyprlock
|
||||
hyprpaper
|
||||
hyprpicker
|
||||
hyprshot
|
||||
imv
|
||||
killall
|
||||
micro
|
||||
nautilus
|
||||
neofetch
|
||||
nnn
|
||||
p7zip
|
||||
parted
|
||||
pciutils
|
||||
ripgrep
|
||||
rofi-bluetooth
|
||||
rofi-calc
|
||||
rofi-network-manager
|
||||
rofi-power-menu
|
||||
rofi-wayland
|
||||
tree
|
||||
unzip
|
||||
usbutils
|
||||
vlc
|
||||
waybar
|
||||
|
||||
# Import scripts from ../bin
|
||||
(writeScriptBin "svelte-ina-box" ''
|
||||
${builtins.readFile ../bin/svelte-ina-box}
|
||||
'')
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user