Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@talon
Last active April 30, 2020 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talon/fa100f03f60d6ce5990a15e95db40a64 to your computer and use it in GitHub Desktop.
Save talon/fa100f03f60d6ce5990a15e95db40a64 to your computer and use it in GitHub Desktop.
NixOS + XMonad aka Bootleg FireFox OS
{ config, pkgs, ... }:
{
imports =
[
# this is generated during the install process
./hardware-configuration.nix
];
# hardware
sound.enable = true;
hardware.pulseaudio.enable = true;
# system settings
networking.hostName = "specter-nix";
time.timeZone = "America/New_York";
i18n.defaultLocale = "en_US.UTF-8";
# system packages are available to every user
environment.systemPackages = [
pkgs.git
pkgs.xclip
pkgs.vim
];
users.users = {
# change this to your name
talon = {
isNormalUser = true;
extraGroups = [ "wheel" ];
packages = [
# to start FireFox on boot add it to your ~/.xprofile
pkgs.firefox
# to install packages while using your computer see `man nix-env`
# use `alt+p` to start dmenu and search for and launch any installed package
pkgs.dmenu
# WARNING: required by the xmonad configuration
pkgs.haskellPackages.xmonad-contrib
pkgs.haskellPackages.xmonad-extras
pkgs.haskellPackages.xmonad
];
};
};
services.xserver = {
libinput.enable = true;
libinput.naturalScrolling = true; # a natural default
xkbOptions = "caps:ctrl_modifier"; # CAPSLOCK is CTRL - change my mind
# see xmonad.org
windowManager.xmonad = {
config =
"
import XMonad
import Data.Default
import XMonad.Layout.NoBorders
import XMonad.Layout.TwoPane
main = xmonad def
{ focusedBorderColor = \"#FFFFFF\"
, normalBorderColor = \"#000000\"
, layoutHook = smartBorders $ (Full ||| TwoPane (10/100) (60/100))
}
";
enableContribAndExtras = true;
extraPackages = haskellPackages: [
haskellPackages.xmonad-contrib
haskellPackages.xmonad-extras
haskellPackages.xmonad
];
enable = true;
};
displayManager.defaultSession = "none+xmonad";
displayManager.lightdm = {
# change this to your name
autoLogin.user = "talon";
autoLogin.enable = true;
enable = true;
};
enable = true;
};
# use `~/.Xresources` to change fonts and other display settings
fonts = {
fonts = [
pkgs.ubuntu_font_family
];
fontconfig = {
defaultFonts = {
serif = [ "Ubuntu" ];
sansSerif = [ "Ubuntu" ];
monospace = [ "Ubuntu" ];
};
};
enableDefaultFonts = true;
};
networking = {
# WARNING: these interfaces will be specific to your computer
interfaces.enp1s0.useDHCP = true;
interfaces.wlp2s0.useDHCP = true;
wireless.enable = true;
useDHCP = false;
};
# WARNING: this will be specific to your partitioning scheme
# and if your computer has UEFI or BIOS
boot.loader.grub = {
enable = true;
version = 2;
device = "/dev/sda";
};
system.stateVersion = "20.03";
}

NixOS + XMonad

minimal NixOS configuration that boots to FireFox

To install NixOS on your machine see: https://nixos.org/nixos/manual/index.html#ch-installation

System

Use nixos-help to open the NixOS manual

NixOS configuration lives in /etc/nixos/configuration.nix

XMonad

XMonad is a window manager which is what allows you to view and switch between simultaneously running programs.

  • alt+shift+enter will open a terminal
  • alt+p and type to search any package to run
    • install programs with nix-env. see: man nix-env
  • alt+j and alt+k to move between windows
  • alt+space to change window layouts
  • alt+[1-9] to change workspaces
  • alt+shift+[1-9] to send window to workspace

XOrg

XMonad is backed by the XOrg display server

  • use ~/.Xresources to configure fonts and other display variables
  • add startup programs to ~/.xprofile

Start FireFox on boot with ~/.xprofile

/etc/profiles/per-user/talon/bin/firefox &

Adjust terminal font with ~/.Xresources

xterm*faceName: Ubuntu Mono
xterm*faceSize: 12

you're on your own from here kid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment