From 352cebb75205454cc07c58c747c62207b566bbeb Mon Sep 17 00:00:00 2001 From: Silas Schöffel Date: Thu, 16 May 2024 18:18:04 +0200 Subject: flake: switch to flake-parts --- flake.nix | 125 +++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 66 insertions(+), 59 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index f1012f1..62c2b67 100644 --- a/flake.nix +++ b/flake.nix @@ -179,78 +179,85 @@ wl-togglescreens, stylix, sops-nix, - flake-utils, + flake-parts, agenix, ragenix, git-hooks, arkenfox-user-js, + systems, ... - } @ attrs: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs { - inherit system; - overlays = [nixvim.overlays.default]; - }; - nixVimConfig = - (import ./hm/nixvim/config.nix pkgs) - // { - colorschemes.gruvbox.enable = true; - plugins.airline.settings.theme = "minimalist"; + } @ inputs: + flake-parts.lib.mkFlake {inherit inputs;} { + systems = import systems; + perSystem = { + config, + system, + ... + }: let + pkgs = import nixpkgs { + inherit system; + overlays = [nixvim.overlays.default]; + }; + nixVimConfig = + (import ./hm/nixvim/config.nix pkgs) + // { + colorschemes.gruvbox.enable = true; + plugins.airline.settings.theme = "minimalist"; + }; + nvim = nixvim.legacyPackages."${system}".makeNixvim nixVimConfig; + hooks = self.checks.${system}.pre-commit; + in { + devShells.default = pkgs.mkShell { + inherit (hooks) shellHook; + buildInputs = hooks.enabledPackages; + packages = with pkgs; [ + nil + statix + alejandra + sops + ragenix.packages."${system}".default + ]; }; - nvim = nixvim.legacyPackages."${system}".makeNixvim nixVimConfig; - hooks = self.checks.${system}.pre-commit; - in { - devShells.default = pkgs.mkShell { - inherit (hooks) shellHook; - buildInputs = hooks.enabledPackages; - packages = with pkgs; [ - nil - statix - alejandra - sops - ragenix.packages."${system}".default - ]; - }; - formatter = pkgs.alejandra; + formatter = pkgs.alejandra; - packages = { - inherit nvim; - default = nvim; - }; - checks = { - nvim = nixvim.lib.${system}.check.mkTestDerivationFromNvim { + packages = { inherit nvim; - name = "My NixVim Configuration"; + default = nvim; }; - pre-commit = git-hooks.lib.${system}.run { - src = ./.; - hooks = { - alejandra.enable = true; + checks = { + nvim = nixvim.lib.${system}.check.mkTestDerivationFromNvim { + inherit nvim; + name = "My NixVim Configuration"; + }; + pre-commit = git-hooks.lib.${system}.run { + src = ./.; + hooks = { + alejandra.enable = true; + }; }; }; }; - }) - // { - nixosConfigurations = import ./flake/nixosConfigurations { - inherit - self - base16-tokyo-night-scheme - nixpkgs - nixpkgs-pinned - home-manager - prismlauncher - lanzaboote - nixvim - impermanence - wl-togglescreens - stylix - sops-nix - flake-utils - agenix - ragenix - arkenfox-user-js - ; + flake = { + nixosConfigurations = import ./flake/nixosConfigurations { + inherit + self + base16-tokyo-night-scheme + nixpkgs + nixpkgs-pinned + home-manager + prismlauncher + lanzaboote + nixvim + impermanence + wl-togglescreens + stylix + sops-nix + agenix + ragenix + arkenfox-user-js + ; + }; }; }; } -- cgit 1.4.1