Skip to content

Commit 61fcccb

Browse files
ttrssrealAtkinsSJ
authored andcommitted
Flake: Add and run formatter + Rename devshell
Add a formatter output to the flake (`nix fmt`), along with moving + renaming the devshell so it will work by running `nix-shell` in the root of the project.
1 parent 6969d1e commit 61fcccb

File tree

4 files changed

+50
-34
lines changed

4 files changed

+50
-34
lines changed

Documentation/BuildInstructionsLadybird.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ nix develop
114114
nix develop --command bash
115115

116116
# Using nix-shell
117-
nix-shell UI
117+
nix-shell
118118

119119
# Using nix-shell and a custom shell
120-
nix-shell UI --command bash
120+
nix-shell --command bash
121121
```
122122

123123
Then invoke `cmake` directly. For example:

flake.lock

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,24 @@
33

44
inputs = {
55
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6-
utils.url = "github:numtide/flake-utils";
6+
flake-utils.url = "github:numtide/flake-utils";
77
};
88

9-
outputs = { self, nixpkgs, utils, }: utils.lib.eachDefaultSystem (system: let
10-
pkgs = import nixpkgs { inherit system; };
11-
in {
12-
devShells.default = import ./UI { inherit pkgs; };
13-
});
9+
outputs =
10+
{
11+
nixpkgs,
12+
flake-utils,
13+
...
14+
}:
15+
flake-utils.lib.eachDefaultSystem (
16+
system:
17+
let
18+
pkgs = nixpkgs.legacyPackages.${system};
19+
in
20+
{
21+
devShells.default = import ./shell.nix { inherit pkgs; };
22+
23+
formatter = pkgs.nixfmt-rfc-style;
24+
}
25+
);
1426
}

UI/default.nix renamed to shell.nix

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
{ pkgs ? import <nixpkgs> { } }:
1+
{
2+
pkgs ? import <nixpkgs> { },
3+
}:
24

35
pkgs.mkShell {
4-
packages = with pkgs; [
5-
ccache
6-
] ++ (with qt6Packages; [
6+
inputsFrom = [
7+
pkgs.ladybird
8+
];
9+
10+
packages = with pkgs.qt6Packages; [
711
qtbase.dev
812
qttools
913
qtwayland.dev
10-
]);
1114

12-
inputsFrom = [ pkgs.ladybird ];
15+
pkgs.ccache
16+
];
1317

1418
shellHook = ''
1519
# NOTE: This is required to make it find the wayland platform plugin installed

0 commit comments

Comments
 (0)