Skip to content

Commit

Permalink
style(nix): specify formatter in flake.nix; apply formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
errfrom authored and pddshk committed Jul 6, 2023
1 parent 4b453f2 commit 98c3f9e
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
extra-substituters = [ "https://cache.zw3rk.com" ];
extra-trusted-public-keys = [ "loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk=" ];

bash-prompt = "\\[\\e[0m\\][\\[\\e[0;2m\\]nix-develop \\[\\e[0;1m\\]gtk-chess@\\[\\033[33m\\]$(git rev-parse --abbrev-ref HEAD) \\[\\e[0;32m\\]\\w\\[\\e[0m\\]]\\[\\e[0m\\]$ \\[\\e[0m\\]";
bash-prompt = "\\[\\e[0m\\][\\[\\e[0;2m\\]nix-develop \\[\\e[0;1m\\]gtk-chess@\\[\\033[33m\\]$(git rev-parse --abbrev-ref HEAD) \\[\\e[0;32m\\]\\w\\[\\e[0m\\]]\\[\\e[0m\\]$ \\[\\e[0m\\]";
};

inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=22.11";
nixpkgs.url = "github:nixos/nixpkgs?ref=22.11";
};

outputs = { self, nixpkgs }:
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" ];
perSystem = nixpkgs.lib.genAttrs supportedSystems;
allNixpkgs = perSystem (system: import nixpkgs { inherit system; });
nixpkgsFor = system: allNixpkgs.${system};

nativeBuildInputs = perSystem (system:
nativeBuildInputs = perSystem (system:
with nixpkgsFor system; [ clang gnumake pkg-config which libxml2 ]
);

Expand All @@ -30,11 +30,12 @@
inputsCombined = perSystem (system:
nativeBuildInputs.${system} ++ buildInputs.${system}
);
in {
defaultPackage = perSystem (system: self.packages.${system}.gtkChess);

in
{
defaultPackage = perSystem (system: self.packages.${system}.gtkChess);

packages = perSystem (system:
with nixpkgsFor system; {
with nixpkgsFor system; {
gtkChess = stdenv.mkDerivation {
name = "GTK-Chess";
version = "dev";
Expand All @@ -48,11 +49,14 @@
);

devShells = perSystem (system: {
default =
default =
with nixpkgsFor system; mkShell {
buildInputs = [ cppcheck ] ++ inputsCombined.${system};
buildInputs = [ cppcheck ] ++ inputsCombined.${system};
};
}
});

formatter = perSystem (system:
nixpkgs.legacyPackages.${system}.nixpkgs-fmt
);
};
}

0 comments on commit 98c3f9e

Please sign in to comment.