Skip to content

Commit

Permalink
Reformat all Nix files and remove flake-utils from Elixir template
Browse files Browse the repository at this point in the history
  • Loading branch information
lucperkins committed Jun 24, 2024
1 parent ce200ec commit 2827802
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 117 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
37 changes: 19 additions & 18 deletions c-cpp/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]);
};
});
};
}
Expand Down
34 changes: 0 additions & 34 deletions elixir/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

108 changes: 46 additions & 62 deletions elixir/flake.nix
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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 {
Expand All @@ -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 ====

Expand All @@ -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
]);
};
}
);
});
};
}
4 changes: 2 additions & 2 deletions python/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
default = pkgs.mkShell {
venvDir = ".venv";
packages = with pkgs; [ python311 ] ++
(with pkgs.python311Packages; [
(with pkgs.python311Packages; [
pip
venvShellHook
venvShellHook
]);
};
});
Expand Down
3 changes: 2 additions & 1 deletion r/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs;
[ rEnv
[
rEnv
pandoc
texlive.combined.scheme-full
];
Expand Down

0 comments on commit 2827802

Please sign in to comment.