diff options
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 35 |
1 files changed, 24 insertions, 11 deletions
@@ -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 |