Skip to content

Commit

Permalink
chore: fix nixd nixos and home-manager option expresisons
Browse files Browse the repository at this point in the history
  • Loading branch information
BastianAsmussen committed Jan 8, 2025
1 parent 9f4b563 commit 62c493a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 28 deletions.
4 changes: 2 additions & 2 deletions modules/home-manager/terminal/nixvim/plugins/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
config,
osConfig,
self,
lib,
userInfo,
pkgs,
...
}: {
Expand All @@ -22,7 +22,7 @@
gitsigns = import ./gitsigns.nix config;
hardtime.enable = true;
indent-blankline.enable = true;
lsp = import ./lsp {inherit config osConfig lib pkgs userInfo;};
lsp = import ./lsp {inherit osConfig self lib pkgs;};
lsp-format.enable = true;
lspkind = import ./lspkind.nix;
lualine = import ./lualine.nix;
Expand Down
5 changes: 2 additions & 3 deletions modules/home-manager/terminal/nixvim/plugins/lsp/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
config,
osConfig,
self,
lib,
pkgs,
userInfo,
}: {
enable = true;

Expand All @@ -19,7 +18,7 @@
html.enable = true;
java_language_server.enable = true;
lua_ls = import ./lua_ls.nix;
nixd = import ./nixd.nix {inherit osConfig config lib pkgs userInfo;};
nixd = import ./nixd.nix {inherit osConfig self lib pkgs;};
pylsp.enable = true;
sqls.enable = true;
svelte.enable = true;
Expand Down
28 changes: 6 additions & 22 deletions modules/home-manager/terminal/nixvim/plugins/lsp/nixd.nix
Original file line number Diff line number Diff line change
@@ -1,38 +1,22 @@
{
osConfig,
config,
self,
lib,
pkgs,
userInfo,
}: {
enable = true;

settings = let
inherit (osConfig.networking) hostName;

flakeExpr =
# nix
''
(builtins.getFlake "${config.home.homeDirectory}/dotfiles")
'';
flake = ''(builtins.getFlake "${self}")'';
nixosOpts = ''${flake}.nixosConfigurations.${hostName}.options'';
in {
nixpkgs.expr =
# nix
''
import ${flakeExpr}.inputs.nixpkgs {}
'';
nixpkgs.expr = ''import ${flake}.inputs.nixpkgs {}'';
formatting.command = ["${lib.getExe pkgs.alejandra}"];
options = {
nixos.expr =
# nix
''
${flakeExpr}.nixosConfigurations.${hostName}.options
'';
home-manager.expr =
# nix
''
${flakeExpr}.homeConfigurations."${userInfo.username}@${hostName}".options
'';
nixos.expr = nixosOpts;
home-manager.expr = ''${nixosOpts}.home-manager.users.type.getSubOptions []'';
};
};
}
3 changes: 2 additions & 1 deletion modules/nixos/home-manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
config,
lib,
userInfo,
self,
...
}: let
inherit (lib) mkEnableOption mkIf;
Expand All @@ -15,7 +16,7 @@ in {

config = mkIf config.home-manager.enable {
home-manager = {
extraSpecialArgs = {inherit inputs userInfo;};
extraSpecialArgs = {inherit inputs userInfo self;};
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "backup";
Expand Down

0 comments on commit 62c493a

Please sign in to comment.