From 729bbab9d554567366b30cbc24e91070e131fc04 Mon Sep 17 00:00:00 2001 From: spl3g Date: Tue, 11 Mar 2025 21:46:29 +0300 Subject: Ready. Set. Go! --- .envrc | 1 + flake.lock | 25 +++++++++++++++++++++++++ flake.nix | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 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..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b2c4970 --- /dev/null +++ b/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1741173522, + "narHash": "sha256-k7VSqvv0r1r53nUI/IfPHCppkUAddeXn843YlAC5DR0=", + "rev": "d69ab0d71b22fa1ce3dbeff666e6deb4917db049", + "revCount": 762848, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.762848%2Brev-d69ab0d71b22fa1ce3dbeff666e6deb4917db049/0195698a-02df-791f-8cd3-d10c16d442f0/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..7bb23bb --- /dev/null +++ b/flake.nix @@ -0,0 +1,44 @@ +{ + description = "An empty flake template that you can adapt to your own environment"; + + # Flake inputs + inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; + + # Flake outputs + outputs = { self, nixpkgs }: + let + # The systems supported for this flake + supportedSystems = [ + "x86_64-linux" # 64-bit Intel/AMD Linux + "aarch64-linux" # 64-bit ARM Linux + "x86_64-darwin" # 64-bit Intel macOS + "aarch64-darwin" # 64-bit ARM macOS + ]; + + # Helper to provide system-specific attributes + forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { + pkgs = import nixpkgs { inherit system; }; + }); + in + { + devShells = forEachSupportedSystem ({ pkgs }: { + default = pkgs.mkShell { + # The Nix packages provided in the environment + # Add any you need here + packages = with pkgs; [ + gcc + stdenv.cc + man-pages + gdb + ]; + + # Set any environment variables for your dev shell + env = { }; + + # Add any shell logic you want executed any time the environment is activated + shellHook = '' + ''; + }; + }); + }; +} -- cgit v1.2.3