Skip to content

Commit 75636a4

Browse files
committed
fix(modules): fix adding module
1 parent cd5af49 commit 75636a4

File tree

3 files changed

+52
-33
lines changed

3 files changed

+52
-33
lines changed

flake.nix

+43-30
Original file line numberDiff line numberDiff line change
@@ -62,40 +62,53 @@
6262
};
6363

6464
outputs =
65-
inputs@{ self, flake-parts, ... }:
65+
inputs@{
66+
self,
67+
flake-parts,
68+
nixpkgs,
69+
...
70+
}:
6671
flake-parts.lib.mkFlake { inherit inputs; } {
6772
imports = [ inputs.devshell.flakeModule ];
68-
flake = {
69-
overlay = self.overlays.default;
70-
overlays.default =
71-
let
72-
nixpkgs-stable = import inputs.nixpkgs-stable {
73-
system = "x86_64-linux";
74-
config = {
75-
allowUnfree = true;
73+
flake =
74+
let
75+
inherit (nixpkgs) lib;
76+
in
77+
{
78+
overlay = self.overlays.default;
79+
overlays.default =
80+
let
81+
nixpkgs-stable = import inputs.nixpkgs-stable {
82+
system = "x86_64-linux";
83+
config = {
84+
allowUnfree = true;
85+
};
7686
};
77-
};
78-
in
79-
import ./patches { inherit nixpkgs-stable; };
80-
homeManagerModules = {
81-
dotfiles = import ./modules/home-manager/dotfiles.nix;
82-
zinit = import ./modules/home-manager/zinit.nix;
83-
zotero = import ./modules/home-manager/zotero.nix;
84-
};
85-
nixosModules = {
86-
vfio = import ./modules/nixos/vfio.nix;
87-
virtualisation = import ./modules/nixos/virtualisation.nix;
88-
xp-pentablet = import ./modules/nixos/xp-pentablet.nix;
89-
};
90-
homeConfigurations = import ./machines/home-manager.nix {
91-
inherit (inputs.nixpkgs) lib;
92-
inherit inputs self;
93-
};
94-
nixosConfigurations = import ./machines {
95-
inherit (inputs.nixpkgs) lib;
96-
inherit inputs self;
87+
in
88+
import ./patches { inherit nixpkgs-stable; };
89+
homeManagerModules =
90+
let
91+
modulePath = ./modules/home-manager;
92+
in
93+
lib.mapAttrs' (
94+
f: _: lib.nameValuePair (lib.removeSuffix ".nix" f) (import (modulePath + "/${f}"))
95+
) (builtins.readDir modulePath);
96+
nixosModules =
97+
let
98+
modulePath = ./modules/nixos;
99+
in
100+
lib.mapAttrs' (
101+
f: _: lib.nameValuePair (lib.removeSuffix ".nix" f) (import (modulePath + "/${f}"))
102+
) (builtins.readDir modulePath);
103+
homeConfigurations = import ./machines/home-manager.nix {
104+
inherit (inputs.nixpkgs) lib;
105+
inherit inputs self;
106+
};
107+
nixosConfigurations = import ./machines {
108+
inherit (inputs.nixpkgs) lib;
109+
inherit inputs self;
110+
};
97111
};
98-
};
99112
systems = [ "x86_64-linux" ];
100113
perSystem =
101114
{ pkgs, system, ... }:

machines/default.nix

+1-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ let
6363
inputs.nvimdots.homeManagerModules.nvimdots
6464
inputs.sops-nix.homeManagerModules.sops
6565
inputs.spicetify-nix.homeManagerModules.default
66-
self.homeManagerModules.dotfiles
67-
self.homeManagerModules.zinit
68-
self.homeManagerModules.zotero
66+
self.homeManagerModules.default
6967
];
7068
users."${user}" = {
7169
imports =

modules/home-manager/default.nix

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
imports = [
3+
./dotfiles.nix
4+
./qtile.nix
5+
./zinit.nix
6+
./zotero.nix
7+
];
8+
}

0 commit comments

Comments
 (0)