From 3fc2c8d0c8c4a3c839fc12abad94ca83f4d21870 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 22 Apr 2023 12:07:54 +0200 Subject: Feat(flake): Modularize --- flake/default.nix | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 flake/default.nix (limited to 'flake/default.nix') diff --git a/flake/default.nix b/flake/default.nix new file mode 100644 index 00000000..c88bfe56 --- /dev/null +++ b/flake/default.nix @@ -0,0 +1,120 @@ +{ + # core + self, + pkgs, + system, + sysLib, + nixpkgs, + # modules + home-manager, + nixos-generators, + impermanence, + agenix, + ragenix, + # external dependencies + neovim_config, + user_js, + snap-sync, + templates, + # my binaries + video_pause, + strip_js_comments, + shell-library, + river_init_lesser, + yambar_memory, + yambar_cpu, + grades, +}: let + homeManagerConfig = { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.soispha = import ../home-manager; + extraSpecialArgs = { + inherit + pkgs + sysLib + # extra information + + system + # bins + + video_pause + yambar_cpu + yambar_memory + strip_js_comments + river_init_lesser + grades + shell-library + # external deps + + user_js + neovim_config + snap-sync + # modules + + impermanence + ; + }; + }; + }; + ageConfig = import ../secrets; + impermanenceConfig = import ../system/impermanence; + defaultModules = [ + agenix.nixosModules.default + ageConfig + + home-manager.nixosModules.home-manager + + homeManagerConfig + + impermanence.nixosModules.impermanence + impermanenceConfig + ]; + defaultSpecialArgs = { + nixpkgs-as-input = nixpkgs; + inherit templates sysLib; + }; +in { + nixosConfigurations = import ./nixosConfigurations { + inherit + system + pkgs + nixpkgs + sysLib + # configs + + defaultModules + defaultSpecialArgs + # bins + + video_pause + yambar_cpu + yambar_memory + strip_js_comments + river_init_lesser + grades + shell-library + # external deps + + user_js + neovim_config + snap-sync + templates + # modules + + impermanence + home-manager + agenix + ; + }; + packages."${system}" = import ./packages {inherit nixos-generators defaultSpecialArgs pkgs shell-library;}; + + apps."${system}" = import ./apps {inherit self system;}; + + devShells."${system}" = { + default = pkgs.mkShell { + packages = with pkgs; [nil alejandra statix ragenix.packages."${system}".default shellcheck ltex-ls]; + }; + }; +} -- cgit 1.4.1