summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2023-04-22 19:25:00 -0400
committerseth <[email protected]>2023-04-22 19:25:00 -0400
commitbf4df962be338c08ae41bed94b1d60b2930fca9f (patch)
treef42900fb78196fbc2411c5517784904e793390b7 /flake.nix
parent7980ebcbb8d555820eae724f68d7054cf8496e98 (diff)
feat(flake): remove flake-utils and nixpkgs stable as inputs
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix67
1 files changed, 35 insertions, 32 deletions
diff --git a/flake.nix b/flake.nix
index df5bdb1..36f765c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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
+ ];
};
});
+ };
}