diff options
| author | seth <[email protected]> | 2023-04-22 19:25:00 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-04-22 19:25:00 -0400 |
| commit | bf4df962be338c08ae41bed94b1d60b2930fca9f (patch) | |
| tree | f42900fb78196fbc2411c5517784904e793390b7 /flake.nix | |
| parent | 7980ebcbb8d555820eae724f68d7054cf8496e98 (diff) | |
feat(flake): remove flake-utils and nixpkgs stable as inputs
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 67 |
1 files changed, 35 insertions, 32 deletions
@@ -2,52 +2,55 @@ description = "getchoo's personal website"; inputs = { - nixpkgs.url = "nixpkgs/nixos-22.11"; - nixpkgsUnstable.url = "nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; + nixpkgs.url = "nixpkgs/nixos-unstable"; pre-commit-hooks = { url = "github:cachix/pre-commit-hooks.nix"; inputs.nixpkgs-stable.follows = "nixpkgs"; - inputs.nixpkgs.follows = "nixpkgsUnstable"; - inputs.flake-utils.follows = "flake-utils"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, - nixpkgsUnstable, - flake-utils, + nixpkgs, pre-commit-hooks, ... - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgsUnstable {inherit system;}; - in { - checks = { - pre-commit-check = pre-commit-hooks.lib.${system}.run { - src = ./.; - hooks = { - alejandra.enable = true; - prettier.enable = true; - editorconfig-checker.enable = true; - }; + }: let + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + forAllSystems = nixpkgs.lib.genAttrs systems; + nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;}); + in { + checks = forAllSystems (system: { + pre-commit-check = pre-commit-hooks.lib.${system}.run { + src = ./.; + hooks = { + alejandra.enable = true; + prettier.enable = true; + editorconfig-checker.enable = true; }; }; + }); - devShells = let - inherit (pkgs) mkShell; + devShells = forAllSystems (system: let + pkgs = nixpkgsFor.${system}; + inherit (pkgs) mkShell; + in { + default = mkShell { inherit (self.checks.${system}.pre-commit-check) shellHook; - in { - default = mkShell { - inherit shellHook; - packages = with pkgs; [ - alejandra - deno - fzf - just - nodePackages.prettier - ]; - }; + packages = with pkgs; [ + alejandra + deno + fzf + just + nodePackages.prettier + ]; }; }); + }; } |
