Skip to content

Commit

Permalink
Merge pull request #10 from redyf/dev
Browse files Browse the repository at this point in the history
feat: Add devshell + formatter for CI/CD
  • Loading branch information
redyf authored Jan 9, 2024
2 parents 2946491 + c9cd81a commit 1d6ab08
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@
NixOS-WSL,
spicetify-nix,
...
} @ inputs: {
} @ inputs: let
supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];

# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;

# Nixpkgs instantiated for supported system types.
nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;});
in {
nixosConfigurations = {
redyf =
nixpkgs.lib.nixosSystem
Expand Down Expand Up @@ -103,5 +111,18 @@
];
};
};
devShells = forAllSystems (system: let
pkgs = nixpkgsFor.${system};
in {
default = pkgs.mkShell {
buildInputs = with pkgs; [
git
nixpkgs-fmt
statix
];
};
});

formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
};
}

0 comments on commit 1d6ab08

Please sign in to comment.