-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathflake.nix
More file actions
62 lines (58 loc) · 1.64 KB
/
flake.nix
File metadata and controls
62 lines (58 loc) · 1.64 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
description = "A dotfile manager for pair programmers and lazy people";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs =
{ self, nixpkgs }:
let
version = builtins.substring 0 10 self.rev or "dirty";
supportedSystems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
# Provide some binary packages for selected system types.
packages = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
in
{
dfm = pkgs.buildGoModule.override { go = pkgs.go_1_26; } {
pname = "dfm";
inherit version;
src = ./.;
# Tests are disabled when installing because they don't work on
# a read only file system.
checkPhase = null;
vendorHash = "sha256-QMHvcgvUm3CeK/9kjdUWYseUA8FizSdVrTDXnIYy9Zw=";
ldflags = [
"-X main.Version=${version}"
];
};
}
);
# Add dependencies that are only needed for development
devShells = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
in
{
default = pkgs.mkShell {
buildInputs = with pkgs; [
go_1_26
gopls
gotools
go-tools
];
};
}
);
defaultPackage = forAllSystems (system: self.packages.${system}.dfm);
};
}