Skip to content

Commit

Permalink
nix: nixfmt and cleanup old shell.nix
Browse files Browse the repository at this point in the history
Signed-off-by: Élyse Viard <[email protected]>
  • Loading branch information
ElysaSrc committed Oct 29, 2024
1 parent 2c173fa commit 47eefea
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 158 deletions.
81 changes: 1 addition & 80 deletions flake.lock

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

113 changes: 57 additions & 56 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,23 @@
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
alejandra = {
url = "github:kamadorueda/alejandra/3.0.0";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = {
nixpkgs,
fenix,
flake-utils,
alejandra,
...
}:
outputs =
{
nixpkgs,
fenix,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system: let
system:
let
pkgs = import nixpkgs {
inherit system;
};

pythonPackages = ps: (import ./nix/python_env.nix {inherit ps;});
pythonPackages = ps: (import ./nix/python_env.nix { inherit ps; });

fixedNode = pkgs.nodejs_20;
fixedNodePackages = pkgs.nodePackages.override {
Expand All @@ -45,57 +42,61 @@
"rust-analyzer"
];

osrd-dev-scripts = pkgs.callPackage ./nix/scripts.nix {};
osrd-dev-scripts = pkgs.callPackage ./nix/scripts.nix { };
in
with pkgs; {
devShells.default = mkShell {
nativeBuildInputs = [
# Rust
rustChan
# Linker
mold-wrapped
# Libs
geos
openssl
pkg-config
postgresql
];
buildInputs =
[
# Tools & Libs
diesel-cli
cargo-watch
osmium-tool
taplo
with pkgs;
{
devShells.default = mkShell {
nativeBuildInputs = [
# Rust
rustChan
# Linker
mold-wrapped
# Libs
geos
openssl
pkg-config
postgresql
];
buildInputs =
[
# Tools & Libs
diesel-cli
cargo-watch
osmium-tool
taplo

# API
(python311.withPackages pythonPackages)
ruff-lsp
# API
(python311.withPackages pythonPackages)
ruff-lsp

# Core
gradle
jdk17
# Core
gradle
jdk17

# Front
fixedNodePackages.create-react-app
fixedNodePackages.eslint
fixedNodePackages.yarn
fixedNode
# Front
fixedNodePackages.create-react-app
fixedNodePackages.eslint
fixedNodePackages.yarn
fixedNode

# Nix formatter
alejandra.defaultPackage.${system}
nixd
# Nix formatter
nixfmt-rfc-style
nixd

# OSRD dev scripts
osrd-dev-scripts
]
++ lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
# OSRD dev scripts
osrd-dev-scripts
]
++ lib.optionals stdenv.isDarwin (
with pkgs.darwin.apple_sdk.frameworks;
[
CoreFoundation
SystemConfiguration
]);
]
);

RUSTFLAGS = "-C link-arg=-fuse-ld=mold";
};
}
RUSTFLAGS = "-C link-arg=-fuse-ld=mold";
};
}
);
}
4 changes: 2 additions & 2 deletions nix/geojson-pydantic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ buildPythonPackage rec {

doCheck = false;

propagatedBuildInputs = [pydantic];
propagatedBuildInputs = [ pydantic ];

meta = with lib; {
maintainers = with maintainers; [flomonster];
maintainers = with maintainers; [ flomonster ];
description = "GeoJson support for pydantic";
};
}
2 changes: 1 addition & 1 deletion nix/kdtree.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildPythonPackage rec {
doCheck = false;

meta = with lib; {
maintainers = with maintainers; [flomonster];
maintainers = with maintainers; [ flomonster ];
description = "Kdtree";
};
}
10 changes: 6 additions & 4 deletions nix/python_env.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{ps}: let
{ ps }:
let
kdTree = ./kdtree.nix;
geojsonPydantic = ./geojson-pydantic.nix;
in [
in
[
ps.black
ps.flake8
ps.intervaltree
Expand All @@ -14,8 +16,8 @@ in [
ps.pyyaml
ps.requests
ps.websockets
(ps.callPackage (import kdTree) {})
(ps.callPackage (import geojsonPydantic) {inherit (ps) pydantic;})
(ps.callPackage (import kdTree) { })
(ps.callPackage (import geojsonPydantic) { inherit (ps) pydantic; })

# DATA SCIENCE
ps.ipykernel
Expand Down
2 changes: 1 addition & 1 deletion nix/scripts.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{stdenv}:
{ stdenv }:
stdenv.mkDerivation {
name = "osrd-dev-scripts";
src = ../scripts;
Expand Down
14 changes: 0 additions & 14 deletions shell.nix

This file was deleted.

0 comments on commit 47eefea

Please sign in to comment.