From 25be0d06f448a9a82d7e147b19b5a64c96b5350f Mon Sep 17 00:00:00 2001 From: sstent Date: Wed, 1 Mar 2023 14:18:49 +0000 Subject: [PATCH] sync --- flake.nix | 22 ++++++++++++++----- home-manager/users/sstent/default.nix | 1 - modules/home-manager/default.nix | 7 ------ .../{ssh-proxy.nix => ssh-proxy/default.nix} | 0 modules/nixos/default.nix | 7 ------ modules/nixos/{ssh.nix => ssh/default.nix} | 0 6 files changed, 17 insertions(+), 20 deletions(-) delete mode 100644 modules/home-manager/default.nix rename modules/home-manager/{ssh-proxy.nix => ssh-proxy/default.nix} (100%) delete mode 100644 modules/nixos/default.nix rename modules/nixos/{ssh.nix => ssh/default.nix} (100%) diff --git a/flake.nix b/flake.nix index 9e6594a..a680804 100644 --- a/flake.nix +++ b/flake.nix @@ -62,9 +62,19 @@ packages = forEachPkgs (pkgs: import ./pkgs { inherit pkgs; }); devShells = forEachPkgs (pkgs: import ./shell.nix { inherit pkgs; }); overlays = import ./overlays { inherit inputs; }; - nixosModules = import ./modules/nixos; - homeManagerModules = import ./modules/home-manager; - + nixosModules = builtins.listToAttrs (map + (x: { + name = x; + value = import (./modules/nixos + "/${x}"); + }) + (builtins.attrNames (builtins.readDir ../modules/nixos))); + + homeManagerModules = builtins.listToAttrs (map + (name: { + inherit name; + value = import (./modules/home-manager + "/${name}"); + }) + (builtins.attrNames (builtins.readDir ./modules/home-manager))); # NixOS configuration entrypoint # Available through 'nixos-rebuild --flake .#your-hostname' @@ -73,12 +83,14 @@ specialArgs = { inherit inputs outputs; }; modules = [ ./hosts/WSL/Go3 + { imports = builtins.attrValues self.nixosModules; } ]; }; StuPC = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs outputs; }; modules = [ ./hosts/WSL/StuPC + { imports = builtins.attrValues self.nixosModules; } ]; }; @@ -95,7 +107,7 @@ # > Our main home-manager configuration file < ./home-manager/users/sstent inputs.sops-nix.homeManagerModules.sops - ]; + ]++ (builtins.attrValues self.homeManagerModules); }; "sstent@StuPC" = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance @@ -104,7 +116,7 @@ # > Our main home-manager configuration file < ./home-manager/users/sstent inputs.sops-nix.homeManagerModules.sops - ]; + ]++ (builtins.attrValues self.homeManagerModules); }; }; diff --git a/home-manager/users/sstent/default.nix b/home-manager/users/sstent/default.nix index cc02ed2..a8e3c27 100644 --- a/home-manager/users/sstent/default.nix +++ b/home-manager/users/sstent/default.nix @@ -53,7 +53,6 @@ # beets # qemu_kvm # nixos-generators - nixfmt nixpkgs-fmt # deploy-rs ]; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix deleted file mode 100644 index 09bb8e1..0000000 --- a/modules/home-manager/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module). -# These should be stuff you would like to share with others, not your personal configurations. - -{ - # List your module files here - ssh-proxy = import ./ssh-proxy.nix; -} diff --git a/modules/home-manager/ssh-proxy.nix b/modules/home-manager/ssh-proxy/default.nix similarity index 100% rename from modules/home-manager/ssh-proxy.nix rename to modules/home-manager/ssh-proxy/default.nix diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix deleted file mode 100644 index bec6184..0000000 --- a/modules/nixos/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module). -# These should be stuff you would like to share with others, not your personal configurations. - -{ - # List your module files here - # my-module = import ./my-module.nix; -} diff --git a/modules/nixos/ssh.nix b/modules/nixos/ssh/default.nix similarity index 100% rename from modules/nixos/ssh.nix rename to modules/nixos/ssh/default.nix