From 75532c22ce97dee5a03ccf0f382b8bca3a3d5a9b Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Fri, 5 Apr 2024 12:51:39 +0900 Subject: [PATCH 1/2] Prefer stable nixpkgs for bash and basics in Nix Import https://github.com/kachick/anylang-template/pull/80 Personally resolves gh and home-manager version problem. Closes https://github.com/kachick/dotfiles/issues/549 --- flake.lock | 25 +++++++++++++++++++++---- flake.nix | 17 ++++++++++------- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/flake.lock b/flake.lock index 9ad311b8..a4e8c3e6 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "edge-nixpkgs": { + "locked": { + "lastModified": 1712163089, + "narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fd281bd6b7d3e32ddfa399853946f782553163b5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -20,22 +36,23 @@ }, "nixpkgs": { "locked": { - "lastModified": 1712163089, - "narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=", + "lastModified": 1712168706, + "narHash": "sha256-XP24tOobf6GGElMd0ux90FEBalUtw6NkBSVh/RlA6ik=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fd281bd6b7d3e32ddfa399853946f782553163b5", + "rev": "1487bdea619e4a7a53a4590c475deabb5a9d1bfb", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } }, "root": { "inputs": { + "edge-nixpkgs": "edge-nixpkgs", "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } diff --git a/flake.nix b/flake.nix index 5af4a2bc..66be2a1f 100644 --- a/flake.nix +++ b/flake.nix @@ -5,14 +5,16 @@ # - https://discourse.nixos.org/t/differences-between-nix-channels/13998 # How to update the revision # - `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-unstable"; + 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, 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 { devShells.default = with pkgs; @@ -24,12 +26,13 @@ nil nixpkgs-fmt - nodejs_20 - deno - dprint cargo-make - typos - actionlint + + edge-pkgs.nodejs_20 + edge-pkgs.deno + edge-pkgs.dprint + edge-pkgs.typos + edge-pkgs.actionlint # For fighting the GitHub API gh From 4023232a455ba3a70433e56699551b822604ab68 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Fri, 5 Apr 2024 12:54:40 +0900 Subject: [PATCH 2/2] Add some developer tools with Nix --- Makefile.toml | 4 ++++ flake.nix | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Makefile.toml b/Makefile.toml index cbcbe568..f754d630 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -72,6 +72,10 @@ script = [ # "nixpkgs-fmt --version", "actionlint --version", "typos --version", + "gh --version", + "jq --version", + "jnv --version", + "pinact --version", ] [tasks.check_no_git_diff] diff --git a/flake.nix b/flake.nix index 66be2a1f..2ed66e30 100644 --- a/flake.nix +++ b/flake.nix @@ -32,11 +32,15 @@ edge-pkgs.deno edge-pkgs.dprint edge-pkgs.typos + + # Helper for writing and linting actions edge-pkgs.actionlint + edge-pkgs.pinact # For fighting the GitHub API gh jq + edge-pkgs.jnv ]; }; });