GithubHelp home page GithubHelp logo

home-damager's Introduction

Fully declarative Home Manager installation

Home Manager is great. It allows configuring user environments fully declaratively.

But installing Home Manager has always been wrong: Channels are bad, nix-env is bad. And Home Manager dropping a flake.nix somewhere is also bad.

While Home Manager environments are declarative, installation is not!

In my opinion, installing Home Manager should work like this:

  1. Add a default.nix in a directory of choice.

  2. Import the Home Manager Nix library from there.

  3. Put your configuration and custom modules wherever you please.

  4. Add attributes to default.nix that correspond to the machines or profiles or users you're managing.

  5. Run nix-shell -A <attribute> --run switch to instantly switch to an environment.

  6. In an existing environment, run home-manager switch as usual.

This repository implements such a wrapper around Home Manager, which you can use as just described. It will match the Home Manager release to the version of Nixpkgs in use for the given expression.

Example

Check example.nix for the structure of the entry point to your set of Home Manager configurations.

To use it, get a copy and add remote sources:

nix-shell -p npins wget --run $SHELL
wget https://github.com/fricklerhanderk/home-damager/tree/main/example.nix
npins init --bare
npins add github nixos nixpkgs --branch nixos-23.11
npins add github fricklerhandwerk home-damager

Development

Run an interactive NixOS VM test:

nix-shell --run test-interactive

When the Python prompt >>> appears, enter:

start_all()

When the login prompt appears, login with root. Then run:

run-test

When the test succeeds, run poweroff and then Ctrl+D to stop the VM.

Due to the impure fetchTarball reference used to automatically fetch the right version of Home Manager (the secret sauce to convenience), it's unfortunately impractical to make a hermetic integration test.

home-damager's People

Contributors

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