mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
switch to treefmt module
This commit is contained in:
parent
319912f5f2
commit
c70834ccb9
4 changed files with 66 additions and 48 deletions
|
|
@ -46,7 +46,7 @@ details {
|
||||||
}
|
}
|
||||||
|
|
||||||
&[open] summary:before {
|
&[open] summary:before {
|
||||||
@include arrow(45deg);
|
@include arrow(45deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-container {
|
.table-container {
|
||||||
|
|
@ -59,7 +59,8 @@ details {
|
||||||
width: calc(100% - 1px);
|
width: calc(100% - 1px);
|
||||||
}
|
}
|
||||||
|
|
||||||
table, tbody {
|
table,
|
||||||
|
tbody {
|
||||||
// fill entire width
|
// fill entire width
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
|
|
||||||
|
|
@ -101,13 +102,13 @@ aside.book-menu span {
|
||||||
.source {
|
.source {
|
||||||
position: relative;
|
position: relative;
|
||||||
.filename {
|
.filename {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0px;
|
right: 0px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
line-height: 0;
|
line-height: 0;
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
color: #d8dee9;
|
color: #d8dee9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -115,4 +116,4 @@ aside.book-menu span {
|
||||||
.listing {
|
.listing {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
37
flake.lock
generated
37
flake.lock
generated
|
|
@ -50,11 +50,28 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1680945546,
|
||||||
|
"narHash": "sha256-8FuaH5t/aVi/pR1XxnF0qi4WwMYC+YxlfdsA0V+TEuQ=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "d9f759f2ea8d265d974a6e1259bd510ac5844c5d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs",
|
||||||
|
"treefmt": "treefmt"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
|
|
@ -71,6 +88,24 @@
|
||||||
"repo": "default",
|
"repo": "default",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"treefmt": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1688026376,
|
||||||
|
"narHash": "sha256-qJmkr9BWDpqblk4E9/rCsAEl39y2n4Ycw6KRopvpUcY=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"rev": "df3f32b0cc253dfc7009b7317e8f0e7ccd70b1cf",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
||||||
28
flake.nix
28
flake.nix
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
treefmt.url = "github:numtide/treefmt-nix";
|
||||||
flake-utils = {
|
flake-utils = {
|
||||||
url = "github:numtide/flake-utils";
|
url = "github:numtide/flake-utils";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
@ -63,14 +64,6 @@
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
# formatters
|
|
||||||
alejandra
|
|
||||||
black
|
|
||||||
nodePackages.prettier
|
|
||||||
nodePackages.prettier-plugin-toml
|
|
||||||
shfmt
|
|
||||||
treefmt
|
|
||||||
|
|
||||||
# extra tools
|
# extra tools
|
||||||
dive
|
dive
|
||||||
fd
|
fd
|
||||||
|
|
@ -91,7 +84,24 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
formatter = pkgs.treefmt;
|
formatter =
|
||||||
|
(inputs.treefmt.lib.evalModule pkgs {
|
||||||
|
projectRootFile = "flake.nix";
|
||||||
|
programs = {
|
||||||
|
alejandra.enable = true;
|
||||||
|
black.enable = true;
|
||||||
|
prettier.enable = true;
|
||||||
|
shfmt.enable = true;
|
||||||
|
};
|
||||||
|
settings.global.excludes = [
|
||||||
|
"docs/themes/*"
|
||||||
|
"docs/layouts/*"
|
||||||
|
"modules/generated/*"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
.config
|
||||||
|
.build
|
||||||
|
.wrapper;
|
||||||
|
|
||||||
apps = {
|
apps = {
|
||||||
docs = inputs.flake-utils.lib.mkApp {
|
docs = inputs.flake-utils.lib.mkApp {
|
||||||
|
|
|
||||||
28
treefmt.toml
28
treefmt.toml
|
|
@ -1,28 +0,0 @@
|
||||||
[global]
|
|
||||||
excludes = ["./docs/themes/*"]
|
|
||||||
|
|
||||||
[formatter.nix]
|
|
||||||
command = "alejandra"
|
|
||||||
includes = ["*.nix"]
|
|
||||||
excludes = ["./modules/generated/*"]
|
|
||||||
|
|
||||||
[formatter.prettier]
|
|
||||||
command = "prettier"
|
|
||||||
options = ["--plugin", "prettier-plugin-toml", "--write"]
|
|
||||||
includes = ["*.md", "*.yaml", "*.toml", "*.json"]
|
|
||||||
excludes = []
|
|
||||||
|
|
||||||
[formatter.black]
|
|
||||||
command = "black"
|
|
||||||
includes = ["*.py"]
|
|
||||||
|
|
||||||
[formatter.shell]
|
|
||||||
command = "shfmt"
|
|
||||||
options = [
|
|
||||||
"-i",
|
|
||||||
"2", # indent 2
|
|
||||||
"-s", # simplify the code
|
|
||||||
"-w", # write back to the file
|
|
||||||
|
|
||||||
]
|
|
||||||
includes = ["*.sh", "*.bash"]
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue