Skip to content

Instantly share code, notes, and snippets.

@gnull
Created July 24, 2025 11:19
Show Gist options
  • Save gnull/a126b6c142240802b13bea085f2a9d05 to your computer and use it in GitHub Desktop.
Save gnull/a126b6c142240802b13bea085f2a9d05 to your computer and use it in GitHub Desktop.
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, unstablePkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = false;
boot.loader.efi.canTouchEfiVariables = true;
# boot.loader.grub.useOSProber = true;
boot.loader.grub.enable = true;
boot.loader.grub.efiSupport = true;
boot.loader.grub.device = "nodev";
fileSystems."/efi" =
{ device = "/dev/disk/by-uuid/CFC0-35A3";
fsType = "vfat";
};
# fileSystems."/boot" =
# { device = "/dev/disk/by-uuid/12CE-A600";
# fsType = "vfat";
# };
boot.loader.efi.efiSysMountPoint = "/efi";
# boot.loader.systemd-boot.xbootldrMountPoint = "/boot";
# boot.loader.grub.extraEntries = ''
# menuentry "Arch" {
# search --set=arch --fs-uuid 1a180e02-f51d-4af0-9873-23e41fe3d556
# configfile "($ubuntu)/boot/grub/grub.cfg"
# }
# '';
boot.tmp.cleanOnBoot = true;
nixpkgs.config = {
allowUnfree = true;
};
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
extra-platforms = [ "aarch64-linux" ];
};
networking.hostName = "ioleynikov"; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
time.timeZone = "Asia/Almaty";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
i18n = {
defaultLocale = "en_GB.UTF-8";
# extraLocales = [ "ru_RU.UTF-8/UTF-8" ];
supportedLocales = [ "en_US.UTF-8/UTF-8" "en_GB.UTF-8/UTF-8" "ru_RU.UTF-8/UTF-8" ];
# extraLocaleSettings = {
# LC_TIME = "en_GB.UTF-8";
# LC_MEASUREMENT="metric";
# };
};
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
# Enable the X11 windowing system.
# services.xserver.enable = true;
# https://git.sr.ht/~jman/dotfiles/tree/refs/heads/master/xkb/README.md
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
services.gnome.gnome-keyring.enable = true;
security.polkit.enable = true;
services.greetd = {
enable = true;
settings = {
default_session = {
command =
let sway_cfg = pkgs.writeText "sway.cfg" ''
output eDP-1 scale 1.4
exec "${unstablePkgs.greetd.qtgreet}/bin/qtgreet; ${pkgs.sway}/bin/swaymsg exit"
bindsym Mod4+shift+e exec swaynag \
-t warning \
-m 'What do you want to do?' \
-b 'Poweroff' 'systemctl poweroff' \
-b 'Reboot' 'systemctl reboot'
include /etc/sway/config.d/*
'';
in "${pkgs.dbus}/bin/dbus-run-session ${pkgs.sway}/bin/sway --config ${sway_cfg}";
user = "greeter";
};
};
};
hardware.graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
intel-media-driver
intel-ocl
intel-vaapi-driver
intel-compute-runtime
];
};
fonts = {
enableDefaultPackages = true;
packages = with pkgs; [
ubuntu_font_family
liberation_ttf
# Persian Font
vazir-fonts
fira-mono
noto-fonts-color-emoji
];
fontconfig = {
useEmbeddedBitmaps = true;
defaultFonts = {
serif = [ "Liberation Serif" "Vazirmatn" ];
sansSerif = [ "Ubuntu" "Vazirmatn" ];
monospace = [ "Fira Mono" ];
emoji = [ "Noto Color Emoji" ];
};
};
};
# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
# hardware.pulseaudio.enable = true;
# OR
services.pipewire = {
enable = true;
pulse.enable = true;
};
virtualisation = {
docker.enable = true;
virtualbox.host.enable = true;
};
services.ollama = {
enable = true;
user = "ollama";
home = "/home/ollama";
};
systemd.services.ollama.serviceConfig.ProtectHome = lib.mkForce false;
# Enable touchpad support (enabled default in most desktopManager).
# services.libinput.enable = true;
security.sudo.wheelNeedsPassword = false;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users = {
io = {
isNormalUser = true;
uid=1000;
extraGroups = [ "docker" "vboxusers" "wheel" "dialout" "disk" ]; # Enable ‘sudo’ for the user.
packages = with pkgs; [
tree
kakoune
fish
];
};
};
programs.firefox.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
vim
wget
qt5.qtwayland # For wayland
git
kakoune
any-nix-shell
alacritty
# gvfs
# gnome.gvfs
];
# This is for packages like Nemo to see USB sticks
services.gvfs.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;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
# to actually do that.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "25.05"; # Did you read the comment?
}
{
description = "A simple NixOS flake";
inputs = {
unstable.url = "nixpkgs/nixos-unstable";
nixpkgs.url = "nixpkgs/nixos-25.05";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
url = "github:nix-community/home-manager/release-25.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, unstable, nixos-hardware, home-manager, ... }@inputs:
let
system = "x86_64-linux";
in
{
nixosConfigurations.think = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit unstable;
unstablePkgs = import unstable {
inherit system;
config.allowUnfree = true;
};
};
modules = [
./configuration.nix
./hardware-configuration.nix
nixos-hardware.nixosModules.lenovo-thinkpad-x270
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.gamer = ./gamer.nix;
}
];
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment