diff --git a/flake.nix b/flake.nix index 9a52ff9..5658b43 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,7 @@ greynix = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./base.nix + ./nixosModules/base.nix ./hosts/greynix/configuration.nix home-manager.nixosModules.home-manager @@ -32,8 +32,9 @@ bluenix = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./base.nix + ./nixosModules/base.nix ./hosts/bluenix/configuration.nix + ./nixosModules/docker.nix home-manager.nixosModules.home-manager { @@ -52,7 +53,7 @@ aspirenix = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./base.nix + ./nixosModules/base.nix ./hosts/aspirenix/configuration.nix home-manager.nixosModules.home-manager diff --git a/hosts/greynix/configuration.nix b/hosts/greynix/configuration.nix index 4e6243a..20c62c9 100644 --- a/hosts/greynix/configuration.nix +++ b/hosts/greynix/configuration.nix @@ -10,8 +10,13 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ../../nixosModules/base.nix + ../../nixosModules/modules.nix ]; + # Enable/Disable Modules + dockerModule.enable = true; + boot.initrd.luks.devices."luks-880424d4-ac69-44cf-aa3b-99a224128551".device = "/dev/disk/by-uuid/880424d4-ac69-44cf-aa3b-99a224128551"; networking.hostName = "greynix"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. diff --git a/base.nix b/nixosModules/base.nix similarity index 96% rename from base.nix rename to nixosModules/base.nix index 170ab44..c84ccc1 100644 --- a/base.nix +++ b/nixosModules/base.nix @@ -1,17 +1,18 @@ -{ config, lib, pkgs, ... }: +{ pkgs, config, lib ... }: { imports = - [ # I do imports in flakes + [ ./gnome.nix ./systemd.nix ./fonts.nix - #module test - ./nixosModules/docker.nix + ./systemd.nix + ./fonts.nix ]; + # DELETE LATER # Enable/Disable Modules - dockerModule.enable = true; + #dockerModule.enable = true; # Bootloader. boot.loader.systemd-boot.enable = true; diff --git a/nixosModules/docker.nix b/nixosModules/docker.nix index 728d936..a01a970 100644 --- a/nixosModules/docker.nix +++ b/nixosModules/docker.nix @@ -1,24 +1,12 @@ { pkgs, lib, config, ... }: # enable docker -# not all systems need this { - options = { - dockerModule.enable = - lib.mkEnableOption "enables Docker Module"; - }; - - config = lib.mkIf config.dockerModule.enable { - # Enable Docker virtualisation.docker = { enable = true; autoPrune = { enable = true; }; - }; - - }; - } diff --git a/fonts.nix b/nixosModules/fonts.nix similarity index 100% rename from fonts.nix rename to nixosModules/fonts.nix diff --git a/gnome.nix b/nixosModules/gnome.nix similarity index 100% rename from gnome.nix rename to nixosModules/gnome.nix diff --git a/nixosModules/module-docker.nix b/nixosModules/module-docker.nix new file mode 100644 index 0000000..728d936 --- /dev/null +++ b/nixosModules/module-docker.nix @@ -0,0 +1,24 @@ +{ pkgs, lib, config, ... }: +# enable docker +# not all systems need this + +{ + + options = { + dockerModule.enable = + lib.mkEnableOption "enables Docker Module"; + }; + + config = lib.mkIf config.dockerModule.enable { + + # Enable Docker + virtualisation.docker = { + enable = true; + autoPrune = { + enable = true; + }; + }; + + }; + +} diff --git a/nixosModules/module-modules.nix b/nixosModules/module-modules.nix new file mode 100644 index 0000000..69f4244 --- /dev/null +++ b/nixosModules/module-modules.nix @@ -0,0 +1,17 @@ +{ pkgs, lib, ... }: +# nix file for all modules + +{ + + imports = [ + ./docker.nix + #./systemd.nix + #./gnome.nix + #./fonts.nix + ]; + + # all modules default to true + dockerModule.enable = lib.mkDefault false; + + +} diff --git a/systemd.nix b/nixosModules/systemd.nix similarity index 100% rename from systemd.nix rename to nixosModules/systemd.nix