-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathflake.nix
More file actions
119 lines (107 loc) · 3.25 KB
/
flake.nix
File metadata and controls
119 lines (107 loc) · 3.25 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{
description = "doughnut development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
permittedInsecurePackages = [];
substituteOnDestination = true;
# Use specific binary caches
binaryCaches = [
"https://cache.nixos.org"
"https://nixcache.reflex-frp.org"
];
trusted-binary-caches = [
"https://cache.nixos.org"
"https://nixcache.reflex-frp.org"
];
};
};
inherit (pkgs) stdenv lib;
apple_sdk = pkgs.darwin.apple_sdk.frameworks;
# Python 3.12: stable on nixos-25.11; pydantic-core in the lockfile does not build on 3.13 yet.
python312 = pkgs.python312;
pythonWithTools = python312.withPackages (ps: with ps; [ pip setuptools wheel ]);
poetryPkg = pkgs.poetry.override { python3 = python312; };
poetryPath = "${poetryPkg}/bin";
pythonPackages = [ pythonWithTools poetryPkg ];
basePackages = with pkgs; [
zulu25
nodejs_24
corepack_24
lsof
fzf
git-secret
gitleaks
jq
mysql_jdbc
mysql84
mariadb.client
redis
yamllint
nixfmt-classic
hclfmt
trash-cli
process-compose
];
darwinPackages = with pkgs; lib.optionals stdenv.isDarwin [ sequelpro ];
linuxPackages = with pkgs; lib.optionals (!stdenv.isDarwin) [
psmisc
xclip
libuuid
];
linuxCypressPackages = with pkgs; lib.optionals (!stdenv.isDarwin) [
xorg.xorgserver
xorg.xauth
xorg.libX11
xorg.libXcomposite
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXtst
xorg.libXScrnSaver
xorg.libxshmfence
gtk3
gtk2
glib
nss
alsa-lib
atk
at-spi2-atk
libdrm
dbus
expat
mesa
nspr
udev
cups
pango
cairo
];
shellBuildInputs = basePackages ++ darwinPackages ++ linuxPackages ++ pythonPackages;
in {
devShells.default = pkgs.mkShell {
name = "doughnut";
nativeBuildInputs = with pkgs; [ autoPatchelfHook ];
buildInputs = shellBuildInputs;
# Force binary substitutes for the shell
preferLocalBuild = false;
allowSubstitutes = true;
shellHook = ''
export LD_LIBRARY_PATH="${lib.makeLibraryPath shellBuildInputs}''${LD_LIBRARY_PATH:+:}''$LD_LIBRARY_PATH"
export PATH="${pythonWithTools}/bin:${poetryPath}:$PATH"
source ./scripts/nix_shell_hook.sh "${pkgs.fzf}" "${pkgs.mysql84}" "${pkgs.redis}" "${poetryPath}"
'';
};
});
}