whacked / setup

reproducible local/remote/virtual machine setup tooling (nix / ansible)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

env all

see ~/.nixpkgs/config.nix

nix setup

using https://github.com/rycee/home-manager

mkdir -p /nix/var/nix/{profiles,gcroots}/per-user/$USER

HM_PATH=https://github.com/rycee/home-manager/archive/master.tar.gz

mkdir ~/.config/nixpkgs

cat > ~/.config/nixpkgs/home.nix <<EOF { programs.home-manager.enable = true; programs.home-manager.path = $HM_PATH; } EOF

nix-shell $HM_PATH -A install

nix helpers

a handful of opinionated utilities to facilitate working in a hybrid, (mostly) nix-managed development environment

source bash/nix_shortcuts.sh in bash/zsh to add e.g. these functions:

read-shortcuts <path-to-shell-script>
get overview of functions/aliases
shortcuts
print full overview from previously read scripts
create-nix-shell-skeleton
create a basic helper-enabled shell.nix file
create-nix-flake-skeleton
create a basic helper-enabled flake.nix file

what the flake skeleton includes into the nix shell environment

  • loads the helper nix functions (flake-helpers.nix) from a pinned commit of this repo
  • shortcuts utilities from nix_shortcuts.sh (not printed)
  • shortcuts from jsonnet_shortcuts.sh (not printed)
  • shortcuts from package-jsonnet-composition.nix.sh (not printed)
  • source and run echo-shortcuts for scripts you add to the includeScripts array
  • add the shellHook of the flake to echo-shortcuts

the motivation behind this per-projects shell shortcuts organization is introduced here

vagrant setup

vagrant init nixos/nixos-18.03-x86_64
vagrant plugin install vagrant-disksize

nixos plugin

probably skip this; the provisioner is not as reliable as directly running nixos-rebuild switch

vagrant plugin install vagrant-nixos-plugin

unfree software, e.g. vscode

  1. enable
    nixpkgs.config.allowUnfree = true; # for nixos
        

    in file:/etc/nixos/configuration.nix; for non-nixos you should set

    allowUnfre = true;
        

    in file:~/.config/nixpkgs/config.nix

  2. NIXPKGS_ALLOW_UNFREE=1 nix-env -qa | grep vscode
  3. NIXPKGS_ALLOW_UNFREE=1 nix-env -i vscode

xfce configuration

turn capslock into second ctrl

one-shot command: =setxkbmap -option “ctrl:nocaps”=

via xmodmap with mapping Alt_R to mod3

clear mod3
remove mod1 = Alt_R
add mod3 = Alt_R

change default key theme to emacs

xfconf-query -c xsettings -p /Gtk/KeyThemeName -s Emacs

reloading xmonad with nix libraries

nix-shell -p alsaLib pkgconfig x11 xorg.libXrandr xorg.libXinerama xorg.libXScrnSaver --run 'xmonad --recompile'
nix-shell -p alsaLib pkgconfig x11 xorg.libXrandr xorg.libXinerama xorg.libXScrnSaver --run 'xmonad --restart'

change xfwm4 to xmonad

xfconf-query -c xfce4-session -p /sessions/Failsafe/Client0_Command -t string -sa xmonad

Gtk warnings in gui apps

running e.g. firefox from the command line spits out a lot of warnings. in particular, theme warnings can be fixed with:

export GTK_THEME=Adwaita firefox

emacs keybindings in Gtk apps installed by nix

ref NixOS/nixpkgs#25838

see linking of Emacs theme in circa file:playbook.yml::103

to use nix setup on a new machine

  1. link setup/nix to $HOME/.nixpkgs
  2. nix-env -i my-custom-nixpkgs

About

reproducible local/remote/virtual machine setup tooling (nix / ansible)


Languages

Language:Shell 45.3%Language:Nix 42.9%Language:Python 4.1%Language:wisp 3.8%Language:Dockerfile 1.3%Language:Makefile 1.2%Language:Ruby 0.6%Language:Clojure 0.5%Language:Jsonnet 0.2%