Giter Site home page Giter Site logo

r17x / universe Goto Github PK

View Code? Open in Web Editor NEW
69.0 3.0 8.0 1.43 MB

my development universe ❄️ ƛ

Home Page: https://rin.rocks

Nix 43.36% Lua 37.71% Vim Script 8.67% C 7.46% Makefile 0.19% Reason 2.13% HTML 0.12% TypeScript 0.07% JavaScript 0.29%
nix nixpkgs dotfiles home-manager nix-darwin linux nixvim osx sketchybar skhd

universe's Introduction

Rin's Home 🏚

This "README" is available in 🇮🇩 Bahasa.

Motivation

(DRY) - Don't repeat yourself is a principle in software development. We should use this principle to reduce repetitive and time-consuming work. Personally, I just try to apply this principle in my professional and personal work. The most basic example is making these dotfiles, so that I don't have to provide the needs of the devices or tools used in everyday life. So, from this motivation you can see the main goal (Goal).

The work of a software developer, software engineer, or software laborer requires tools that are used on top of a running system (termed an operating system or OS). I am familiar with using operating systems such as OSX based on Darwin/Unix made by Apple and ArchLinux based on Linux. Well my goal is to become a human user agnostic (not religiously attached to a system but still loyal to the creator of the user, except for the operating system made by Mikocok). The tools are collected in one place to store everything about tools, configurations, settings, credentials, and others that support the needs of working or just operating a computer. Where is my container? In this github, then we need git or other tools, which is clear that we stay in sync between each machine we use so that we don't do repetitive things.

To keep it pure and the same between each machine, I decided to use Nix.

Nix

Nix is a "purely functional package manager", the Nix experience is completely different than other package managers. For some people it may seem complicated to use, but it is worth it if you understood what you really need.

If you have ever used the "virtual env" tool popular in the "python" ecosystem then you can experience the same thing but across operating systems, platforms, and programming language ecosystems.

Since nix uses functional concepts like declarative then it should be utilized well. such as declaring needs and then declaring with nix language.


Heavily inspired from (malob/nixpkgs).

This is my personal configuration with nix using flakes, home-manager, & nix-darwin for Darwin or MacOS System.

Structure

.
├── darwin.nix (Nix Darwin configuration)
├── default.nix (Support legacy nix)
├── flake.lock
├── flake.nix (Flake configuration)
├── flake.nix.simple (Example: currently NOT USED)
├── home (home-manager)
│   ├── activation.nix (Some script and configuration when activation the home manager)
│   ├── packages.nix (list packages per user)
│   └── shells.nix (shell configuration, default Fish shell with startship)
├── nixpkgs.nix (Support legacy nix)
├── pkgs (modules for overlay in flake.nix, mostly generated by related tools like node2nix)
│   └── node-packages
│       ├── README.md
│       ├── default.nix
│       ├── node-env.nix
│       ├── node-packages.json
│       └── node-packages.nix
└── result -> /nix/store/xxxxxxx (the result when completed run nix build)

4 directories, 15 files

Usage

Prerequisite

Nix

System Single User Multiple User Command
Linux Single UserMulti User
Darwin (MacOS) Multi User
More...
Linux Single User
sh <(curl -L https://nixos.org/nix/install) --daemon
Linux Multi User
sh <(curl -L https://nixos.org/nix/install) --no-daemon
Darwin Multi User
sh <(curl -L https://nixos.org/nix/install)

Enable experimental-features

In general installation of nix, the nix configuration is located in ~/.config/nix/nix.conf. You MUST be set the experimental-features before use this configuration.

experimental-features = nix-command flakes

// (optional) for distribution cache (DON'T COPY THIS COMMENT LINE)
substituters = https://cache.nixos.org https://cache.nixos.org/ https://r17.cachix.org

Setup

// with SSH

git clone [email protected]:r17x/nixpkgs ~/.config/nixpkgs

// OR with HTTP
git clone https://github.com/r17x/nixpkgs ~/.config/nixpkgs
  • Change directory to ~/.config/nixpkgs
cd ~/.config/nixpkgs
  • Run Build
    command for build: nix build .#darwinConfigurations.[NAME].system
    Available for [NAME]:
    • RG
nix build .#darwinConfigurations.RG.system
  • Apply from Result
    command for apply the result: ./result/sw/bin/darwin-rebuild switch --flake .#[NAME]
    Available for [NAME]:
    • RG
      After Run Build you can apply from ./result with this command
./result/sw/bin/darwin-rebuild switch --flake .#RG
  • Done 🚀🎉

Command List

  • drb - darwin rebuild aliases - rebuild this nixpkgs.
  • drs - darwin rebuild and switch the build version (make current build to current version of environment).
  • lenv - list of build version <VERSION>, that's usefull for switch aka rollback environment.
  • senv <VERSION> - switch spesific version (number).

Acknowledgement

universe's People

Contributors

dependabot[bot] avatar r17x 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  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  avatar

Watchers

 avatar  avatar  avatar

universe's Issues

template: rust project

Init rust project

We need provided rust template with this command

# basic rust project
nix flake init --new github:r17x/nixpkgs#rust
# wasm target build
nix flake init --new github:r17x/nixpkgs#rust-wasm
# binary 
nix flake init --new github:r17x/nixpkgs#rust-basic

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.