Skip to content

Commit

Permalink
Flake: Add and run formatter + Rename devshell
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ttrssreal authored and AtkinsSJ committed Dec 18, 2024
1 parent 6969d1e commit 61fcccb
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 34 deletions.
4 changes: 2 additions & 2 deletions Documentation/BuildInstructionsLadybird.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ nix develop
nix develop --command bash

# Using nix-shell
nix-shell UI
nix-shell

# Using nix-shell and a custom shell
nix-shell UI --command bash
nix-shell --command bash
```

Then invoke `cmake` directly. For example:
Expand Down
40 changes: 20 additions & 20 deletions flake.lock

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

24 changes: 18 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,24 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, utils, }: utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs { inherit system; };
in {
devShells.default = import ./UI { inherit pkgs; };
});
outputs =
{
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = import ./shell.nix { inherit pkgs; };

formatter = pkgs.nixfmt-rfc-style;
}
);
}
16 changes: 10 additions & 6 deletions UI/default.nix → shell.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{ pkgs ? import <nixpkgs> { } }:
{
pkgs ? import <nixpkgs> { },
}:

pkgs.mkShell {
packages = with pkgs; [
ccache
] ++ (with qt6Packages; [
inputsFrom = [
pkgs.ladybird
];

packages = with pkgs.qt6Packages; [
qtbase.dev
qttools
qtwayland.dev
]);

inputsFrom = [ pkgs.ladybird ];
pkgs.ccache
];

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

0 comments on commit 61fcccb

Please sign in to comment.