-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
43 lines (37 loc) · 1.06 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
description = "A simple chat application for LAN";
# Nixpkgs / NixOS version to use.
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system:
let
version = "0.1.0";
pname = "lan-chat";
# Go in pkgs was 1.16
goOverlay = final: prev: {
go = prev.go.overrideAttrs rec {
version = "1.23.2";
src = pkgs.fetchurl {
url = "https://go.dev/dl/go${version}.src.tar.gz";
hash = "sha256-NpMBYqk99BfZC9IsbhTa/0cFuqwrAkGO3aZxzfqc0H8=";
};
};
};
pkgs = import nixpkgs { inherit system; overlays = [ goOverlay ]; };
in
{
packages = rec {
lan-chat = pkgs.buildGoModule {
inherit pname version;
src = ./.;
vendorHash = null;
};
default = lan-chat;
};
devShells.default = with pkgs; pkgs.mkShell {
buildInputs = [ go ];
};
});
}