Skip to content

Commit

Permalink
feat: add checks to devShell
Browse files Browse the repository at this point in the history
  • Loading branch information
Swarsel committed Dec 11, 2024
1 parent 647a2ae commit 80a23fc
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 14 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
21 changes: 17 additions & 4 deletions SwarselSystems.org
Original file line number Diff line number Diff line change
Expand Up @@ -684,16 +684,29 @@ In this section I am creating some attributes that define general concepts of my
homeManagerModules = import ./modules/home;

packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; });
devShells = forEachSystem
(pkgs:
devShells = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
checks = self.checks.${system};
in
{
default = pkgs.mkShell {
NIX_CONFIG = "experimental-features = nix-command flakes";
nativeBuildInputs = [ pkgs.nix pkgs.home-manager pkgs.git ];
inherit (checks.pre-commit-check) shellHook;
buildInputs = checks.pre-commit-check.enabledPackages;
nativeBuildInputs = [
pkgs.nix
pkgs.home-manager
pkgs.git
pkgs.just
pkgs.age
pkgs.ssh-to-age
pkgs.sops
];
};
});

# this sets the formatter that is going to be used by nix fmt
formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt);
checks = forAllSystems (
system:
Expand Down
34 changes: 24 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,30 @@
homeManagerModules = import ./modules/home;

packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; });
devShells = forEachSystem
(pkgs:
{
default = pkgs.mkShell {
NIX_CONFIG = "experimental-features = nix-command flakes";
nativeBuildInputs = [ pkgs.nix pkgs.home-manager pkgs.git ];
};
});

# this sets the formatter that is going to be used by nix fmt
devShells = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
checks = self.checks.${system};
in
{
default = pkgs.mkShell {
NIX_CONFIG = "experimental-features = nix-command flakes";
inherit (checks.pre-commit-check) shellHook;
buildInputs = checks.pre-commit-check.enabledPackages;
nativeBuildInputs = [
pkgs.nix
pkgs.home-manager
pkgs.git
pkgs.just
pkgs.age
pkgs.ssh-to-age
pkgs.sops
];
};
}
);

formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt);
checks = forAllSystems (
system:
Expand Down

0 comments on commit 80a23fc

Please sign in to comment.