Giter VIP home page Giter VIP logo

nix-rice's Introduction

nix-rice

what's ricing?

Ricing, in a restricted sense, is often used to describe the act of superficially modifying a UI to give it a better design, more suited to personal preference. r/unixporn is an example of a desktop ricing community.

what's nix-rice?

The nix-rice library is a wrapper over a subset of the nixos configuration system; particularly the part of that system concerned with parameters of concern to ricing.

It aims to provide a method of ricing that is portable, fool-proof and easy to read, and distributable without worries regarding security or system breakage. Here is an example of the way in which one can define an (simple) ricing configuration in a single nix-language expression:

makeRice {
  customFiles = [{input = ./vimrc; output = userFile ".vimrc";}];
    # yes, that is deterministic dotfile management!
  dm = makeDM.slim {
    background = ./backgrounds/water-drops.jpg;
    defaultUser = normalUser;
  }
  wm = makeWM.i3 rec {
    modkey = "Mod4";
    appearance = 
      { windowHeader = false; windowBorder = 3; };
    font = terminal.font;
    terminal = makeTerminal.tilda {
      transparence = 0.3;
      font = makeFont.powerline {
        baseFont = "dejavu";
      };
    };
  };
}

Imagine if posts on r/unixporn all came with their own rice expression so all you had to do to try them out would be to import them into your system configuration!

glossary of terms

  • world value
    • epistemically: represents everything an element of a ricing config could want to use.
    • practically: an internally referenced value constructed in utilities/default.nix, containg things like the nix package set and interal utility functions.
  • element
    • epistemically: represents a part of a ricing configuration (a terminal or window manager).
    • practically: a function that, given the world value, constructs a set containing a 'type' attribute and some parameters (filepaths, numbers, other elements, you name it). The type attribute it used to implement a sort of trivial type-system; builders assert that their input element is of a certain type.
  • constructor
    • epistemically: turns a set of user-specified parameters into an element; constructors are user-facing.
    • practically: a simple function that, given a set of necessary parameters, constructs an element.
  • actuator
    • epistemically: the effectful result of an element.
    • practically: a function that, given the world value, returns a set containing a 'config' attribute and a 'handles' attribute, which represent the side-effects the actuator will have on the system configuration and the return values that it may produce (and be used to construct other actuators)respectively.
  • builder
    • epistemicaly: a function that transforms an element into an actuator.
    • practically: a function that transforms an element into an actuator.
  • a rice element
    • a top-level element of the nix-rice system; an entire ricing configuration.
  • callRice
    • the entrypoint into the nix-rice library; builds a rice element with buildRice, supplies the result with the 'world' parameter and discards the 'handles' attribute that the actuator produces.

description of general structure

callRice, the top-most entry point into nix-rice, accepts a rice element. The rice element is constructed with 'makeRice', taking as parameter a set of elements and values, the elements of which are constructed with other constructors of a similar pattern. Thus, the construction of a rice, similar to the construction of any other element, is hierarchal and fool-proof, an error being returned from a constructor if it is not given bad parameters.

For each type of element, there is a respective builder, which turns the element into an actuator; each builder calls builders for the child elements as well, the top-most builder being 'makeRice'.

The various configuration sets in play are merged with lib.mkMerge.

the mission

Is to go where no ricer has gone before; make a unified system for simple definition and fool-proof and deterministic deployment of ricing configurations.

Thanks to everybody who showed interest in this, I'm going to go ahead and put some work into it.

nix-rice on the internet! - https://www.reddit.com/r/unixporn/comments/3daem9/something_cooking_i3/ct3mn28?context=3

documentation of constructors

Is available in 'documentation' file of this directory.

nix-rice's People

Contributors

cgadski avatar psub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

psub

nix-rice's Issues

feature request: git+generation integration for dotfile management

Great work you're doing, dotfile management is a major missing link in nixos, imho.

I know it's early days for this project, so see this as a brainstorm.

@matthiasbeyer is doing related work, he has a script that shows you the nixpkgs commit that your current generation is derived from.
One of his goals is something similar but for configuration.

I guess you can see where this is going:
Eventually, it'd be great to have a way to see which dotfile config each generation has.

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.