From 7a6b801e335cdbde5f34f75fd940dcc443df575e Mon Sep 17 00:00:00 2001 From: iFargle Date: Wed, 23 Aug 2023 16:53:29 +0900 Subject: [PATCH] Test --- lib/default.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 lib/default.nix diff --git a/lib/default.nix b/lib/default.nix new file mode 100644 index 00000000..8f2d642d --- /dev/null +++ b/lib/default.nix @@ -0,0 +1,29 @@ +{ inputs, outputs, stateVersion, ... }: { + # Helper function for generating home-manager configs + mkHome = { hostname, username, desktop ? null, platform ? "x86_64-linux" }: inputs.home-manager.lib.homeManagerConfiguration { + pkgs = inputs.nixpkgs.legacyPackages.${platform}; + extraSpecialArgs = { + inherit inputs outputs desktop hostname platform username stateVersion; + }; + modules = [ ../home-manager ]; + }; + + # Helper function for generating host configs + mkHost = { hostname, username, desktop ? null, installer ? null }: inputs.nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs outputs desktop hostname username stateVersion; + }; + modules = [ + ../nixos + inputs.agenix.nixosModules.default + ] ++ (inputs.nixpkgs.lib.optionals (installer != null) [ installer ]); + }; + + forAllSystems = inputs.nixpkgs.lib.genAttrs [ + "aarch64-linux" + "i686-linux" + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; +} \ No newline at end of file