diff --git a/flake-modules/example-vm.nix b/flake-modules/example-vm.nix index a8ce4b3..f2a4b74 100644 --- a/flake-modules/example-vm.nix +++ b/flake-modules/example-vm.nix @@ -8,9 +8,11 @@ in { # Example vm configuration flake.nixosConfigurations.vm = lib.nixosSystem { - inherit system pkgs; + inherit pkgs; modules = [ - inputs.self.nixosModules.vm # import vm module + inputs.self.nixosModules.default + ../machines/vm + # import vm module { time.timeZone = "Europe/Berlin"; i18n.defaultLocale = "en_US.UTF-8"; diff --git a/flake-modules/home-modules.nix b/flake-modules/home-modules.nix index 8d8ca71..54e348b 100644 --- a/flake-modules/home-modules.nix +++ b/flake-modules/home-modules.nix @@ -1,7 +1,4 @@ { self, inputs, ... }: -let - modules = ../modules; -in { # FIXME(25.05): this version of HM should have the flake module # imports = [ inputs.home-manager.flakeModules.home-manager ]; @@ -11,7 +8,7 @@ in defaultModules = [ inputs.nixvim.homeManagerModules.nixvim self.nixvimModules.homeManager - (modules + "/hm") + ../module/hm ]; nixos = { imports = defaultModules; diff --git a/flake-modules/nixos-modules.nix b/flake-modules/nixos-modules.nix index 41bd64f..ef8355e 100644 --- a/flake-modules/nixos-modules.nix +++ b/flake-modules/nixos-modules.nix @@ -4,9 +4,6 @@ lib, ... }: -let - modules = ../modules; -in { flake.nixosModules = let @@ -14,7 +11,7 @@ in imports = [ inputs.stylix.nixosModules.stylix inputs.home-manager.nixosModules.home-manager - (modules + "/nixos") + ../modules/nixos ] ++ lib.optional (inputs.lix-module != null) inputs.lix-module.nixosModules.default; home-manager = { useGlobalPkgs = true; @@ -24,20 +21,9 @@ in # Pin nixpkgs nix.registry.nixpkgs.flake = inputs.nixpkgs; }; - - machines = [ "vm" ]; - mkMachine = hostname: { - imports = [ - nixosModule - (import (../machines + "/${hostname}")) - ]; - home-manager.sharedModules = [ { jhome.hostName = hostname; } ]; - }; - machineModules = lib.genAttrs machines mkMachine; in { default = nixosModule; inherit nixosModule; - } - // machineModules; + }; } diff --git a/flake-modules/nixvim-modules.nix b/flake-modules/nixvim-modules.nix index 9841d46..1f8a395 100644 --- a/flake-modules/nixvim-modules.nix +++ b/flake-modules/nixvim-modules.nix @@ -1,7 +1,4 @@ { self, inputs, ... }: -let - modules = ../modules; -in { imports = [ inputs.nixvim.flakeModules.default ]; @@ -10,10 +7,14 @@ in checks.enable = false; # FIXME: borked due to nix-community/nixvim#3074 }; - flake.nixvimModules = { - standalone = modules + "/nixvim/standalone.nix"; - homeManager = modules + "/nixvim"; - }; + flake.nixvimModules = + let + module = ../modules/nixvim; + in + { + standalone = "${module}/standalone.nix"; + homeManager = module; + }; perSystem = { system, ... }: