diff options
author | Silas Schöffel <sils@sils.li> | 2024-05-16 18:18:04 +0200 |
---|---|---|
committer | Silas Schöffel <sils@sils.li> | 2024-05-16 18:18:04 +0200 |
commit | 352cebb75205454cc07c58c747c62207b566bbeb (patch) | |
tree | 5bb8b57489645b98faf5b92b7dd78cf094f17310 | |
parent | gpg: use ccid instead of pcscd (diff) | |
download | nix-config-352cebb75205454cc07c58c747c62207b566bbeb.tar.gz nix-config-352cebb75205454cc07c58c747c62207b566bbeb.zip |
flake: switch to flake-parts
-rw-r--r-- | flake.nix | 125 | ||||
-rw-r--r-- | flake/nixosConfigurations/default.nix | 1 |
2 files changed, 66 insertions, 60 deletions
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 + ; + }; }; }; } diff --git a/flake/nixosConfigurations/default.nix b/flake/nixosConfigurations/default.nix index b303335..3d97e63 100644 --- a/flake/nixosConfigurations/default.nix +++ b/flake/nixosConfigurations/default.nix @@ -11,7 +11,6 @@ wl-togglescreens, stylix, sops-nix, - flake-utils, agenix, ragenix, arkenfox-user-js, |