Git Product home page Git Product logo

home-nix's Introduction

My Nix home

This repos contains the NixOS and home-manager configuration for all my computers. It is organised in the following way:

  • flake.nix: Tie everything together. It is responsible for propagating the modules and overlays from the inputs to the rest of the config. As of now it is a big spaghetti code that shouldn't be edited often.
  • utils.nix: Helper library functions that are needed to manipulate modules, ie cannot depend on value set through the module system.
  • lib: A directory of helper functions that are made available to modules through config.lib.
  • packages: Individual packages definition, instantiation through an overlay in packages/default.nix. Packages defined here will be exposed as package output of the flake.
  • overlays: Additional overlays I may need. Overlays defined here will be exposed as overlay output of the flake.
  • modules: Additional modules for every module system. The subdirectories define at which step of the module hierarchy they should be applied. As of now three types of modules are supported nixos ones, hm ones and nixvim ones. Modules defined here will be exposed as nixosModules, hmModules and nixvimModules respectively in the outputs of the flake.
  • profiles: Profiles are modules that don't define options. Most of the concrete configuration is done through this. Like modules, they are split depending on their kind, being nixos, hm or nixvim as of now. Each profile should be defined as a default.nix in a directory. Those files will be automatically found, and exposed as options that can be enabled. For example, a file hm/interface/theme/default.nix will be exposed as an option in home-manager named interface.theme.enable that when toggled will have the same effect as importing the previous file.
  • hosts: Top level configurations for computers. All home-manager configurations must be used from those, they are not exposed otherwise. Semantically this is the entry points of the configurations. They are exposed in the nixosConfigurations output of the flake.

Miscellaneous

Some effort has been done to create a uniform feeling and theme across applications. To do so I am actually using nix-colors, but I am planning to move to stylix when after refactoring it.

After using Doom Emacs for some years, I am in the process of moving to neovim, configured through nixvim. As of now the setup is a ugly mix of part of configuration for the two of them.

Instead of setting up the packages and editor for different languages directly in the home-manager configuration, I'd like to expose it as devshells that I can use in different projects. Maybe do something based on devenv.sh.

As of now there is no way to handle secrets in the configuration, and this is a problem.

This whole repository is definitely overengineered, but it is fun to hack on.

home-nix's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

home-nix's Issues

"Infinite Recursion Occurred" when using which-key/nix-colors

Hey there,

I was attempting to use your which-key plugin and your nix-colors plugin that you have configured for nixvim, but I found that I got an infinite recursion error whenever I tried to use them:

error: infinite recursion encountered

       at /nix/store/if56vv9237zafkzgzcdkqxf2lmp86myq-source/lib/modules.nix:719:9:

          718|     in warnDeprecation opt //
          719|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          720|         inherit (res.defsFinal') highestPrio;
(use '--show-trace' to show detailed location information)

I've included my sample config here, and for those plugins, I had just copied and pasted what you had in your files for both of those. What do I need to do in order to fix this?

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.