{ config, pkgs, ... }:
let
pkgsUnstable = import (fetchTarball
"https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz")
{ };
localConfiguration = pkgs.callPackage /etc/nixos/local-configuration.nix { };
in {
imports = [ # Include the results of the hardware scan.
/etc/nixos/hardware-configuration.nix
];
# Use the systemd-boot EFI boot loader.
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
initrd = {
luks.devices = [{
name = "root";
device = localConfiguration.luksDevice;
preLVM = true;
}];
};
};
hardware = {
bluetooth.enable = true;
pulseaudio = {
package = pkgs.pulseaudioFull;
enable = true;
};
};
networking.hostName = localConfiguration.hostName;
networking.networkmanager.enable = true;
# Auto-upgrade channel
# https://nixos.org/nixos/manual/index.html#idm140737316795120
system.autoUpgrade.enable = true;
nix.gc = {
automatic = false;
dates = "03:15"; # change to hour?
};
# Select internationalisation properties.
i18n = {
consoleFont = "Lat2-Terminus16";
consoleKeyMap = "br-abnt2";
defaultLocale = "en_US.UTF-8";
};
# Set your time zone.
time.timeZone = "America/Sao_Paulo";
virtualisation.docker.enable = true;
virtualisation.virtualbox.host.enable = true;
fonts.fonts = with pkgs; [
source-code-pro
fira-code
fira-mono
fira-code-symbols
freefont_ttf
];
environment.systemPackages = let
timidityWithEvenMoreFormats = pkgs.timidity.overrideAttrs (oldAttrs: {
configureFlags = oldAttrs.configureFlags
++ [ "--enable-audio=vorbis,flac" ];
buildInputs = oldAttrs.buildInputs
++ [ pkgs.libogg pkgs.libvorbis pkgs.flac ];
});
# See https://github.com/NixOS/nixpkgs/issues/53938#issuecomment-454158967
untested-quodlibet-full = pkgs.quodlibet-full.overrideAttrs (oldAttrs: {
doInstallCheck = false;
doCheck = false;
});
# Should be removed during fresh OS installation:
# https://github.com/NixOS/nix/issues/2497
nixfmt = import
(fetchTarball "https://github.com/serokell/nixfmt/archive/master.tar.gz")
{ };
# https://github.com/nixos/nixpkgs/blob/0d202221f98e500f1df79112dc464d013eefcdae/pkgs/development/web/nodejs/v10.nix#L4
in with pkgs;
[
nixfmt
## Personal data tools
gitAndTools.git-open
gitAndTools.gitFull
gitAndTools.diff-so-fancy
gitAndTools.git-annex
gitAndTools.gitRemoteGcrypt
gitAndTools.git-dit
gitAndTools.git-secrets
git-crypt
git-lfs
pkgsUnstable.gnupg
mr
pkgsUnstable.nextcloud-client
borgbackup
git-sizer
## CLI tools
bash
bash-completion
nix-bash-completions
youtube-dl
wget
vim
thefuck
tmux
tmuxinator
sox # =play=
gettext # =envsubst=
ag
gnugrep
ack
htop
rlwrap
awscli
jq
openvpn
xclip
bc # binary calculator used in nucli
sassc
watchman
ipfs
gnumake
gcc
psmisc # =killall=
xorg.xkill
bfg-repo-cleaner
pwgen
gksu # =gksudo=
gnome2.GConf # https://github.com/NixOS/nixpkgs/issues/15978
lsof
pciutils
python27Packages.pywatchman # =watchman-wait=
libressl
tree
i2p
libxml2 # =xmllint=
unzip # used by extract bash function and Clojure go-to-source
odt2txt # used to diff odf files
feh # simplistic image viewer
nixUnstable # =nix=
zip
zlib
redis
alsaUtils # for xmonad volume commands
multimarkdown # =markdown=
pup # command-line HTML parsing https://github.com/ericchiang/pup
binutils-unwrapped # =ar= command for cargo build
nssTools # =pk12util=
gitAndTools.hub # GitHub helper
insomnia
bind # =dig=
file
gitlab-runner
sshpass
zathura # for viewing Emacs PDF files
nvi
cacert
gtypist
pandoc
inotify-tools
fzf
ncdu
fd
nnn
python36Packages.python-slugify
moreutils # =vipe=
bazel
graphviz # =dot= and others
graph-easy # ASCII drawings for GraphViz output
mkpasswd
direnv
recutils
sqlite
sqlitebrowser
trash-cli
qrencode
diffoscope
poppler_utils # used by diffoscope for comparing PDF files
pdftk
gnome3.libgnome-keyring
gnome3.gnome-keyring
## Mail
pkgsUnstable.notmuch
isync
procmail # includes =formail=
## Spell checking
(aspellWithDicts (ps: with ps; [ en eo fr pt_BR ]))
languagetool
## NixOS
pypi2nix
bundix
## Music
texlive.combined.scheme-full
lilypond
python36Packages.python-ly
lame
frescobaldi
timidityWithEvenMoreFormats
untested-quodlibet-full
## Programming tools
sbcl
stack
leiningen
python3
python
yarn
elixir
openjdk
solc
bundler
rustup
cargo
clojure # =clj=
visualvm # JVM profiling tool
ant
maven
go_bootstrap
bats
ledger
newsboat
perl
dhall
dhall-json
nodePackages.node2nix
shellcheck
# (haskell.lib.justStaticExecutables haskellPackages.github-backup)
rustracer
xsel
nodejs-10_x
swift
gocode
## Containers and VMs
packer
docker_compose
docker-machine
vagrant
kubernetes
ansible
qemu
gnome3.gtk-vnc
nixops
terraform-full
## xmonad
xorg.xmodmap
xorg.xmessage
trayer
dmenu
escrotum
xorg.xbacklight
networkmanagerapplet
playerctl
lightdm
fvwm # =xpmroot=
haskellPackages.xmobar
haskellPackages.yeganesh
arandr
## GUI programs
inkscape
calibre
pkgsUnstable.cozy
gpodder
firefox
emacs
tdesktop
vlc
pkgsUnstable.keepassxc
yubioath-desktop
# tor-browser-bundle-bin
libreoffice
android-studio
# androidsdk_extras
# androidndk
patchwork-classic
# gnome3.gpaste
## Cryptocururencies
electrum
zbar # for on-screen QR Code scanning
monero
] ++ localConfiguration.packages;
nixpkgs.config = {
android_sdk.accept_license = true;
allowUnfree = localConfiguration.allowUnfree;
};
# Look at
# https://www.vivaolinux.com.br/topico/Off-Code-Cafe/Me-apresente-sua-distro
programs = {
bash.enableCompletion = true;
autojump.enable = true;
};
services = {
cron.enable = true;
# We can see the actual generated crontab at /etc/crontab
cron.systemCronJobs = localConfiguration.cronJobs;
xserver = {
enable = true;
layout = "br";
xkbOptions = "caps:swapescape";
config = ''
Section "Device"
Identifier "Intel Graphics"
Driver "intel01"
Option "Backlight" "intel_backlight"
EndSection
'';
windowManager.default = "xmonad";
windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
};
desktopManager = {
default = "none";
xterm.enable = false;
gnome3.enable = true;
};
displayManager = {
lightdm.enable = true;
# The config inception was inspired by:
# http://ubuntuforum-br.org/index.php?topic=13784.0
# Lambda symbol name taken from:
# http://wiki.linuxquestions.org/wiki/List_of_Keysyms_Recognised_by_Xmodmap
# To test a keycode:
# xmodmap -e 'keycode 118 = bar Greek_lamda'
sessionCommands = ''
${pkgs.fvwm}/bin/xpmroot ~/Nextcloud/Images/emotion.png &
'';
};
};
gnome3 = {
gnome-keyring.enable = true;
seahorse.enable = true;
gnome-terminal-server.enable = true;
# gpaste.enable = true; # clipboard manager
tracker.enable = true;
sushi.enable = true; # nautilus previewer
gnome-online-accounts.enable = true;
gnome-documents.enable = true;
evolution-data-server.enable = true;
gvfs.enable = true;
};
pcscd.enable = true; # required by yubioath
# https://nixos.org/nixos/options.html#ipfs
ipfs = {
enable = localConfiguration.enableIPFS;
enableGC = localConfiguration.enableIPFS;
autoMount = localConfiguration.enableIPFS;
};
};
security = {
pam.services.lightdm.enableGnomeKeyring = true;
sudo.enable = true;
hideProcessInformation = false;
};
users = {
mutableUsers = false;
extraUsers = let
andrehUser = {
andreh = {
isNormalUser = true;
uid = 1000;
description = "EuAndreh";
extraGroups = [ "wheel" "networkmanager" "docker" ];
# Generated with:
# mkpasswd -m sha-512
hashedPassword = localConfiguration.hashedPassword;
};
};
# From the Guix manual:
# https://www.gnu.org/software/guix/manual/en/html_node/Build-Environment-Setup.html#Build-Environment-Setup
buildUser = (i: {
"guixbuilder${i}" = { # guixbuilder$i
group = "guixbuild"; # -g guixbuild
extraGroups = [ "guixbuild" ]; # -G guixbuild
home = "/var/empty"; # -d /var/empty
shell = pkgs.nologin; # -s `which nologin`
description = "Guix build user ${i}"; # -c "Guix buid user $i"
isSystemUser = true; # --system
};
});
# merge all users
in pkgs.lib.fold (str: acc: acc // buildUser str) andrehUser
# for i in `seq -w 1 10`
(map (pkgs.lib.fixedWidthNumber 2) (builtins.genList (n: n + 1) 10));
extraGroups.guixbuild = { name = "guixbuild"; };
};
systemd = {
services = {
# Derived from Guix guix-daemon.service.in
# https://git.savannah.gnu.org/cgit/guix.git/tree/etc/guix-daemon.service.in?id=00c86a888488b16ce30634d3a3a9d871ed6734a2
guix-daemon = {
enable = true;
description = "Build daemon for GNU Guix";
serviceConfig = {
ExecStart =
"/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild";
Environment = "GUIX_LOCPATH=/root/.guix-profile/lib/locale";
RemainAfterExit = "yes";
StandardOutput = "syslog";
StandardError = "syslog";
TaskMax = "8192";
};
wantedBy = [ "multi-user.target" ];
};
};
};
# 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 = "19.03"; # Did you read the comment?
}