Giter VIP home page Giter VIP logo

dotfiles's Introduction

DOTFILES

Overview

This project aims to manage and configure a Linux environment using a combination of Ansible (mainly use for Debian) and Nix. By leveraging Ansible for general system configuration tasks and Nix for package management and reproducible builds, we ensure a robust, declarative setup for linux systems.

Table of Contents

Getting Started

In this project, you have the flexibility to use Ansible, Nix, or a combination of both to configure your system. Each tool offers unique strengths, and using them together can provide a comprehensive, powerful approach to managing your environment.

Ansible

Prerequisite

Configure system

  • Copy inventory file
    cp ansible/inventory.example.yml ansible/inventory.yml
  • Configure inventory.yml (just example)
    debian: # can use other name
      hosts:
        your_host:
          ansible_host: 192.168.1.100 # better set static IP address
          ansible_user: user
          ansible_become_pass: password
          connection: ssh
          ansible_ssh_pass: password
  • Option 1, Run specific task
    ansible-playbook ansible/playbooks/_handler.yml \
      -i ansible/inventory.yml \
      -e task_file="ansible/tasks/tools/neovim/setup-common.yml" \
      -e '{"is_remove": false}'
  • Option 2, Run specific playbook for specific system
    # run by default using ssh
    ansible-playbook ansible/playbooks/debian.yml \
      -i ansible/inventory.yml \
      -e '{"is_remove": false}'
    
    # or run ansible against localhost
    ansible-playbook ansible/playbooks/nixos.yml \
      -i ansible/inventory.yml \
      -e _hosts="localhost" \
      -e _connection="local" \
      -e '{"is_remove": false}'

Known Limitations

  • Ansible task currently not support for reading current path from task file, only accessible from playbook_dir. Workaround for this is using root of this project as workdir variable that passed to all task-file.
  • It's not as robust as nix, installation and deletion sometime break
  • Linter sometime giving false positive message (some cases with path/directory related problem).
  • PATH in shell often not updated while using ssh, so better develop using ssh for testing.

Nix

Prerequisite

Note: Example can be seen in Nix Readme

Configure system

  • Move into nix
    cd nix
  • Example to configure NixOS (hostname=vbox)
    sudo nixos-rebuild switch --flake .#vbox
  • Example configure Home-Manager (username=demo,hostname=vbox)
    home-manager switch --flake .#demo@vbox

Known Limitations

  • Challenging to setup programming language development environment (sometime need to take a look to project like npm2nix, poetry2nix, etc)
  • Nix mostly use symlink, which is difficult for binding into containerized apps (docker, dev-container)

License

MIT

dotfiles's People

Contributors

labasubagia avatar

Watchers

 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.