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 | |
| parent | 7980ebcbb8d555820eae724f68d7054cf8496e98 (diff) | |
feat(flake): remove flake-utils and nixpkgs stable as inputs
| -rw-r--r-- | flake.lock | 53 | ||||
| -rw-r--r-- | flake.nix | 67 |
2 files changed, 61 insertions, 59 deletions
@@ -17,12 +17,15 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1678901627, - "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", "owner": "numtide", "repo": "flake-utils", - "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", "type": "github" }, "original": { @@ -54,26 +57,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1678972866, - "narHash": "sha256-YV8BcNWfNVgS449B6hFYFUg4kwVIQMNehZP+FNDs1LY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "cd34d6ed7ba7d5c4e44b04a53dc97edb52f2766c", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-22.11", - "type": "indirect" - } - }, - "nixpkgsUnstable": { - "locked": { - "lastModified": 1678898370, - "narHash": "sha256-xTICr1j+uat5hk9FyuPOFGxpWHdJRibwZC+ATi0RbtE=", + "lastModified": 1681920287, + "narHash": "sha256-+/d6XQQfhhXVfqfLROJoqj3TuG38CAeoT6jO1g9r1k0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ac718d02867a84b42522a0ece52d841188208f2c", + "rev": "645bc49f34fa8eff95479f0345ff57e55b53437e", "type": "github" }, "original": { @@ -85,12 +73,10 @@ "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": [ - "flake-utils" - ], + "flake-utils": "flake-utils", "gitignore": "gitignore", "nixpkgs": [ - "nixpkgsUnstable" + "nixpkgs" ], "nixpkgs-stable": [ "nixpkgs" @@ -112,11 +98,24 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", - "nixpkgsUnstable": "nixpkgsUnstable", "pre-commit-hooks": "pre-commit-hooks" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", @@ -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 + ]; }; }); + }; } |
