aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
Diffstat (limited to 'nixos')
-rw-r--r--nixos/configuration.nix297
-rw-r--r--nixos/npmrc.sh1
-rw-r--r--nixos/os-installation.sh83
3 files changed, 381 insertions, 0 deletions
diff --git a/nixos/configuration.nix b/nixos/configuration.nix
new file mode 100644
index 0000000..793d77f
--- /dev/null
+++ b/nixos/configuration.nix
@@ -0,0 +1,297 @@
+{ config, pkgs, ... }:
+
+{
+ 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;
+ grub.device = "/dev/sda";
+ };
+ initrd = {
+ luks.devices = [
+ {
+ name = "root";
+ device = "/dev/sda2";
+ preLVM = true;
+ }
+ ];
+ };
+ };
+
+ hardware = {
+ bluetooth.enable = true;
+ pulseaudio = {
+ package = pkgs.pulseaudioFull;
+ enable = true;
+ };
+ };
+
+ networking.hostName = "nixos"; # Define your hostname.
+ networking.networkmanager.enable = true;
+
+ # Auto-upgrade channel
+ # https://nixos.org/nixos/manual/index.html#idm140737316795120
+ system.autoUpgrade.enable = true;
+
+ nix.gc = {
+ automatic = true;
+ dates = "03:15";
+ };
+
+ # 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;
+
+ # $ nix-env -qaP | grep wget
+ environment.systemPackages = with pkgs; [
+
+
+ ## Personal data tools
+
+ gitAndTools.git-open
+ gitAndTools.gitFull
+ gitAndTools.diff-so-fancy
+ gitAndTools.git-annex
+ gitAndTools.gitRemoteGcrypt
+ gitAndTools.git-dit
+ git-crypt
+ git-lfs
+ gnupg
+ mr
+ nextcloud-client
+ borgbackup
+
+
+ ## 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
+ autojump
+ bfg-repo-cleaner
+ pwgen
+ gksu # =gksudo=
+ gnome3.gconf # https://github.com/NixOS/nixpkgs/issues/15978
+ lsof
+ pciutils
+ libffi # FIXME: Ruby depends on it for FFI
+ 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
+ kubernetes
+ zlib
+ vagrant
+ docker_compose
+ docker-machine
+ redis
+ alsaUtils # for xmonad volume commands
+
+ ## NixOS
+
+ pypi2nix
+ bundix
+ nix-repl
+
+
+ ## Music
+
+ texlive.combined.scheme-full
+ lilypond
+ # frescobaldi FIXME
+
+
+ ## Programming tools
+
+ stack
+ leiningen
+ python3
+ python
+ nodejs-8_x
+ elixir
+ openjdk
+ solc
+ bundler
+ rustc
+ rustfmt
+ cargo
+ clojure # =clj=
+ visualvm # JVM profiling tool
+ maven
+
+
+ ## xmonad
+
+ xorg.xmodmap
+ trayer
+ dmenu
+ escrotum
+ xorg.xbacklight
+ networkmanagerapplet
+ playerctl
+ lightdm
+ fvwm # =xpmroot=
+ haskellPackages.xmobar
+ arandr
+
+
+
+ ## GUI programs
+
+ # calibre # FIXME
+ quodlibet
+ firefox
+ emacs
+ tdesktop
+ riot-web
+ vlc
+ gnome3.evolution
+ keepassx2-http
+ yubioath-desktop
+ tor-browser-bundle-bin
+ transmission_gtk
+ libreoffice
+ android-studio
+ androidsdk_extras
+ androidndk
+
+ ## Cryptocururencies
+
+ electrum
+ zbar # for on-screen QR Code scanning
+ monero
+
+ ## nu specific packages
+ slack
+ chromium
+ ];
+
+ nixpkgs.config.allowUnfree = true; # Require for slack (unfree) derivation
+
+ # Look at
+ # https://www.vivaolinux.com.br/topico/Off-Code-Cafe/Me-apresente-sua-distro
+
+ programs = {
+ bash.enableCompletion = true;
+ };
+
+ services = {
+ xserver = {
+ enable = true;
+ layout = "br";
+ xkbOptions = "caps:swapescape";
+
+ 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.haskellPackages.xmobar}/bin/xmobar ~/.xmobarrc &
+ ${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
+ };
+
+ users = {
+ mutableUsers = false;
+ extraUsers.andreh = {
+ isNormalUser = true;
+ uid = 1000;
+ description = "EuAndreh";
+ extraGroups = [ "wheel" "networkmanager" "docker" ];
+ passwordFile = "/home/andreh/annex/dev/code/dotfiles/encrypted/password-hash.txt";
+ };
+ };
+
+ security.sudo = {
+ enable = true;
+ ## FIXME: this shouldn't be necessary, since wheels group already has sudo
+ extraConfig =
+ ''
+ andreh ALL=(ALL) ALL
+ '';
+ };
+
+ # 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 = "17.09"; # Did you read the comment?
+}
diff --git a/nixos/npmrc.sh b/nixos/npmrc.sh
new file mode 100644
index 0000000..2bc28dc
--- /dev/null
+++ b/nixos/npmrc.sh
@@ -0,0 +1 @@
+prefix="~/.npm-packages"
diff --git a/nixos/os-installation.sh b/nixos/os-installation.sh
new file mode 100644
index 0000000..827b820
--- /dev/null
+++ b/nixos/os-installation.sh
@@ -0,0 +1,83 @@
+sudo umount /dev/sdc1
+sudo dd if=os.iso of=/dev/sdc #
+
+# Derived from https://www.maketecheasier.com/nixos-review/
+
+# First, connect an ethernet cable
+
+loadkeys br-abnt2
+fdisk /dev/sda
+
+# START Steps within fdisk
+# First, delete all partitions with `d`
+o
+
+n
+p
+1
+ENTER
++2G
+t
+82
+
+n
+p
+2
+ENTER
+ENTER
+
+a
+2
+
+w
+# END Steps within fdisk
+
+mkswap -L swap /dev/sda1
+swapon /dev/sda1
+mkfs.ext4 -L nixos /dev/sda2
+mount /dev/disk/by-label/nixos /mnt
+nixos-generate-config --root /mnt
+
+# START Edit NixOS configuration file
+vi /mnt/etc/nixos/configuration.nix
+
+# Uncomment:
+boot.loader.grub.device = “/dev/sda”
+enviroment.systemPackages = with pkgs; [
+ wget
+ vim
+ firefox
+ gitAndTools.gitFull
+ gitAndTools.git-annex
+ gitAndTools.gitRemoteGcrypt
+ lsof
+ gnupg
+ gnupg1
+]
+
+# Add:
+services = {
+ xserver = {
+ enable = true;
+ desktopManager.gnome3.enable = true;
+ displayManager.gdm.enable = true;
+ };
+};
+# END
+
+nixos-install
+
+# OS will prompt for root UNIX password
+
+reboot
+
+
+C-M-<F1>
+ useradd -m andreh
+ passwd andreh
+ # Setup UNIX password (for andreh)
+
+ sudo vi /etc/sudoers
+ # START Add the following line below the `root` line
+ andreh ALL=(ALL) ALL
+ # END