Skip to content

Commit

Permalink
Inline systems in flake schema and drop flake-utils (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick authored May 16, 2024
1 parent f734cc4 commit 8a09762
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 66 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.

74 changes: 42 additions & 32 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,55 @@
# - `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
{
# Q. Why nixfmt? Not nixpkgs-fmt and alejandra?
# A. nixfmt will be official
# - https://github.com/NixOS/nixfmt/issues/153
# - https://github.com/NixOS/nixfmt/issues/129
# - https://github.com/NixOS/rfcs/pull/166
formatter = edge-pkgs.nixfmt-rfc-style;
devShells.default =
with pkgs;
mkShell {
buildInputs = [
# https://github.com/NixOS/nix/issues/730#issuecomment-162323824
# https://github.com/kachick/dotfiles/pull/228
bashInteractive
findutils # xargs
edge-pkgs.nixfmt-rfc-style
nil
go-task
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
{
# Q. Why nixfmt? Not nixpkgs-fmt and alejandra?
# A. nixfmt will be official
# - https://github.com/NixOS/nixfmt/issues/153
# - https://github.com/NixOS/nixfmt/issues/129
# - https://github.com/NixOS/rfcs/pull/166
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 = [
# https://github.com/NixOS/nix/issues/730#issuecomment-162323824
# https://github.com/kachick/dotfiles/pull/228
bashInteractive
findutils # xargs
edge-pkgs.nixfmt-rfc-style
nil
go-task

edge-pkgs.dprint
edge-pkgs.typos
];
};
}
);
edge-pkgs.dprint
edge-pkgs.typos
];
};
}
);
};
}

0 comments on commit 8a09762

Please sign in to comment.