{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
./unstable.nix
# ./mount-partitions.nix
];
# Kernel
#boot.kernelModules = [ "kvm-amd" "amd_iommu=on" ];
#boot.extraModprobeConfig = "options kvm_amd nested=1";
# Microcode
hardware.cpu.amd.updateMicrocode = true;
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# System Hostname
networking.hostName = "nix-os";
# Set your time zone.
time.timeZone = "Asia/Dhaka";
# 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";
# };
# Define a user account.
users.users.random = {
isNormalUser = true;
extraGroups = [ "wheel" "video" "input" "audio" "storage" ];
};
# Allow Unfree Packages.
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile.
environment.systemPackages = with pkgs; [
# Packages for neovim / astrovim
pkgs.lazygit
pkgs.git
pkgs.bottom
pkgs.ripgrep
pkgs.gdu
pkgs.python3
pkgs.nodejs
pkgs.gnumake
pkgs.gcc
pkgs.cinnamon.nemo
pkgs.cinnamon.nemo-fileroller
pkgs.w3m
pkgs.xdg-user-dirs
pkgs.wpaperd
pkgs.kitty
pkgs.rofi
# pkgs.pavucontrol
pkgs.btop
pkgs.mako
pkgs.libnotify
pkgs.wl-clipboard
pkgs.wlroots
pkgs.slurp
pkgs.hyprpicker
pkgs.swaylock-effects
pkgs.mpv
pkgs.ffmpeg
pkgs.grim
pkgs.discord
pkgs.trashy
pkgs.viewnior
pkgs.lsd
pkgs.unzip
pkgs.ventoy
pkgs.motrix
pkgs.betterdiscordctl
pkgs.bashmount
pkgs.obs-studio
# pkgs.linux-wifi-hotspot
pkgs.distrobox
pkgs.gparted
pkgs.polkit_gnome
# Docker packages
pkgs.docker-compose
];
# Fonts for NIX-OS.
fonts.fonts = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
];
# Display Manager.
services.xserver.enable = true;
services.xserver.displayManager.gdm = {
enable = true;
};
# AutoLogin.
services.xserver.displayManager = {
autoLogin.enable = true;
autoLogin.user = "random";
};
# Zram.
zramSwap.enable = true;
zramSwap.algorithm = "zstd";
# Hyprland.
programs = {
waybar.enable = true;
hyprland = {
enable = true;
xwayland.enable = true;
};
};
# XDG Portal.
xdg = {
portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-hyprland
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
];
};
};
# Swaylock
security.pam.services.swaylock.text = ''
auth include login
'';
# Dconf
programs.dconf.enable = true;
# Dbus
services.dbus.enable = true;
# services Accounts
services.accounts-daemon.enable = true;
# Gnome Polkit
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
# Enable sound with pipewire.
services.pipewire = {
enable = true;
pulse.enable = true;
# wireplumber.enable = true;
};
# Neovim.
programs.neovim = {
enable = true;
defaultEditor = true;
};
# ZSH with oh-my-zsh
users.users.random = {
shell = pkgs.zsh;
};
programs.zsh = {
enable = true;
ohMyZsh.enable = true;
ohMyZsh.theme = "random";
# Zsh Config.
histSize = 10000;
histFile = "$HOME/.zsh_history";
# Plugins
syntaxHighlighting.enable = true;
autosuggestions.strategy = ["history" "completion" "match_prev_cmd"];
autosuggestions.highlightStyle = "fg=cyan";
syntaxHighlighting.highlighters = ["main" "brackets" "pattern" "cursor" "regexp" "root" "line"];
autosuggestions.enable = true;
# Build in oh-my-zsh plugins
ohMyZsh.plugins = ["sudo" ];
# Alias
shellAliases = {
# LSD
ls = "lsd";
ll = "lsd -l";
# Useful Nix OS commands
edit = "sudo -E nvim /etc/nixos/configuration.nix";
edit-unstable = "sudo -E nvim /etc/nixos/unstable.nix";
update = "sudo nix-channel --update && sudo nixos-rebuild switch && home-manager switch";
# Trashy
trash = "trash";
list = "trash list";
restore = "trash restore";
restore-all = "trash restore --all";
remove-all = "trash empty --all";
# BashMount
bm = "bashmount";
};
};
# Vmware
virtualisation.vmware.host = {
enable = true;
};
# Docker
users.extraGroups.docker.members = [ "random" ];
virtualisation.docker = {
enable = true;
};
# Mullvad-VPN.
services.mullvad-vpn = {
enable = true;
package = pkgs.mullvad-vpn;
};
# TeamViewer
services.teamviewer.enable = true;
# Firewall.
networking.firewall.enable = true;
# Network configuration with NEXTDNS/DNS
networking.networkmanager.enable = true;
services.resolved.enable = true;
networking.networkmanager.dns = "systemd-resolved";
networking.firewall.checkReversePath = "loose";
services.resolved.extraConfig = ''
DNSOverTLS=yes
'';
# Trim For SSD, fstrim.
services.fstrim = {
enable = true;
interval = "weekly";
};
# Fwupd # Firmware updater
services.fwupd = {
enable = true;
};
# Cpu Optimization.
services.auto-cpufreq.enable = true;
# security
services.gnome.gnome-keyring.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# Auto system update.
system.autoUpgrade = {
enable = true;
dates = "weekly";
operation = "switch";
};
# Optimize NIX Store.
# nix.optimise = {
# automatic = true;
# };
# Automatic Garbage Collection.
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
# NixOS system details.
system.stateVersion = "23.05";
}
EDIT - iâve deleted dns part because i was using nextdns, canât sent you that IDs.