From f7a5d8f823528073b98af12506cec777f841a719 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 5 Nov 2024 22:24:03 +0100 Subject: [PATCH] add dev shell flake --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 25 +++++++++++++++++++++++++ shell.nix | 1 + 3 files changed, 53 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..0f7109b --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1730327045, + "narHash": "sha256-xKel5kd1AbExymxoIfQ7pgcX6hjw9jCgbiBjiUfSVJ8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "080166c15633801df010977d9d7474b4a6c549d7", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "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 0000000..cbf3848 --- /dev/null +++ b/flake.nix @@ -0,0 +1,25 @@ +{ + description = "Dev shell flake for servicepoint-tanks"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05"; + }; + + outputs = + { self, nixpkgs }: + let + lib = nixpkgs.lib; + forAllSystems = lib.genAttrs lib.systems.flakeExposed; + in + { + devShells = forAllSystems (system: { + default = import ./shell.nix { + inherit nixpkgs; + pkgs = nixpkgs.legacyPackages."${system}"; + lib = nixpkgs.lib; + }; + }); + + formatter = forAllSystems (system: nixpkgs.legacyPackages."${system}".nixfmt-rfc-style); + }; +} diff --git a/shell.nix b/shell.nix index 3cd7d81..868fe17 100644 --- a/shell.nix +++ b/shell.nix @@ -1,5 +1,6 @@ { pkgs ? import { }, + ... }: let rust-toolchain = pkgs.symlinkJoin {