From d0c6ffd1bef1660bb6f246d02bb7159f69b0863a Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Mon, 22 Sep 2025 07:57:16 +0200 Subject: [PATCH] feat(scala): Add flake --- scala/flake.lock | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ scala/flake.nix | 33 +++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 scala/flake.lock create mode 100644 scala/flake.nix diff --git a/scala/flake.lock b/scala/flake.lock new file mode 100644 index 0000000..c3e7d56 --- /dev/null +++ b/scala/flake.lock @@ -0,0 +1,64 @@ +{ + "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": 1755082269, + "narHash": "sha256-Ix7ALeaxv9tW4uBKWeJnaKpYZtZiX4H4Q/MhEmj4XYA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d74de548348c46cf25cb1fcc4b74f38103a4590d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "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/scala/flake.nix b/scala/flake.nix new file mode 100644 index 0000000..2ee14be --- /dev/null +++ b/scala/flake.nix @@ -0,0 +1,33 @@ +{ + description = "Scala shell"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + systems.url = "github:nix-systems/default"; + flake-utils = { + url = "github:numtide/flake-utils"; + inputs.systems.follows = "systems"; + }; + }; + + outputs = { nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + in { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + jdk + scala-next + scala-cli + + # You might want to use your own IDE. + (jetbrains.plugins.addPlugins jetbrains.idea-ultimate [ "github-copilot" ]) + ]; + }; + } + ); +}