From afca6977a36c575143ea635e4ca8aeedecc23b24 Mon Sep 17 00:00:00 2001 From: DJ O'Leary Date: Thu, 6 Mar 2025 02:44:25 +0100 Subject: feat: Replace Go shell with flake --- 2023/Go/.envrc | 2 +- 2023/Go/flake.lock | 27 +++++++++++++++++++++++++++ 2023/Go/flake.nix | 28 ++++++++++++++++++++++++++++ 2023/Go/shell.nix | 17 ----------------- 4 files changed, 56 insertions(+), 18 deletions(-) create mode 100644 2023/Go/flake.lock create mode 100644 2023/Go/flake.nix delete mode 100644 2023/Go/shell.nix (limited to '2023/Go') diff --git a/2023/Go/.envrc b/2023/Go/.envrc index 0a722d7..3550a30 100644 --- a/2023/Go/.envrc +++ b/2023/Go/.envrc @@ -1 +1 @@ -use nix; +use flake diff --git a/2023/Go/flake.lock b/2023/Go/flake.lock new file mode 100644 index 0000000..b7695d9 --- /dev/null +++ b/2023/Go/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1741010256, + "narHash": "sha256-WZNlK/KX7Sni0RyqLSqLPbK8k08Kq7H7RijPJbq9KHM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ba487dbc9d04e0634c64e3b1f0d25839a0a68246", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/2023/Go/flake.nix b/2023/Go/flake.nix new file mode 100644 index 0000000..39dda89 --- /dev/null +++ b/2023/Go/flake.nix @@ -0,0 +1,28 @@ +{ + description = "Advent of Code 2023: Go"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + }; + + outputs = + { nixpkgs, ... }: + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + in + { + devShells.x86_64-linux.default = pkgs.mkShell { + # build tools + nativeBuildInputs = with pkgs; [ + go + ]; + # dependencies + buildInputs = with pkgs; [ + delve + gopls + gotools + golangci-lint + ]; + }; + }; +} diff --git a/2023/Go/shell.nix b/2023/Go/shell.nix deleted file mode 100644 index 9573d44..0000000 --- a/2023/Go/shell.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - pkgs ? import { }, -}: - -pkgs.mkShell { - # build tools - nativeBuildInputs = with pkgs; [ - go - ]; - # dependencies - buildInputs = with pkgs; [ - delve - gopls - gotools - golangci-lint - ]; -} -- cgit v1.2.3