Giter Club home page Giter Club logo

nixos's People

Contributors

martijnboers avatar

Stargazers

 avatar  avatar

Watchers

 avatar

nixos's Issues

Using `osConfig` to avoid installing kitty or kde in the home-manager

Hey I like your nixos config very much and actually I'm rewriting my configs based on your repo.

I like the clean separation of the os configs and home-manager configs.

One thing I noticed is that even if I set the hosts.desktop.enable = false, the home-manager will still install kitty or some kde components.

I see you said the home/modules/kitty.nix would be lazy loaded but I didn't quite understand this.

nixos/home/default.nix

Lines 53 to 55 in f41940f

# Used by desktop but lazy loaded
./modules/kitty.nix
./modules/kde.nix

To avoid installing such packages, I think using the osConfig provided by home-manager is a good way:

Home Manager will pass osConfig as a module argument to any modules you create. This contains the system’s NixOS configuration.

Taking kitty as an example, I rewrite the config like the following, and the kitty won't be installed if I set the hosts.desktop.enable = false.

{ lib, osConfig, ... }:
with lib; let
  cfg = osConfig.hosts.desktop;
in {
  config = mkIf cfg.enable {
    programs.kitty = {
      enable = true;
...

I also use this osConfig in the profiles/desktop.nix.

Thank you for your great nixos config!

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.