Skip to content

Commit

Permalink
Remove flake-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
aidalgol committed Sep 11, 2023
1 parent 940ff23 commit 2033f99
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 90 deletions.
34 changes: 0 additions & 34 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

117 changes: 61 additions & 56 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,68 +1,73 @@
{
description = "Nix fether for Steam games";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
flake-utils.url = "github:numtide/flake-utils";
};
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";

outputs = {
self,
nixpkgs,
flake-utils,
}:
with flake-utils.lib;
}: let
# DepotDownloader only supports x86_64 Linux.
eachSystem ["x86_64-linux"] (system: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [self.overlays.default];
};
supportedSystems = ["x86_64-linux"];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgsFor = system:
import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [self.overlays.default];
};
lintersFor = system: let
pkgs = pkgsFor system;
in
with pkgs; [
alejandra
statix
shellcheck
shfmt
];
in {
devShells = forAllSystems (system: let
pkgs = pkgsFor system;
in {
default = pkgs.mkShell {
packages = with pkgs;
[
nil # Nix LS
nodePackages.bash-language-server
]
++ (lintersFor system);
};
});

linters = with pkgs; [
alejandra
statix
shellcheck
shfmt
];
in {
devShells = {
default = pkgs.mkShell {
packages = with pkgs;
[
nil # Nix LS
nodePackages.bash-language-server
]
++ linters;
};
};
checks = forAllSystems (system: let
pkgs = pkgsFor system;
in
builtins.mapAttrs (name: pkgs.runCommandLocal name {nativeBuildInputs = lintersFor system;}) {
alejandra = "alejandra --check ${./.} > $out";
shellcheck = "shellcheck $(${pkgs.shfmt}/bin/shfmt --find ${./.}) > $out";
shfmt = "shfmt --simplify --diff ${./.} > $out";
statix = "statix check ${./.} > $out";
}
// {
inherit (pkgs) steamworks-sdk-redist;
});

checks =
builtins.mapAttrs (name: pkgs.runCommandLocal name {nativeBuildInputs = linters;}) {
alejandra = "alejandra --check ${./.} > $out";
shellcheck = "shellcheck $(${pkgs.shfmt}/bin/shfmt --find ${./.}) > $out";
shfmt = "shfmt --simplify --diff ${./.} > $out";
statix = "statix check ${./.} > $out";
}
// {
inherit (pkgs) steamworks-sdk-redist;
};
formatter = forAllSystems (system: let
pkgs = pkgsFor system;
in
pkgs.writeShellApplication {
name = "fmt";
runtimeInputs = lintersFor system;
text = ''
alejandra --quiet .
statix fix .
shfmt --simplify --write .
'';
});

formatter = pkgs.writeShellApplication {
name = "fmt";
runtimeInputs = linters;
text = ''
alejandra --quiet .
statix fix .
shfmt --simplify --write .
'';
};
})
// {
overlays.default = final: prev: {
fetchSteam = final.callPackage ./fetch-steam {};
steamworks-sdk-redist = final.callPackage ./steamworks-sdk-redist {};
};
};
overlays.default = final: prev: {
fetchSteam = final.callPackage ./fetch-steam {};
steamworks-sdk-redist = final.callPackage ./steamworks-sdk-redist {};
};
};
}

0 comments on commit 2033f99

Please sign in to comment.