Skip to content

Commit 65d6d5e

Browse files
committed
refactor: (std) update format
1 parent 5d8d05c commit 65d6d5e

37 files changed

+925
-1159
lines changed

flake.nix

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,43 @@
11
{
22
inputs = {
33
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
4+
nixpkgs-julia.url = "github:NixOS/nixpkgs/?ref=refs/pull/225513/head";
45
call-flake.url = "github:divnix/call-flake";
56
};
6-
outputs = inputs: let
7-
std = inputs.call-flake ./nix/std;
7+
outputs =
8+
inputs:
9+
let
10+
std = inputs.call-flake ./nix/std;
811
eachSystem = inputs.nixpkgs.lib.genAttrs [
912
"x86_64-linux"
1013
"x86_64-darwin"
1114
"aarch64-linux"
1215
"aarch64-darwin"
1316
];
14-
in (eachSystem (system: std.${system})) // {
15-
inherit (std) lib packages devShells overlays;
16-
templates = {
17-
devshell = {
18-
description = "The devshell template which contains several Julia Packages";
19-
path = ./templates/dev;
17+
src = std.inputs.omnibus.inputs.flops.haumea.pops.default.setInit {
18+
load = {
19+
src = ./nix/src;
20+
inputs = std.inputs // inputs;
21+
};
2022
};
21-
jlrs = {
22-
description = "The tempalte which contains jlrs development of Nix";
23-
path = ./templates/jlrs;
23+
in
24+
(eachSystem (system: std.${system}))
25+
// {
26+
inherit (std)
27+
lib
28+
packages
29+
devShells
30+
overlays
31+
;
32+
templates = {
33+
devshell = {
34+
description = "The devshell template which contains several Julia Packages";
35+
path = ./templates/dev;
36+
};
37+
jlrs = {
38+
description = "The tempalte which contains jlrs development of Nix";
39+
path = ./templates/jlrs;
40+
};
2441
};
2542
};
26-
};
2743
}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
{
2-
inputs,
3-
cell,
4-
}: {
5-
}
1+
{ inputs, cell }: { }
File renamed without changes.
File renamed without changes.
Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
{
2-
inputs,
3-
cell,
4-
}: let
1+
{ inputs, cell }:
2+
let
53
inherit (inputs) nixpkgs;
64
l = inputs.nixpkgs.lib // builtins;
75
inherit (nixpkgs) stdenv;
@@ -26,24 +24,36 @@
2624
chmod +x $out/bin/*.jl
2725
'';
2826
package = cell.lib.julia-wrapped {
29-
makeWrapperArgs = [
30-
"--add-flags --compile=min"
31-
];
27+
makeWrapperArgs = [ "--add-flags --compile=min" ];
3228
};
3329
};
34-
in {
30+
configs =
31+
let
32+
inputs' = (inputs.omnibus.pops.flake.setSystem nixpkgs.system).inputs;
33+
in
34+
inputs.omnibus.pops.configs.addLoadExtender { load.inputs.inputs = inputs'; };
35+
inherit (configs.layouts.default) treefmt lefthook conform;
36+
in
37+
{
3538
inherit juliaFormatter;
3639

37-
# treefmt = std-data-collection.data.configs.treefmt {
38-
# data.formatter.prettier = {
39-
# excludes = ["Manifest.toml" "Project.toml" "generated.json" "julia2nix.toml"];
40-
# };
41-
# data.formatter.nix = {
42-
# excludes = ["generated.nix"];
43-
# };
44-
# data.formatter.julia = l.mkIf stdenv.isLinux {
45-
# command = "${juliaFormatter}/bin/format.jl";
46-
# includes = ["*.jl"];
47-
# };
48-
# };
40+
treefmt = treefmt // {
41+
custom = {
42+
data.formatter.prettier = {
43+
excludes = [
44+
"Manifest.toml"
45+
"Project.toml"
46+
"generated.json"
47+
"julia2nix.toml"
48+
];
49+
};
50+
data.formatter.nix = {
51+
excludes = [ "generated.nix" ];
52+
};
53+
data.formatter.julia = l.mkIf stdenv.isLinux {
54+
command = "${juliaFormatter}/bin/format.jl";
55+
includes = [ "*.jl" ];
56+
};
57+
};
58+
};
4959
}
File renamed without changes.
File renamed without changes.

nix/std/cells/julia2nix/devshellProfiles/checks.nix

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1+
{ inputs, cell }:
12
{
2-
inputs,
3-
cell,
4-
}: {
53
config,
64
lib,
75
pkgs,
86
...
9-
}: {
7+
}:
8+
{
109
commands = [
1110
{
1211
name = "checks-GR";

nix/std/cells/julia2nix/devshellProfiles/default.nix

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
{ inputs, cell }@args:
2+
let
3+
in
14
{
2-
inputs,
3-
cell,
4-
} @ args: let
5-
in {
65
packages = import ./packages.nix args;
76
checks = import ./checks.nix args;
87
dev = import ./dev.nix args;

nix/std/cells/julia2nix/devshellProfiles/dev.nix

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1+
{ inputs, cell }:
12
{
2-
inputs,
3-
cell,
4-
}: {
53
config,
64
lib,
75
pkgs,
86
...
9-
}: {
7+
}:
8+
{
109
commands = lib.optionals pkgs.stdenv.buildPlatform.isLinux [
1110
{
1211
name = "jlfmt";
1312
category = "dev";
1413
help = "Julia formatter";
1514
command = ''
16-
${cell.nixago.juliaFormatter}/bin/format.jl "$@"
15+
${cell.configs.juliaFormatter}/bin/format.jl "$@"
1716
'';
1817
}
1918
];

0 commit comments

Comments
 (0)