2020-08-19 18:35:23 +00:00
# My NixOS config...
# This is where the specific setup go from setting environment variables, specific aliases, installing specific packages (e.g., muh games), and so forth.
2020-08-16 08:33:44 +00:00
{ config , pkgs , lib , . . . }:
{
2020-10-20 15:56:10 +00:00
nixpkgs . config . permittedInsecurePackages = [
" s p i d e r m o n k e y - 3 8 . 8 . 0 "
] ;
# Set the Nix package manager to use the unstable version for flakes.
nix = {
package = pkgs . nixUnstable ;
extraOptions = ''
experimental-features = nix-command flakes
'' ;
} ;
2020-08-16 08:33:44 +00:00
# Use the systemd-boot EFI boot loader.
boot . loader . systemd-boot . enable = true ;
boot . loader . efi . canTouchEfiVariables = true ;
2020-10-06 22:56:04 +00:00
# Change the Linux kernel version.
boot . kernelPackages = pkgs . linuxPackages_5_8 ;
boot . extraModulePackages = [ pkgs . linuxPackages_5_8 . nvidia_x11 ] ;
2020-09-07 10:36:02 +00:00
# Clean up the /tmp directory.
boot . cleanTmpDir = true ;
2020-08-16 08:33:44 +00:00
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking . useDHCP = false ;
networking . interfaces . enp4s0 . useDHCP = true ;
# Enable XDG conventions.
my . home . xdg . enable = true ;
environment . variables = {
XDG_CONFIG_HOME = " $ H O M E / . c o n f i g " ;
XDG_CACHE_HOME = " $ H O M E / . c a c h e " ;
XDG_DATA_HOME = " $ H O M E / . l o c a l / s h a r e " ;
XDG_BIN_HOME = " $ H O M E / . l o c a l / b i n " ;
} ;
2020-08-24 15:56:31 +00:00
# Moving all of the host-specific configurations into its appropriate place.
my . home . xdg . dataFile =
let insertXDGDataFolder = name : {
source = ./config + " / ${ name } " ;
recursive = true ;
} ; in {
" r e c o l l " = insertXDGDataFolder " r e c o l l " ;
" u n i s o n " = insertXDGDataFolder " u n i s o n " ;
} ;
2020-08-16 08:33:44 +00:00
# Install documentations for tools and whatnot.
documentation = {
enable = true ;
dev . enable = true ;
man . enable = true ;
} ;
# Enable virutialization.
virtualisation = {
docker = {
enable = true ;
} ;
libvirtd = {
enable = true ;
} ;
} ;
2020-10-06 22:56:04 +00:00
# Enable some font configs.
fonts = {
enableDefaultFonts = true ;
fontconfig . enable = true ;
} ;
2020-08-16 08:33:44 +00:00
# Module configurations.
modules = {
desktop = {
2020-10-06 22:56:04 +00:00
audio = {
enable = true ;
composition . enable = true ;
production . enable = true ;
} ;
2020-08-16 08:33:44 +00:00
browsers = {
brave . enable = true ;
firefox . enable = true ;
2020-10-06 22:56:04 +00:00
nyxt . enable = true ;
2020-08-16 08:33:44 +00:00
} ;
2020-09-01 15:10:44 +00:00
cad . enable = true ;
2020-08-16 08:33:44 +00:00
fonts . enable = true ;
files . enable = true ;
graphics = {
raster . enable = true ;
vector . enable = true ;
_3d . enable = true ;
} ;
multimedia . enable = true ;
2020-09-01 15:10:44 +00:00
research . enable = true ;
2020-08-16 08:33:44 +00:00
} ;
dev = {
android . enable = true ;
base . enable = true ;
2020-09-07 10:36:02 +00:00
cc . enable = true ;
data . enable = true ;
2020-08-16 08:33:44 +00:00
documentation = {
enable = true ;
latex . enable = true ;
} ;
2020-08-19 18:35:23 +00:00
game-dev = {
2020-08-18 16:48:02 +00:00
godot . enable = true ;
unity3d . enable = true ;
} ;
2020-10-06 22:56:04 +00:00
go . enable = true ;
2020-08-16 08:33:44 +00:00
java . enable = true ;
javascript = {
deno . enable = true ;
node . enable = true ;
} ;
lisp = {
guile . enable = true ;
racket . enable = true ;
} ;
2020-10-06 22:56:04 +00:00
perl . enable = true ;
python = {
enable = true ;
math . enable = true ;
} ;
2020-08-16 08:33:44 +00:00
rust . enable = true ;
2020-09-05 20:50:16 +00:00
vcs . enable = true ;
2020-08-16 08:33:44 +00:00
} ;
2020-10-06 22:56:04 +00:00
drivers = {
veikk . enable = true ;
} ;
2020-08-16 08:33:44 +00:00
editors = {
default = " n v i m " ;
emacs . enable = true ;
neovim . enable = true ;
2020-08-30 21:58:22 +00:00
vscode . enable = true ;
2020-08-16 08:33:44 +00:00
} ;
services = {
recoll . enable = true ;
} ;
shell = {
base . enable = true ;
lf . enable = true ;
zsh . enable = true ;
} ;
themes . fair-and-square . enable = true ;
} ;
# Additional programs that doesn't need much configuration (or at least personally configured).
# It is pointless to create modules for it, anyways.
environment . systemPackages = with pkgs ; [
nim # Jack the nimble, jack jumped over the nightstick, and got over not being the best pick.
python # *insert Monty Python quote here*
2020-08-18 16:48:02 +00:00
] ;
2020-08-16 08:33:44 +00:00
2020-08-18 16:48:02 +00:00
my . packages = with pkgs ; [
2020-08-16 08:33:44 +00:00
# Muh games.
2020-10-06 22:56:04 +00:00
dwarf-fortress # Losing is fun!
endless-sky # Losing is meh!
minetest # Losing?! What's that?
openmw # Losing is even more meh1
wesnoth # Losing is frustrating!
zeroad # Losing is fun and frustrating!
2020-08-19 18:35:23 +00:00
# Installing some of the dependencies required for my scripts.
ffcast
giflib
leptonica
libpng
libwebp
maim
( tesseract . override { enableLanguages = [ " e n g " ] ; } )
slop
2020-09-05 20:50:16 +00:00
virt-manager
2020-08-30 15:27:12 +00:00
xclip
2020-08-19 18:35:23 +00:00
xdg-user-dirs
2020-09-01 15:10:44 +00:00
xorg . xwininfo
2020-08-19 18:35:23 +00:00
zbar
2020-09-05 20:50:16 +00:00
2020-10-06 22:56:04 +00:00
# Some other packages.
screenkey
]
# My custom packages.
++ ( with pkgs . nur . foo-dogsquared ; [
segno
] ) ;
2020-08-16 08:33:44 +00:00
2020-08-19 18:35:23 +00:00
# Setting up the shell environment.
2020-08-16 08:33:44 +00:00
my . env = {
BROWSER = " f i r e f o x " ;
FILE = " l f " ;
READ = " z a t h u r a " ;
SUDO_ASKPASS = <config/bin/askpass> ;
} ;
2020-09-05 20:50:16 +00:00
# foo-dogsquared is my only alias.
my . alias = {
# Convenience alias for my NixOS config.
dots = " U S E R = ${ config . my . username } m a k e - C / e t c / d o t f i l e s " ;
# Assume you've installed Doom Emacs.
org-capture = " $ X D G _ C O N F I G _ H O M E / e m a c s / b i n / o r g - c a p t u r e " ;
} ;
2020-08-16 08:33:44 +00:00
# Set your time zone.
time . timeZone = " A s i a / M a n i l a " ;
services . openssh . enable = true ;
services . lorri . enable = true ;
2020-08-18 16:48:02 +00:00
# Setup GnuPG.
2020-08-16 08:33:44 +00:00
programs . gnupg . agent = {
enable = true ;
enableSSHSupport = true ;
pinentryFlavor = " g n o m e 3 " ;
} ;
2020-08-18 16:48:02 +00:00
# Install a proprietary Nvidia graphics driver.
2020-08-30 15:27:12 +00:00
services . xserver = {
libinput = {
2020-10-06 22:56:04 +00:00
enable = true ;
2020-08-30 15:27:12 +00:00
middleEmulation = true ;
} ;
2020-10-06 22:56:04 +00:00
# digimend.enable = true;
# videoDrivers = [ "nvidiaLegacy390" ];
2020-08-30 15:27:12 +00:00
} ;
2020-08-18 16:48:02 +00:00
2020-08-16 08:33:44 +00:00
# Enable sound.
sound . enable = true ;
hardware . pulseaudio . enable = true ;
2020-10-06 22:56:04 +00:00
# Enable OpenGL.
hardware = {
opengl . enable = true ;
} ;
2020-08-18 16:48:02 +00:00
# Additional host-specific program configurations.
2020-08-24 15:56:31 +00:00
my . home = {
programs = {
# My personal Git config.
git = {
enable = true ;
2020-08-16 08:33:44 +00:00
2020-08-24 15:56:31 +00:00
# Enable Large File Storage.
lfs . enable = true ;
2020-08-16 08:33:44 +00:00
2020-08-24 15:56:31 +00:00
# Use the entire suite.
package = pkgs . gitAndTools . gitFull ;
2020-08-16 08:33:44 +00:00
2020-08-24 15:56:31 +00:00
userName = " G a b r i e l A r a z a s " ;
userEmail = " ${ config . my . email } " ;
} ;
2020-08-16 08:33:44 +00:00
} ;
2020-10-06 22:56:04 +00:00
services = {
unison = let
homeDirectory = " / h o m e / ${ config . my . username } " ;
backupDrive = " / r u n / m e d i a / ${ config . my . username } / S e a g a t e B a c k u p P l u s D r i v e " ;
in {
enable = true ;
pairs . mainBackup = {
roots = [ homeDirectory backupDrive ] ;
commandOptions = {
auto = " t r u e " ;
batch = " t r u e " ;
fat = " t r u e " ;
force = " ${ homeDirectory } " ;
links = " f a l s e " ;
ui = " t e x t " ;
} ;
} ;
} ;
} ;
2020-08-16 08:33:44 +00:00
} ;
2020-09-05 20:50:16 +00:00
my . user . extraGroups = [ " d o c k e r " ] ;
2020-10-06 22:56:04 +00:00
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system . stateVersion = " 2 0 . 0 3 " ; # Did you read the comment?
2020-08-16 08:33:44 +00:00
}