diff --git a/README.org b/README.org index d415dc4..54dd36d 100644 --- a/README.org +++ b/README.org @@ -1,18 +1,27 @@ -# nichts +* nichts +This is my personal collection of NixOS configuration files, made to be simple to understand and *sane*. +** Goals of this configuraton +This projects pursues some main goals: +1. +** Layout of this configuraton +This configuraton is split up into *three* important parts: +- hosts + The configuraton for my different host systems. +- modules -My personal collection of NixOS configuration files +- parts -# License +* License GNU GPL3 -# credits +* credits -This configuration was made possible through the help of some amazing people! +This configuration was only made possible through the help of some amazing people! Below are all the repositories I took inspiration from, check them out! ``` -*heavily* inspired by https://git.jacekpoz.pl/jacekpoz/niksos.git ! +Jacekpoz: https://git.jacekpoz.pl/jacekpoz/niksos.git ! Dragyx: https://github.com/dragyx/nichts Sioodmy: https://github.com/sioodmy/dotfiles Heinrik Lissner: https://github.com/hlissner/dotfiles/ diff --git a/hosts/default.nix b/hosts/default.nix index 72ec2f0..74cb26f 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -5,24 +5,34 @@ }: let inherit (inputs.self) lib; inherit (lib.extendedLib.builders) mkSystem; + inherit (lib.extendedLib.modules) mkModuleTree'; + inherit (lib.lists) concatLists flatten singleton; + + mkModulesFor = hostname: + flatten ( + concatLists [ + # Derive host specific module path from the first argument of the + # function. Should be a string, obviously. + (singleton ./vali/${hostname}/default.nix) + + + # Recursively import all module trees (i.e. directories with a `module.nix`) + # for given moduleTree directories, and in addition, roles. + (mkModuleTree' {path = ../modules;}) + ] + ); in { flake.nixosConfigurations = { temperance = mkSystem { inherit withSystem; system = "x86_64-linux"; - modules = [ - ./vali/temperance - ../modules - ]; + modules = mkModulesFor "temperance"; }; hermit = mkSystem { inherit withSystem; system = "x86_64-linux"; - modules = [ - ./vali/hermit - ../modules - ]; + modules = mkModulesFor "hermit"; }; }; } diff --git a/modules/options/default.nix b/modules/options/module.nix similarity index 100% rename from modules/options/default.nix rename to modules/options/module.nix diff --git a/modules/other/default.nix b/modules/other/module.nix similarity index 100% rename from modules/other/default.nix rename to modules/other/module.nix diff --git a/modules/programs/cli/default.nix b/modules/programs/cli/module.nix similarity index 100% rename from modules/programs/cli/default.nix rename to modules/programs/cli/module.nix diff --git a/modules/programs/editors/emacs/module.nix b/modules/programs/editors/emacs/module.nix index d13d263..b3b2fe3 100644 --- a/modules/programs/editors/emacs/module.nix +++ b/modules/programs/editors/emacs/module.nix @@ -91,7 +91,10 @@ in { config = mkIf cfg.enable { home-manager.users.${username} = { - home.packages = [custom-emacs]; + home.packages = with pkgs; [ + custom-emacs + clang-tools + ]; services.emacs = { enable = true; diff --git a/modules/programs/gui/default.nix b/modules/programs/gui/module.nix similarity index 100% rename from modules/programs/gui/default.nix rename to modules/programs/gui/module.nix diff --git a/modules/services/default.nix b/modules/services/module.nix similarity index 100% rename from modules/services/default.nix rename to modules/services/module.nix diff --git a/modules/style/module.nix b/modules/style/module.nix index 07ae4be..78d9dde 100644 --- a/modules/style/module.nix +++ b/modules/style/module.nix @@ -3,6 +3,7 @@ inherit (config.modules.other.system) username; in { home-manager.users.${username} = { + imports = [./default.nix]; home.pointerCursor = { # inherit the default values set in the options, # since these are the once I need on all my systems. diff --git a/modules/system/boot/grub-boot.nix b/modules/system/boot/module.nix similarity index 100% rename from modules/system/boot/grub-boot.nix rename to modules/system/boot/module.nix diff --git a/modules/system/hardware/default.nix b/modules/system/hardware/default.nix deleted file mode 100644 index 76470ec..0000000 --- a/modules/system/hardware/default.nix +++ /dev/null @@ -1 +0,0 @@ -_: {imports = [./bluetooth.nix ./graphics.nix];} diff --git a/modules/system/hardware/module.nix b/modules/system/hardware/module.nix index e69de29..76470ec 100644 --- a/modules/system/hardware/module.nix +++ b/modules/system/hardware/module.nix @@ -0,0 +1 @@ +_: {imports = [./bluetooth.nix ./graphics.nix];} diff --git a/parts/lib/builders.nix b/parts/lib/builders.nix index fb47e03..b422084 100644 --- a/parts/lib/builders.nix +++ b/parts/lib/builders.nix @@ -5,8 +5,8 @@ }: let inherit (inputs) self; inherit (lib) mkDefault nixosSystem recursiveUpdate; - inherit (lib.lists) singleton concatLists flatten; - inherit (lib.extendedLib.modules) mkModuleTree'; + inherit (lib.lists) singleton concatLists; + mkSystem = { withSystem, system, @@ -41,18 +41,6 @@ ]; } ); - mkModulesForSystem = { - hostname, - modulePath ? ./modules, - ... - } @ args: - flatten ( - concatLists [ - (self.outPath + ./.) - (mkModuleTree' {path = self.outPath + modulePath;}) - # singleton - ] - ); in { - inherit mkSystem mkModulesForSystem; + inherit mkSystem; }