From eff57943c9d8a4fbc2c2726c191f5bda94408e8b Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Sun, 1 Feb 2026 14:01:19 +0100 Subject: [PATCH 1/5] Add initial flake.nix; just for develop, for now (fixes#3577) --- .envrc | 1 + .gitignore | 3 +++ flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..3550a30f --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index fa381206..cd2047c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.direnv/ /target/ **/*.rs.bk @@ -12,3 +13,5 @@ /assets/completions/bat.zsh /assets/manual/bat.1 /assets/metadata.yaml + + diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..b8b992e7 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1769789167, + "narHash": "sha256-kKB3bqYJU5nzYeIROI82Ef9VtTbu4uA3YydSk/Bioa8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "62c8382960464ceb98ea593cb8321a2cf8f9e3e5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..262b2901 --- /dev/null +++ b/flake.nix @@ -0,0 +1,40 @@ +{ + description = "bat"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + outputs = + { self, ... }@inputs: + let + supportedSystems = [ + "x86_64-linux" # 64-bit Intel/AMD Linux + "aarch64-linux" # 64-bit ARM Linux + "aarch64-darwin" # 64-bit ARM macOS + ]; + + forEachSupportedSystem = + f: + inputs.nixpkgs.lib.genAttrs supportedSystems ( + system: + f { + inherit system; + pkgs = import inputs.nixpkgs { + inherit system; + config.allowUnfree = true; + }; + } + ); + in + { + devShells = forEachSupportedSystem ( + { pkgs, system }: + { + default = pkgs.mkShellNoCC { + packages = with pkgs; [ + cargo + ]; + }; + } + ); + }; +} From d19c80a7c10f33d175113cbf0c4435aeb71e5b47 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Sun, 1 Feb 2026 14:09:18 +0100 Subject: [PATCH 2/5] Remove allowUnfree = true from flake.nix Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- flake.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/flake.nix b/flake.nix index 262b2901..9afacc68 100644 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,6 @@ inherit system; pkgs = import inputs.nixpkgs { inherit system; - config.allowUnfree = true; }; } ); From 36b37e1aa56a82f16e174724206b035a7fafdf59 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Sun, 1 Feb 2026 14:11:05 +0100 Subject: [PATCH 3/5] Add x86_64-darwin (Intel macOS) to flake.nix --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 9afacc68..35c8cec1 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,7 @@ "x86_64-linux" # 64-bit Intel/AMD Linux "aarch64-linux" # 64-bit ARM Linux "aarch64-darwin" # 64-bit ARM macOS + "x86_64-darwin" # 64-bit Intel macOS ]; forEachSupportedSystem = From 2c682ff6a62b00ab88c454a3226f15df23526d35 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Sun, 1 Feb 2026 14:13:03 +0100 Subject: [PATCH 4/5] docs: Document flake.nix in CHANGELOG.md (see #3577) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9934329f..214b1754 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## Features +- Added an initial `flake.nix` for a ready made development environment; see #3577 (@vorburger) - Add `--quiet-empty` (`-E`) flag to suppress output when input is empty. Closes #1936, see #3563 (@NORMAL-EX) - Improve native man pages and command help syntax highlighting by stripping overstriking, see #3517 (@akirk) From 3f12b1c1ab247b18ec3778f34eca4fd636bf4944 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Sun, 1 Feb 2026 14:20:40 +0100 Subject: [PATCH 5/5] docs: Use PR not Issue ID in CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 214b1754..31e50d4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ## Features -- Added an initial `flake.nix` for a ready made development environment; see #3577 (@vorburger) +- Added an initial `flake.nix` for a ready made development environment; see #3578 (@vorburger) - Add `--quiet-empty` (`-E`) flag to suppress output when input is empty. Closes #1936, see #3563 (@NORMAL-EX) - Improve native man pages and command help syntax highlighting by stripping overstriking, see #3517 (@akirk)