2024-03-06 14:17:11 +00:00
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘ nixos-help’ ).
{ config , pkgs , lib , . . . }:
let
sshConfigPath = ./ssh-config.nix ;
in
{
imports =
2024-03-10 10:29:35 +00:00
[
# Include the results of the hardware scan.
2024-03-06 14:17:11 +00:00
./hardware-configuration.nix
] ++ lib . optional ( builtins . pathExists sshConfigPath ) sshConfigPath ;
# Bootloader.
boot . loader . grub . enable = true ;
boot . loader . grub . device = " / d e v / n v m e 0 n 1 " ;
boot . loader . grub . useOSProber = true ;
networking . hostName = " s p y 4 x - p c " ;
networking . networkmanager . enable = true ;
2024-03-10 10:29:35 +00:00
networking = {
firewall = {
enable = true ;
allowedTCPPorts = [
80 # Web server to debug apps from mobile
53317 # LocalSend
] ;
} ;
} ;
2024-03-06 14:17:11 +00:00
# Allow install "unfree" apps, like Google Chrome or WebStorm
nixpkgs . config . allowUnfree = true ;
time . timeZone = " A s i a / S i n g a p o r e " ;
i18n . defaultLocale = " e n _ S G . U T F - 8 " ;
i18n . extraLocaleSettings = {
LC_ADDRESS = " e n _ S G . U T F - 8 " ;
LC_IDENTIFICATION = " e n _ S G . U T F - 8 " ;
LC_MEASUREMENT = " e n _ S G . U T F - 8 " ;
LC_MONETARY = " e n _ S G . U T F - 8 " ;
LC_NAME = " e n _ S G . U T F - 8 " ;
LC_NUMERIC = " e n _ S G . U T F - 8 " ;
LC_PAPER = " e n _ S G . U T F - 8 " ;
LC_TELEPHONE = " e n _ S G . U T F - 8 " ;
LC_TIME = " e n _ S G . U T F - 8 " ;
} ;
# Enable the X11 windowing system.
services . xserver . enable = true ;
# Enable the GNOME Desktop Environment.
services . xserver . displayManager . gdm . enable = true ;
services . xserver . desktopManager . gnome . enable = true ;
# Configure keymap in X11
services . xserver = {
layout = " u s " ;
xkbVariant = " " ;
} ;
# Activate and configure Docker
virtualisation . docker . enable = true ;
virtualisation . docker . autoPrune . enable = true ;
# virtualisation.docker.enableNvidia = true; # experiment for Roley?
# 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 ;
} ;
# Define a user account. Don't forget to set a password with ‘ passwd’ .
users . users . spy4x = {
isNormalUser = true ;
description = " A n t o n S h u b i n " ;
extraGroups = [
" n e t w o r k m a n a g e r "
" w h e e l "
" b l u e t o o t h "
" d o c k e r "
] ;
packages = with pkgs ; [
# Shell tools
git
2024-03-10 10:29:35 +00:00
gnumake # Source for "make" command
htop # System monitor viewer
2024-03-06 14:17:11 +00:00
unzip
2024-03-10 10:29:35 +00:00
killall # Kill processes by name instead of PID
ncdu # Disk space usage stats, per folder, nested
libwebp # Convert images into .webp format
wl-clipboard # Wayland's clipboard copy/paste cli tools
2024-03-06 14:17:11 +00:00
tree
2024-03-10 10:29:35 +00:00
nixpkgs-fmt # Formatter for .nix files. Like Prettier.
2024-03-06 14:17:11 +00:00
# Work
nodejs_21
nodePackages . pnpm
2024-03-10 10:29:35 +00:00
vscode-fhs # Wrapped variant of vscode which launches in a FHS compatible environment. Should allow for easy usage of extensions without nix-specific modifications.
2024-03-06 14:17:11 +00:00
jetbrains . webstorm
upwork
slack
2024-03-10 10:29:35 +00:00
ffmpeg # for Roley project
2024-03-06 14:17:11 +00:00
awscli
# Other
google-chrome
2024-03-10 10:29:35 +00:00
bitwarden # Password manager client
2024-03-06 14:17:11 +00:00
vlc
2024-03-10 10:29:35 +00:00
obs-studio # Video recorder and stream software
solaar # Logitech devices GUI. Strictly use with sudo, otherwise it doesn't see devices.
localsend # Share files/text/data with other devices in local network without internet. OSS alternative to AirDrop.
2024-03-06 14:17:11 +00:00
] ;
} ;
programs . steam . enable = true ; # Install Steam for games management
# Shell aliases and other init
environment . interactiveShellInit = ''
alias copy = ' wl-copy < '
alias build = ' sudo nixos-rebuild switch'
2024-03-10 12:30:36 +00:00
alias rs = ' rsync - avhzru - P'
alias rsh = ' rsync - avhzru - P - e ssh'
2024-03-06 14:17:11 +00:00
'' ;
# Enable automatic login for the user.
services . xserver . displayManager . autoLogin . enable = true ;
services . xserver . displayManager . autoLogin . user = " s p y 4 x " ;
# Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
systemd . services . " g e t t y @ t t y 1 " . enable = false ;
systemd . services . " a u t o v t @ t t y 1 " . enable = false ;
system . stateVersion = " 2 3 . 1 1 " ;
2024-03-10 10:29:35 +00:00
}