Skip to content

Commit

Permalink
Merge pull request #806 from kachick/drop-flake-utils
Browse files Browse the repository at this point in the history
Inline systems in flake schema and drop flake-utils
  • Loading branch information
kachick committed May 16, 2024
2 parents b48e03c + a5a9109 commit d1a9b6d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 78 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.

105 changes: 61 additions & 44 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,60 +7,77 @@
# - `nix flake update --commit-lock-file` # https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake-update.html
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
edge-nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs =
{
self,
nixpkgs,
edge-nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
edge-pkgs = edge-nixpkgs.legacyPackages.${system};
in
{
formatter = edge-pkgs.nixfmt-rfc-style;
devShells.default =
with pkgs;
mkShell {
buildInputs = [
# For Nix environments
# https://github.com/NixOS/nix/issues/730#issuecomment-162323824
bashInteractive
nil
edge-pkgs.nixfmt-rfc-style
let
# Candidates: https://github.com/NixOS/nixpkgs/blob/release-23.11/lib/systems/flake-systems.nix
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
# I don't have M1+ mac, providing this for macos-14 free runner https://github.com/actions/runner-images/issues/9741
"aarch64-darwin"
];
in
{
formatter = forAllSystems (system: edge-nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
devShells = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
edge-pkgs = edge-nixpkgs.legacyPackages.${system};
in
{
default =
with pkgs;
mkShell {
buildInputs = [
# For Nix environments
# https://github.com/NixOS/nix/issues/730#issuecomment-162323824
bashInteractive
nil
edge-pkgs.nixfmt-rfc-style

cargo-make
sd
cargo-make
sd

edge-pkgs.nodejs_20
edge-pkgs.nodejs_20.pkgs.pnpm
edge-pkgs.deno
edge-pkgs.dprint
edge-pkgs.typos
edge-pkgs.nodejs_20
edge-pkgs.nodejs_20.pkgs.pnpm
edge-pkgs.deno
edge-pkgs.dprint
edge-pkgs.typos

# Helper for writing and linting actions
#
# NOTE: Do NOT add actionlint as a dependency
# - It does not target actions; it lints the user's side.
# - It assumes major actions in a stable state, often causing problems between versions.
# - Use https://github.com/github/vscode-github-actions for a better solution to get hints.
edge-pkgs.pinact
# Helper for writing and linting actions
#
# NOTE: Do NOT add actionlint as a dependency
# - It does not target actions; it lints the user's side.
# - It assumes major actions in a stable state, often causing problems between versions.
# - Use https://github.com/github/vscode-github-actions for a better solution to get hints.
edge-pkgs.pinact

# For fighting the GitHub API
gh
jq
edge-pkgs.jnv
gitleaks
];
};
# For fighting the GitHub API
gh
jq
edge-pkgs.jnv
gitleaks
];
};
}
);

apps = {
apps = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
edge-pkgs = edge-nixpkgs.legacyPackages.${system};
in
{
bump-nix-dependencies = {
type = "app";
program =
Expand Down Expand Up @@ -91,7 +108,7 @@
};
});
};
};
}
);
}
);
};
}

0 comments on commit d1a9b6d

Please sign in to comment.