summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix35
1 files changed, 24 insertions, 11 deletions
diff --git a/flake.nix b/flake.nix
index 978b184..931a6ea 100644
--- a/flake.nix
+++ b/flake.nix
@@ -30,28 +30,41 @@
};
};
+ lib = nixpkgs.lib;
+
+ orbekk-modules =
+ let
+ moduleFiles =
+ lib.attrNames (
+ lib.filterAttrs
+ (n: v: lib.hasSuffix ".nix" n && v == "regular")
+ (builtins.readDir ./modules));
+
+ moduleNames = map (lib.removeSuffix ".nix") moduleFiles;
+
+ mkModule = name: {
+ inherit name;
+ value = import (./. + "/modules/${name}.nix");
+ };
+ in lib.listToAttrs (map mkModule moduleNames);
+
in
{
- nixosModules = [
- pkgs-module
- ./modules/common.nix
- ./modules/desktop.nix
- ./modules/gaming.nix
- ./modules/thinkpad.nix
- ./modules/users.nix
- ./modules/yubikey.nix
- ];
+ nixosModules =
+ orbekk-modules // {
+ inherit pkgs-module;
+ };
nixosConfigurations = let
mkConfig = { hostName
, module ? (./. + "/machines/${hostName}.nix")
, system ? "x86_64-linux" }: {
name = hostName;
- value = nixpkgs.lib.nixosSystem {
+ value = lib.nixosSystem {
inherit system;
modules =
- self.nixosModules ++
+ (lib.attrValues self.nixosModules) ++
[
pkgs-module
module