Skip to content

Instantly share code, notes, and snippets.

@sashapop10
Created December 11, 2023 16:36
Show Gist options
  • Save sashapop10/91e4090e76f721e1d09c136900f6ecd5 to your computer and use it in GitHub Desktop.
Save sashapop10/91e4090e76f721e1d09c136900f6ecd5 to your computer and use it in GitHub Desktop.
My nixos configuration
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Bootloader.
boot = {
#kernelPackages = pkgs.linuxPackages_latest;
#initrd.kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ];
#systemd-boot.enable = false;
loader = {
#systemd-boot.enable = true;
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi";
};
grub = {
devices = [ "nodev" ];
enable = true;
#efiInstallAsRemovable = true;
configurationLimit = 5;
efiSupport = true;
#version = 2;
useOSProber = true;
};
};
};
time.hardwareClockInLocalTime = true;
networking.hostName = "nixos"; # Define your hostname.
networking.networkmanager.enable = true;
time.timeZone = "Europe/Moscow";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "ru_RU.UTF-8";
LC_IDENTIFICATION = "ru_RU.UTF-8";
LC_MEASUREMENT = "ru_RU.UTF-8";
LC_MONETARY = "ru_RU.UTF-8";
LC_NAME = "ru_RU.UTF-8";
LC_NUMERIC = "ru_RU.UTF-8";
LC_PAPER = "ru_RU.UTF-8";
LC_TELEPHONE = "ru_RU.UTF-8";
LC_TIME = "ru_RU.UTF-8";
};
services.xserver.enable = true;
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"nvidia-x11"
"nvidia-settings"
];
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
modesetting.enable = true;
open = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
# Enable the KDE Plasma Desktop Environment.
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
# Configure keymap in X11
services.xserver = {
layout = "ru";
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;
};
users.defaultUserShell = pkgs.zsh;
users.users.sashapop10 = {
isNormalUser = true;
description = "sashapop10";
extraGroups = [ "docker" "networkmanager" "wheel" ];
packages = with pkgs; [
firefox
kate
# thunderbird
];
};
# Fonts
fonts.fonts = with pkgs; [
noto-fonts
noto-fonts-cjk
roboto
noto-fonts-emoji
liberation_ttf
fira-code
fira-code-symbols
mplus-outline-fonts.githubRelease
dina-font
proggyfonts
];
# Enable automatic login for the user.
services.xserver.displayManager.autoLogin.enable = true;
services.xserver.displayManager.autoLogin.user = "sashapop10";
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
environment.systemPackages = with pkgs; [
wget
vscode
btop
flameshot
brave
discord
anydesk
tmux
gimp
gparted
gcc
bash
git
nodejs
fzf
tldr
yarn
lightly-qt
bat
unzip
telegram-desktop
unrar
python3
postman
libreoffice-qt
hunspell
hunspellDicts.ru_RU
gnumake
neofetch
ntfs3g
cargo
rustup
chromium
rustc
rustfmt
act
asciiquarium
mkcert
bun
pgadmin
dbeaver
zoom-us
pkgs.nodePackages.npm-check-updates
];
services.postgresql = {
enable = true;
ensureDatabases = [ "mydatabase" ];
authentication = pkgs.lib.mkOverride 10 ''
#type database DBuser auth-method
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
'';
};
programs.zsh = {
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
enable = true;
ohMyZsh = {
enable = true;
plugins = [ "git" "node" "vscode" "postgres" "docker" "kubectl" ];
theme = "robbyrussell";
};
};
# services.openssh.enable = true;
system.stateVersion = "23.05";
system.autoUpgrade.enable = true;
system.autoUpgrade.allowReboot = true;
# custom
hardware.bluetooth.enable = true;
virtualisation.docker.enable = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment