-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
146 lines (138 loc) · 3.54 KB
/
Copy pathflake.nix
File metadata and controls
146 lines (138 loc) · 3.54 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{
description = "dotfiles flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
dev-cli = {
url = "github:csvenke/dev-cli";
inputs.nixpkgs.follows = "nixpkgs";
};
llm-cli = {
url = "github:csvenke/llm-cli";
inputs.nixpkgs.follows = "nixpkgs";
};
neovim = {
url = "github:csvenke/neovim-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{
flake-parts,
treefmt-nix,
nixpkgs,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
imports = [
treefmt-nix.flakeModule
];
perSystem =
{ system, ... }:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
(final: prev: {
neovim = inputs.neovim.packages.${system}.default;
dev-cli = inputs.dev-cli.packages.${system}.default;
llm-cli = inputs.llm-cli.packages.${system}.default;
})
(import ./nix/overlays/tmux)
(import ./nix/overlays/fzf)
];
};
inherit (pkgs)
lib
callPackage
buildEnv
stdenv
;
tools = lib.packagesFromDirectoryRecursive {
inherit callPackage;
directory = ./nix/tools;
};
homePackages =
with pkgs;
[
bash-completion
stow
findutils
fd
starship
direnv
nix-direnv
mise
delta
ripgrep
jq
httpie
tldr
wget
git
lazygit
curl
eza
bat
htop-vim
gh
fastfetch
nodejs
tmux
fzf
neovim
opencode
llm-cli
dev-cli
]
++ lib.optionals stdenv.isLinux [
xclip
wl-clipboard
]
++ (lib.attrValues tools);
in
{
apps = {
bootstrap = {
type = "app";
program = "${./scripts/bootstrap.sh}";
meta.description = "Bootstrap dotfiles on the system";
};
eject = {
type = "app";
program = "${./scripts/eject.sh}";
meta.description = "Remove dotfiles completly from the system";
};
fix-broken-profile = {
type = "app";
program = "${./scripts/fix-broken-profile.sh}";
meta.description = "Fix broken nix profile";
};
};
packages = {
default = buildEnv {
name = "dotfiles";
paths = homePackages;
};
};
treefmt.config = {
projectRootFile = "flake.nix";
programs.nixfmt.enable = true;
programs.prettier.enable = true;
programs.shfmt.enable = true;
programs.stylua.enable = true;
programs.taplo.enable = true;
};
};
};
}