move to mkModuleTree for host configuration

This commit is contained in:
Charlie Root 2024-09-08 20:35:33 +02:00
commit 3c4bf8040c
13 changed files with 42 additions and 31 deletions

View file

@ -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 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! 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 Dragyx: https://github.com/dragyx/nichts
Sioodmy: https://github.com/sioodmy/dotfiles Sioodmy: https://github.com/sioodmy/dotfiles
Heinrik Lissner: https://github.com/hlissner/dotfiles/ Heinrik Lissner: https://github.com/hlissner/dotfiles/

View file

@ -5,24 +5,34 @@
}: let }: let
inherit (inputs.self) lib; inherit (inputs.self) lib;
inherit (lib.extendedLib.builders) mkSystem; 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 { in {
flake.nixosConfigurations = { flake.nixosConfigurations = {
temperance = mkSystem { temperance = mkSystem {
inherit withSystem; inherit withSystem;
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = mkModulesFor "temperance";
./vali/temperance
../modules
];
}; };
hermit = mkSystem { hermit = mkSystem {
inherit withSystem; inherit withSystem;
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = mkModulesFor "hermit";
./vali/hermit
../modules
];
}; };
}; };
} }

View file

@ -91,7 +91,10 @@
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
home-manager.users.${username} = { home-manager.users.${username} = {
home.packages = [custom-emacs]; home.packages = with pkgs; [
custom-emacs
clang-tools
];
services.emacs = { services.emacs = {
enable = true; enable = true;

View file

@ -3,6 +3,7 @@
inherit (config.modules.other.system) username; inherit (config.modules.other.system) username;
in { in {
home-manager.users.${username} = { home-manager.users.${username} = {
imports = [./default.nix];
home.pointerCursor = { home.pointerCursor = {
# inherit the default values set in the options, # inherit the default values set in the options,
# since these are the once I need on all my systems. # since these are the once I need on all my systems.

View file

@ -1 +0,0 @@
_: {imports = [./bluetooth.nix ./graphics.nix];}

View file

@ -0,0 +1 @@
_: {imports = [./bluetooth.nix ./graphics.nix];}

View file

@ -5,8 +5,8 @@
}: let }: let
inherit (inputs) self; inherit (inputs) self;
inherit (lib) mkDefault nixosSystem recursiveUpdate; inherit (lib) mkDefault nixosSystem recursiveUpdate;
inherit (lib.lists) singleton concatLists flatten; inherit (lib.lists) singleton concatLists;
inherit (lib.extendedLib.modules) mkModuleTree';
mkSystem = { mkSystem = {
withSystem, withSystem,
system, system,
@ -41,18 +41,6 @@
]; ];
} }
); );
mkModulesForSystem = {
hostname,
modulePath ? ./modules,
...
} @ args:
flatten (
concatLists [
(self.outPath + ./.)
(mkModuleTree' {path = self.outPath + modulePath;})
# singleton
]
);
in { in {
inherit mkSystem mkModulesForSystem; inherit mkSystem;
} }