GithubHelp home page GithubHelp logo

dotfiles's Introduction

~abstrnoah/.dotfiles

My dotfiles use nixphile for most deployment. Setup goes something like the following. Throughout, PACKAGE refers to the flake package to deploy, probably the new machine's hostname.

# Bootstrap Nix.
sh <(curl -L https://raw.githubusercontent.com/abstrnoah/nixphile/main/nixphile)

# Clone dotfiles locally to "~/.dotfiles".
# If ~/.dotfiles is already cloned, then you should manually pull.
nix run 'github:abstrnoah/dotfiles#clone-dotfiles'

# Deploy the environment.
nix run 'github:abstrnoah/dotfiles#nixphile' 'github:abstrnoah/dotfiles#PACKAGE'

# Setup login shell.
export SHELL=$(nix eval --raw 'github:abstrnoah/dotfiles#config.SYSTEM.shell')
sudo cp ~/.nixphile/env/etc/shells /etc/shells
sudo chsh -s $SHELL abstrnoah

# Install root systemd units.
# (TODO)

# Reload systemd user daemon.
systemctl --user daemon-reload

# Create an ssh key, transfer public key to personal server via pastebin.
ssh-keygen
cat ~/.ssh/id_rsa.pub | pastebin -

# Configure ssh from template.
cp ~/.dotfiles/share/ssh_config_template ~/.ssh/config
vim ~/.ssh/config

# Secret stuff.
# ...

nix-on-droid

See the nix-on-droid README about installing as flake.

Install the app.

As above with PACKAGE=nix-on-droid, except replace the first step with

# Bootstrap nix-on-droid environment.
nix-on-droid switch --flake 'github:abstrnoah/dotfiles#default'

Nix flake structure

The flake's "installables" (see nix(1)) are intended to produce packages that can be deployed via nixphile.

The flake produces the following outputs:

  • upstreams.${system} - All upstream packages used by other parts of the flake.
  • ours.${system} - Where upstreams are overridden. Many of these are the result of bundling upstreams with my own configuration. They have only been tested insofar as they run on my specific machine, so probably unsuitable for other folks. But who knows maybe you'll find a gem amid the muck.
  • bundles.${system} - Bundles of packages from the above two outputs. This is where I organise them into useful collections. For instance, there is a coyote bundle that is deployed to the so-named machine.
  • packages.${system} - The main package set, obtained by merging upstreams // ours // bundles.
  • config.${system} - My own utilities and configuration parameters. Note that I collect "library" functions in this output, instead of separating them into a separate out output. That's because this flake really shouldn't be used as an upstream library; everything should be viewed as "the author's custom configuration".
  • ... - There might be others, but the above are the main characters.

All of our (downstream) packages are constructed by functions of the form

package = config@{...}: packages@{...}: <derivation>

These are called by config.${system}.cons-package which passes in the necessary arguments and allows for overriding (a very simple version of nixpkgs' callPackage).

P.S. If you don't like how the code is formatted, then blame nixfmt.

TODO

  • rewrite nixphile
  • xclip? non-x-reliant clipboard manager?
  • speedup, namely bundle
  • inputs follow nixpkgs
  • separate utils into separate lib flake?
  • make deploy to non-nix system actually work
  • Deal with environment riffraff with zsh i3 etc
  • nix-ify i3wm so that execs there can refer to nix paths
  • deal with root config like system systemd units
  • actually test deployment on completely fresh machine
  • QT_XCB_GL_INTEGRATION=none

dotfiles's People

Contributors

abstrnoah avatar

Watchers

 avatar  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.