From 71f56d9f05e126ece43e0da4cdfd5934222c3e38 Mon Sep 17 00:00:00 2001 From: tommturbo <tommturbo@systemli.org> Date: Wed, 11 Dec 2024 22:28:45 +0100 Subject: [PATCH] Add nix files for a dev shell --- .envrc | 1 + flake.lock | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 27 +++++++++++++++++++ 3 files changed, 105 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 0000000..f160003 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake . --impure --offline diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..493fab0 --- /dev/null +++ b/flake.lock @@ -0,0 +1,77 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1733581040, + "narHash": "sha256-Qn3nPMSopRQJgmvHzVqPcE3I03zJyl8cSbgnnltfFDY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "22c3f2cf41a0e70184334a958e6b124fb0ce3e01", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1728538411, + "narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b69de56fac8c2b6f8fd27f2eca01dcda8e0a4221", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..6591297 --- /dev/null +++ b/flake.nix @@ -0,0 +1,27 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + + outputs = { self, nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + buildDependencies = with pkgs; [ + go + ]; + packageDependencies = with pkgs; [ + ]; + devDependencies = with pkgs; [ + gopls + ]; + in with pkgs; { + devShells.default = mkShell rec { + buildInputs = buildDependencies ++ packageDependencies ++ devDependencies; + + LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}"; + }; + }); +} -- GitLab