diff --git a/modules/attrs/desktop/default.nix b/modules/attrs/desktop/default.nix new file mode 100644 index 0000000..c6f97fe --- /dev/null +++ b/modules/attrs/desktop/default.nix @@ -0,0 +1,18 @@ +{ + moduleWithSystem, + self, + ... +}: { + flake.nixosModules.desktop = moduleWithSystem ({pkgs, ...}: let + modules = with self.nixosModules; [ + core + networking + ]; + in { + imports = modules; + + environment.systemPackages = with pkgs; [ + lazygit + ]; + }); +} diff --git a/modules/features/example/bashrc b/modules/features/bash/bashrc similarity index 100% rename from modules/features/example/bashrc rename to modules/features/bash/bashrc diff --git a/modules/features/example/default.nix b/modules/features/bash/default.nix similarity index 100% rename from modules/features/example/default.nix rename to modules/features/bash/default.nix diff --git a/modules/hosts/host/default.nix b/modules/hosts/host/default.nix index 1f0f1f0..a095abc 100644 --- a/modules/hosts/host/default.nix +++ b/modules/hosts/host/default.nix @@ -9,7 +9,7 @@ # Define modules to import modules = with self.nixosModules; [ hostConfiguration - system + desktop ]; }; } diff --git a/modules/hosts/newHost/newHost.nix b/modules/hosts/newHost/default.nix similarity index 97% rename from modules/hosts/newHost/newHost.nix rename to modules/hosts/newHost/default.nix index 6b71324..9d0a066 100644 --- a/modules/hosts/newHost/newHost.nix +++ b/modules/hosts/newHost/default.nix @@ -9,7 +9,7 @@ # Define modules to import modules = with self.nixosModules; [ newHostConfiguration - system + desktop zsh # Change config options in this object diff --git a/modules/system/_hardware-configuration.nix b/modules/system/core/_hardware-configuration.nix similarity index 100% rename from modules/system/_hardware-configuration.nix rename to modules/system/core/_hardware-configuration.nix diff --git a/modules/system/bootloader.nix b/modules/system/core/bootloader.nix similarity index 100% rename from modules/system/bootloader.nix rename to modules/system/core/bootloader.nix diff --git a/modules/system/core/default.nix b/modules/system/core/default.nix new file mode 100644 index 0000000..14805fd --- /dev/null +++ b/modules/system/core/default.nix @@ -0,0 +1,25 @@ +{self, ...}: { + # This module acts as a collection of other modules, for ease + # of use. Adding another module to this list will import it + # for all other modules that import this one. + + # Keep in mind that you cannot import this module alongside + # any of its children. For example, importing this module and + # the user module in the same block is the same as importing + # the user module twice, leading to an error due to trying + # to define the same user twice. + + # Collections should be used for static lists of modules, like + # those that would make up a basic system, as seen here. + + # Define flake part nixosModule "core" + flake.nixosModules.core = {...}: let + modules = with self.nixosModules; [ + user + bootloader + imports + ]; + in { + imports = modules; + }; +} diff --git a/modules/system/imports.nix b/modules/system/core/imports.nix similarity index 100% rename from modules/system/imports.nix rename to modules/system/core/imports.nix diff --git a/modules/system/nix-settings.nix b/modules/system/core/nix-settings.nix similarity index 100% rename from modules/system/nix-settings.nix rename to modules/system/core/nix-settings.nix diff --git a/modules/system/user.nix b/modules/system/core/user.nix similarity index 100% rename from modules/system/user.nix rename to modules/system/core/user.nix diff --git a/modules/system/default.nix b/modules/system/default.nix deleted file mode 100644 index 2f4cf66..0000000 --- a/modules/system/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{self, ...}: { - # This module acts as a collection of other modules, for ease - # of use. Adding another module to this list will import it - # for all other modules that import this one. - - # Keep in mind that you cannot import this module alongside - # any of its children. For example, importing this module and - # the user module in the same block is the same as importing - # the user module twice, leading to an error due to trying - # to define the same user twice. - - # Collections should be used for static lists of modules, like - # those that would make up a basic system, as seen here. - - # Define flake part nixosModule "system" - flake.nixosModules.system = {...}: let - modules = with self.nixosModules; [ - user - networking - bootloader - imports - ]; - in { - imports = modules; - }; -} diff --git a/modules/system/networking.nix b/modules/system/networking/default.nix similarity index 100% rename from modules/system/networking.nix rename to modules/system/networking/default.nix