Giter VIP home page Giter VIP logo

Comments (4)

inclyc avatar inclyc commented on September 21, 2024 5

My nix-darwin and home-manager configs are in separate files as well.

Type hints in comment is a planned feature.

from nixd.

inclyc avatar inclyc commented on September 21, 2024 2

users.jenya = import ./home;

Looks like you are using HM attributes in an nested import. It's generally hard to check this dataflow. (i.e. nixd cannot know imported file will be used as a part of NixOS modules, or HM modules, or nested in some attribute paths.

Maybe you could write standalone HM options and follow nixd examples in this repo.

from nixd.

han-tyumi avatar han-tyumi commented on September 21, 2024

My nix-darwin and home-manager configs are in separate files as well.
They're both rather big, so having them in separate files makes it a bit easier to update etc.

It'd be cool if you could supply some sort of hint similar to JSDoc import types or Deno's @deno-types.

I have no idea if this makes any sense, but maybe it would look something like this in home.nix.

{ pkgs, ... }:

# type = (import "github:nix-community/home-manager").home-manager.users.<name>
{
  home = {
    stateVersion = "23.11";
  };

  programs = {
    bash.enable = true;
    git = {
      enable = true;
      delta.enable = true;
      lfs.enable = true;
    };
  };
}

from nixd.

Blezz-tech avatar Blezz-tech commented on September 21, 2024

users.jenya = import ./home;

Looks like you are using HM attributes in an nested import. It's generally hard to check this dataflow. (i.e. nixd cannot know imported file will be used as a part of NixOS modules, or HM modules, or nested in some attribute paths.

Maybe you could write standalone HM options and follow nixd examples in this repo.

Excuse me. I forgot to answer. I did as you said and wrote standalone HM options.

This work:

{
  description = "Jenya NixOS Flake Configuration";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

    home-manager.url = "github:nix-community/home-manager";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = { nixpkgs, home-manager, ... }@inputs:
    let
      system = "x86_64-linux";
      username = "jenya";
    in
    {
      nixosConfigurations."pc" = nixpkgs.lib.nixosSystem {
        specialArgs = { inherit inputs username; };
        modules = [ ./nixos ];
      };
      homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
        pkgs = nixpkgs.legacyPackages.${system};
        modules = [ ./home ];
        extraSpecialArgs = {
          inherit inputs system username;
        };
      };
    };
}

Thank you!

from nixd.

Related Issues (20)

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.