Format with alejandra
This commit is contained in:
parent
c5efaa6024
commit
06ffebaddc
|
@ -4,14 +4,20 @@
|
|||
utils.url = "github:numtide/flake-utils";
|
||||
devshell.url = "github:numtide/devshell";
|
||||
};
|
||||
outputs = { self, nixpkgs, utils, devshell }:
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
utils,
|
||||
devshell,
|
||||
}:
|
||||
utils.lib.eachDefaultSystem (system: {
|
||||
devShells.default = let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
|
||||
overlays = [ devshell.overlay ];
|
||||
overlays = [devshell.overlay];
|
||||
};
|
||||
in pkgs.devshell.mkShell { packages = with pkgs; [ ]; };
|
||||
in
|
||||
pkgs.devshell.mkShell {packages = with pkgs; [];};
|
||||
});
|
||||
}
|
||||
|
|
15
flake.nix
15
flake.nix
|
@ -1,8 +1,12 @@
|
|||
{
|
||||
description = "Samw's Nix flake templates";
|
||||
inputs = { utils.url = "github:numtide/flake-utils"; };
|
||||
inputs = {utils.url = "github:numtide/flake-utils";};
|
||||
|
||||
outputs = { self, utils, nixpkgs }:
|
||||
outputs = {
|
||||
self,
|
||||
utils,
|
||||
nixpkgs,
|
||||
}:
|
||||
{
|
||||
templates = {
|
||||
rust = {
|
||||
|
@ -18,7 +22,8 @@
|
|||
description = "A basic devshell setup";
|
||||
};
|
||||
};
|
||||
} // utils.lib.eachDefaultSystem (system:
|
||||
let pkgs = import nixpkgs { inherit system; };
|
||||
in { formatter = pkgs.nixfmt; });
|
||||
}
|
||||
// utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
in {formatter = pkgs.alejandra;});
|
||||
}
|
||||
|
|
16
go/flake.nix
16
go/flake.nix
|
@ -7,12 +7,16 @@
|
|||
inputs.flake-utils.follows = "flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, utils, devshell }:
|
||||
utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
utils,
|
||||
devshell,
|
||||
}:
|
||||
utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ devshell.overlay ];
|
||||
overlays = [devshell.overlay];
|
||||
};
|
||||
in rec {
|
||||
packages.default = pkgs.buildGoModule {
|
||||
|
@ -26,9 +30,9 @@
|
|||
#'';
|
||||
};
|
||||
|
||||
apps.default = utils.lib.mkApp { drv = packages.default; };
|
||||
apps.default = utils.lib.mkApp {drv = packages.default;};
|
||||
|
||||
devShells.default =
|
||||
pkgs.devshell.mkShell { packages = with pkgs; [ go gopls ]; };
|
||||
pkgs.devshell.mkShell {packages = with pkgs; [go gopls];};
|
||||
});
|
||||
}
|
||||
|
|
|
@ -8,12 +8,18 @@
|
|||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, utils, naersk, devshell, rust-overlay }:
|
||||
utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
utils,
|
||||
naersk,
|
||||
devshell,
|
||||
rust-overlay,
|
||||
}:
|
||||
utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ (import rust-overlay) ];
|
||||
overlays = [(import rust-overlay)];
|
||||
};
|
||||
rust = pkgs.rust-bin.stable.latest.default;
|
||||
# Override naersk to use our chosen rust version from rust-overlay
|
||||
|
@ -27,16 +33,17 @@
|
|||
root = ./.;
|
||||
};
|
||||
|
||||
apps.default = utils.lib.mkApp { drv = packages.default; };
|
||||
apps.default = utils.lib.mkApp {drv = packages.default;};
|
||||
|
||||
# Provide a dev env with rust and rls
|
||||
devShells.default = let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ devshell.overlay ];
|
||||
overlays = [devshell.overlay];
|
||||
};
|
||||
in pkgs.devshell.mkShell {
|
||||
packages = with pkgs; [ (rust.override { extensions = [ "rls" ]; }) ];
|
||||
in
|
||||
pkgs.devshell.mkShell {
|
||||
packages = with pkgs; [(rust.override {extensions = ["rls"];})];
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue