formatter + nixConfig

This commit is contained in:
Motiejus Jakštys 2023-04-03 21:41:49 +03:00
parent 90f07dfe93
commit 32ff8d2574
2 changed files with 27 additions and 17 deletions

View File

@ -1,4 +1,9 @@
{ {
nixConfig = {
trusted-substituters = "https://cache.nixos.org/";
trusted-public-keys = "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=";
extra-experimental-features = "nix-command flakes";
};
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11-small"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11-small";
flake-compat = { flake-compat = {
@ -7,21 +12,26 @@
}; };
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { nixpkgs, flake-utils, ... }: outputs = {
flake-utils.lib.eachDefaultSystem (system: nixpkgs,
let flake-utils,
pkgs = import nixpkgs { inherit system; }; ...
devDeps = with pkgs; [ bash hugo zopfli brotli parallel ]; }:
in flake-utils.lib.eachDefaultSystem (system: let
{ pkgs = import nixpkgs {inherit system;};
devShells.default = pkgs.mkShell { devDeps = with pkgs; [bash hugo zopfli brotli parallel];
name = "rules_nixpkgs_shell"; in {
packages = devDeps; devShells.default = pkgs.mkShell {
}; name = "rules_nixpkgs_shell";
packages = devDeps;
};
# TODO how to run scripts/build as a result of `nix run .`? # TODO how to run scripts/build as a result of `nix run .`?
#packages = flake-utils.lib.mkApp { #packages = flake-utils.lib.mkApp {
# name = "build # name = "build
#}; #};
});
formatter = pkgs.alejandra;
});
} }

View File

@ -3,4 +3,4 @@ let
spec = lock.nodes.nixpkgs.locked; spec = lock.nodes.nixpkgs.locked;
nixpkgs = fetchTarball "https://github.com/${spec.owner}/${spec.repo}/archive/${spec.rev}.tar.gz"; nixpkgs = fetchTarball "https://github.com/${spec.owner}/${spec.repo}/archive/${spec.rev}.tar.gz";
in in
import nixpkgs import nixpkgs