diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 8132cf8..52adf0f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -12,3 +12,6 @@ jobs: - uses: "DeterminateSystems/magic-nix-cache-action@main" - name: Flake check run: nix develop --command check + - name: Check formatting + run: | + git ls-files '*.nix' | nix develop --command xargs nixpkgs-fmt --check diff --git a/c-cpp/flake.nix b/c-cpp/flake.nix index 15e740a..9d3b016 100644 --- a/c-cpp/flake.nix +++ b/c-cpp/flake.nix @@ -12,24 +12,25 @@ in { devShells = forEachSupportedSystem ({ pkgs }: { - default = pkgs.mkShell.override { - # Override stdenv in order to change compiler: - # stdenv = pkgs.clangStdenv; - } - { - packages = with pkgs; [ - clang-tools - cmake - codespell - conan - cppcheck - doxygen - gtest - lcov - vcpkg - vcpkg-tool - ] ++ (if system == "aarch64-darwin" then [ ] else [ gdb ]); - }; + default = pkgs.mkShell.override + { + # Override stdenv in order to change compiler: + # stdenv = pkgs.clangStdenv; + } + { + packages = with pkgs; [ + clang-tools + cmake + codespell + conan + cppcheck + doxygen + gtest + lcov + vcpkg + vcpkg-tool + ] ++ (if system == "aarch64-darwin" then [ ] else [ gdb ]); + }; }); }; } diff --git a/elixir/flake.lock b/elixir/flake.lock index f694c77..6add7d4 100644 --- a/elixir/flake.lock +++ b/elixir/flake.lock @@ -1,23 +1,5 @@ { "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1719075281, @@ -34,24 +16,8 @@ }, "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", diff --git a/elixir/flake.nix b/elixir/flake.nix index 6b248cd..aa48cc1 100644 --- a/elixir/flake.nix +++ b/elixir/flake.nix @@ -1,22 +1,20 @@ { description = "A Nix-flake-based Elixir development environment"; - inputs = { - nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; - - flake-utils = { - url = "github:numtide/flake-utils"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = - { self, nixpkgs, flake-utils }: - flake-utils.lib.eachDefaultSystem ( - system: - let - pkgs = nixpkgs.legacyPackages.${system}; - + inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; + + outputs = { self, nixpkgs }: + let + supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; + forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { + pkgs = import nixpkgs { + inherit system; + overlays = [ self.overlays.default ]; + }; + }); + in + { + overlays.default = final: prev: rec { # documentation # https://nixos.org/manual/nixpkgs/stable/#sec-beam @@ -26,7 +24,7 @@ # erlang = pkgs.beam.interpreters.erlang; # use latest version of Erlang 27 - erlang = pkgs.beam.interpreters.erlang_27; + erlang = final.beam.interpreters.erlang_27; # specify exact version of Erlang OTP # erlang = pkgs.beam.interpreters.erlang.override { @@ -37,7 +35,7 @@ # ==== BEAM packages ==== # all BEAM packages will be compile with your preferred erlang version - pkgs-beam = pkgs.beam.packagesWith erlang; + pkgs-beam = final.beam.packagesWith erlang; # ==== Elixir ==== @@ -52,49 +50,35 @@ # version = "1.17.1"; # sha256 = "sha256-a7A+426uuo3bUjggkglY1lqHmSbZNpjPaFpQUXYtW9k="; # }; - - in - { - devShells.default = pkgs.mkShell { - packages = - [ - # use the Elixr/OTP versions defined above; will also install OTP, mix, hex, rebar3 - elixir - - # mix needs it for downloading dependencies - pkgs.git - - # probably needed for your Phoenix assets - pkgs.nodejs_20 - ] - ++ - # Linux only - pkgs.lib.optionals pkgs.stdenv.isLinux ( - with pkgs; - [ - gigalixir - inotify-tools - libnotify - ] - ) - ++ - # macOS only - pkgs.lib.optionals pkgs.stdenv.isDarwin ( - with pkgs; - [ - terminal-notifier - darwin.apple_sdk.frameworks.CoreFoundation - darwin.apple_sdk.frameworks.CoreServices - ] - ); - - # some sane defaults for iex session - env = { - ERL_INCLUDE_PATH = "${erlang}/lib/erlang/usr/include"; - ERL_AFLAGS = "+pc unicode -kernel shell_history enabled"; - ELIXIR_ERL_OPTIONS = "+sssdio 128"; - }; + }; + + devShells = forEachSupportedSystem ({ pkgs }: { + default = pkgs.mkShell { + packages = with pkgs; [ + # use the Elixr/OTP versions defined above; will also install OTP, mix, hex, rebar3 + elixir + + # mix needs it for downloading dependencies + git + + # probably needed for your Phoenix assets + nodejs_20 + ] + ++ + # Linux only + pkgs.lib.optionals pkgs.stdenv.isLinux (with pkgs; [ + gigalixir + inotify-tools + libnotify + ]) + ++ + # macOS only + pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [ + terminal-notifier + darwin.apple_sdk.frameworks.CoreFoundation + darwin.apple_sdk.frameworks.CoreServices + ]); }; - } - ); + }); + }; } diff --git a/python/flake.nix b/python/flake.nix index c995e07..7f585d2 100644 --- a/python/flake.nix +++ b/python/flake.nix @@ -15,9 +15,9 @@ default = pkgs.mkShell { venvDir = ".venv"; packages = with pkgs; [ python311 ] ++ - (with pkgs.python311Packages; [ + (with pkgs.python311Packages; [ pip - venvShellHook + venvShellHook ]); }; }); diff --git a/r/flake.nix b/r/flake.nix index da334ef..d18de98 100644 --- a/r/flake.nix +++ b/r/flake.nix @@ -21,7 +21,8 @@ devShells = forEachSupportedSystem ({ pkgs }: { default = pkgs.mkShell { packages = with pkgs; - [ rEnv + [ + rEnv pandoc texlive.combined.scheme-full ];