flake: nixpkgs-fmt .

This commit is contained in:
surtur 2022-04-27 02:56:01 +02:00
parent 7fd07f6dfe
commit 4180e82e2f
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -1,7 +1,7 @@
{
description = "an offline-capable xkcd webcomic reader written in Go";
inputs= {
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-compat = {
url = "github:edolstra/flake-compat";
@ -14,13 +14,15 @@
let
# to work with older version of flakes
lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
lastModifiedDate =
self.lastModifiedDate or self.lastModified or "19700101";
# Generate a user-friendly version number.
version = builtins.substring 0 8 lastModifiedDate;
# System types to support.
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
supportedSystems =
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
@ -33,9 +35,9 @@
# Provide some binary packages for selected system types.
packages = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in rec {
let pkgs = nixpkgsFor.${system};
in
rec {
go-xkcdreader = pkgs.buildGoModule {
pname = "go-xkcdreader";
inherit version;
@ -53,33 +55,31 @@
# remeber to bump this hash when your dependencies change.
#vendorSha256 = pkgs.lib.fakeSha256;
vendorSha256 = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo=";
vendorSha256 =
"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo=";
};
});
# The default package for 'nix build'. This makes sense if the
# flake provides only one package or there is a clear "main"
# package.
defaultPackage = forAllSystems (system: self.packages.${system}.go-xkcdreader);
defaultPackage =
forAllSystems (system: self.packages.${system}.go-xkcdreader);
apps = forAllSystems (system: rec {
go-xkcdreader = {
type = "app";
program = "${self.packages.${system}.go-xkcdreader}/bin/go-xkcdreader";
program =
"${self.packages.${system}.go-xkcdreader}/bin/go-xkcdreader";
};
default = go-xkcdreader;
});
devShells= forAllSystems (system:
devShells = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in pkgs.mkShell {
buildInputs = with pkgs; [
go
gopls
gofumpt
go-tools
];
}
);
in
pkgs.mkShell {
buildInputs = with pkgs; [ go gopls gofumpt go-tools nixpkgs-fmt ];
});
};
}