GithubHelp home page GithubHelp logo

whacked / setup Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 283 KB

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

Nix 42.88% Ruby 0.64% Dockerfile 1.34% Shell 45.25% Python 4.13% Makefile 1.19% Jsonnet 0.19% wisp 3.83% Clojure 0.54%

setup's Introduction

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

setup's People

Contributors

whacked avatar

Stargazers

Brandon Orther avatar Arun Mascarenhas avatar  avatar Arbal avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.