Skip to content

Instantly share code, notes, and snippets.

@oblique63
Last active March 26, 2020 04:44
Show Gist options
  • Save oblique63/6ce6e4a78bb096d2f881527d2c1ea8bd to your computer and use it in GitHub Desktop.
Save oblique63/6ce6e4a78bb096d2f881527d2c1ea8bd to your computer and use it in GitHub Desktop.
NixOS Configuration (Virtualbox)
# 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, ... }:
{
imports = [
<nixpkgs/nixos/modules/profiles/hardened.nix>
./hardware-configuration.nix
];
# VM-specific settings
services.vmwareGuest.enable = true;
boot.kernelModules = [ "fuse" ];
# GRUB configuration
boot.loader.grub = {
enable = true;
version = 2;
device = "/dev/sda";
};
# Fancy boot screen
boot.plymouth.enable = true;
boot.tmpOnTmpfs = true;
#hardware.cpu.intel.updateMicrocode = true;
#hardware.enableAllFirmware = true;
#powerManagement = {
# enable = true;
# powertop.enable = true;
#}
time.timeZone = "America/Los_Angeles";
networking = {
hostName = "richard_nixos";
#wicd.enable = true;
# Enable wireless support via wpa_supplicant:
#wireless.enable = true;
#dnsExtensionMechanism = false;
# Open ports in the firewall.
#firewall.allowedTCPPorts = [ ... ];
#firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
#firewall.enable = false;
};
# services.openssh.enable = true;
# services.printing.enable = true;
# Enable sound.
sound.enable = true;
sound.mediaKeys.enable = true;
hardware.pulseaudio.enable = true;
# Allow proprietary packages
nixpkgs.config = {
allowUnfree = true;
packageOverrrides = pkgs: {
unstable = import <nixos-unstable> {
# Pass the nixpkgs config to the unstable alias
# to ensure 'allowUnfree=true' is propagated:
config = config.nixpkgs.config;
};
};
};
environment.etc.current-nixos-config.source = ./.;
environment.variables = {
NIXOS_CONFIG = "/etc/nixos/configuration.nix";
NIXPKGS_ALLOW_UNFREE = "1";
};
environment.extraOutputsToInstall = [ "doc" "info" "devdoc" ];
environment.systemPackages = with pkgs; [
#abduco
#alacritty
#anki
aria2
aspell
aspellDicts.en
aspellDicts.en-computers
aspellDicts.en-science
beancount
#beets
bind
#bitlbee
#bitlbee-discord
buildtorrent
buku
cabal-install
cabal2nix
calcurse
#calibre
chez
chicken
#chromium
clac
#clojure
colordiff
#conkeror
conky
coq
#ctorrent
#cucumber
cvs
darcs
dhall
dhall-nix
diffstat
#discord
doas
dotfiles
dunst
#dvtm
ebook_tools
#egg2nix
elinks
#elmPackages.elm
emacs
emv
et
#expect
#extundelete
#fbreader
fdupes
feh
file
firefox
fontmatrix
fossil
fsharp
#fwupd
#getxbook
ghc
git
gopher
gprolog
graphviz
#haskellPackages.Agda
haskellPackages.apply-refact
#haskellPackages.brittany
#haskellPackages.ghc-mod
haskellPackages.hasktags
haskellPackages.hindent
haskellPackages.hlint
#haskellPackages.intero
haskellPackages.lentil
#haskellPackages.shentong
haskellPackages.stylish-haskell
hledger
homesick
htop
http-prompt
#httpie
#httplab
#hy
#i2p
i3cat
i3lock-color
i3lock-fancy
i3lock-pixeled
i3status-rust
idris
imv
#irssi
jdupes
#jimtcl
jq
julia
kbd
keepass
#kpcli
lesspipe
#lf
#lfe
#lighttable
linkchecker
links
loccount
lxappearance
lynx
massren
#megatools
minizinc
mksh
mktorrent
#mpv
ncdu
neofetch
#neomutt
neovim
newsboat
nim
nitrogen
nix-index
nix-repl
nix-prefetch-git
nox
#ocaml
#oil
#opam
open-vm-tools
#otter-browser
p7zip
pcalc
picolisp
pijul
pipes
psmisc
psutils
#pure
purescript
pv
qutebrowser
racket
ranger
rclone
rcm
#reason
#redshift
#rename
#renameutils
#riot-web
rlwrap
rmlint
rofi
#rstudio
#rtorrent
sbcl
sc-im
scrot
#sct
setroot
shmig
#slimerjs
sloccount
#speedread
#speedtest_cli
sqlite
sqlite3_analyzer
#sqlitebrowser
#sqliteman
stack
stack2nix
#stow
#sublime3
subversion
swiProlog
sxhkd
sxiv
#taskwarrior
tcl
tcllib
tcltls
tclx
tk
tlaplus
tldr
#tlp
tmate
#todo-txt-cli
tomb
topydo
tree
unzip
urlscan
urlview
urlwatch
vifm
vim
#vimb
#vivaldi
#vscode
#vym
w3m
#weechat
wget
wuzz
xcape
xkb_switch
xkbmon
#xscreensaver
xsel
xst
xxkb
yadm
zathura
zeal
#zed
];
programs = {
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
#mtr.enable = true;
#gnupg.agent = { enable = true; enableSSHSupport = true; };
bash.enableCompletion = true;
less.enable = true;
man.enable = true;
thefuck.enable = true;
tmux.enable = true;
vim.defaultEditor = true;
};
#services.hoogle.enable = true;
#services.ihaskell.enable = true;
#services.emacs.enable = true;
fonts = {
fonts = with pkgs; [
corefonts
emacs-all-the-icons-fonts
fira-code
fira-code-symbols
#font-droid
#google-fonts
league-of-moveable-type
nerdfonts
proggyfonts
roboto
#roboto-mono
roboto-slab
vistafonts
];
enableDefaultFonts = true;
enableFontDir = true;
fontconfig.ultimate = {
enable = true;
substitutions = "combi";
#useEmbeddedBitmaps = true;
};
fontconfig.defaultFonts = {
monospace = [ "Hack" ];
sansSerif = [ "Roboto" ];
serif = [ "Roboto Slab" ];
};
};
services.xserver = {
# Enable the X11 windowing system.
enable = true;
exportConfiguration = true;
layout = "us";
# Caps Lock -> Ctrl:
xkbOptions = "caps:ctrl_modifier";
# Enable touchpad support:
#libinput.enable = true;
# Set the login manager:
#displayManager.sddm.enable = true;
# Set the Desktop Environment:
windowManager.i3.enable = true;
# Enable plasma:
#desktopManager.plasma5.enable = true;
};
# Configure the console from the xserver keyboard settings:
i18n.consoleUseXkbConfig = true;
users.defaultUserShell = pkgs.mksh;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.oblique = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
nix = {
autoOptimiseStore = true;
buildCores = 4;
# Already set in hardware-configuration.nix:
#maxJobs = 4;
# Incompatible with hardened profile:
#useSandbox = true;
};
# 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 = "18.09"; # Did you read the comment?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment