-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
151 lines (140 loc) · 4.25 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
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
147
148
149
150
151
{
description = "Home Manager configuration of Stas";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim/nixos-24.11";
inputs = {
nixpkgs.follows = "nixpkgs";
# Remove optional dependencies
devshell.follows = "";
flake-compat.follows = "";
git-hooks.follows = "";
home-manager.follows = "";
nix-darwin.follows = "";
treefmt-nix.follows = "";
nuschtosSearch.follows = "";
};
};
# Pin to v1.2.1. Before https://github.com/catppuccin/nix/commit/115c3de5635c257bd2a723e06f8262a5edd66d9c
catppuccin.url = "github:catppuccin/nix/1e4c3803b8da874ff75224ec8512cb173036bbd8";
# Neovim package
neovim = {
url = "github:stasjok/neovim?ref=release-0.10-patched";
inputs.nixpkgs.follows = "nixpkgs";
};
# Neovim plugins
mini-nvim = {
url = "github:stasjok/mini.nvim";
flake = false;
};
fix-auto-scroll-nvim = {
url = "github:BranimirE/fix-auto-scroll.nvim";
flake = false;
};
vim-mediawiki = {
url = "github:m-pilia/vim-mediawiki";
flake = false;
};
surround-nvim = {
url = "github:ur4ltz/surround.nvim?rev=549045828bbd9de0746b411a762fa8c382fb10ff";
flake = false;
};
smart-splits-nvim = {
# Pin smart-splits.nvim to the version that doesn't run tmux commands on startup
url = "github:mrjones2014/smart-splits.nvim?rev=159c4823e3a11c79bb65fc4b8560320c49f738f4";
flake = false;
};
# Other inputs
tree-sitter-jinja2 = {
url = "github:theHamsta/tree-sitter-jinja2";
flake = false;
};
yaml-language-server = {
url = "github:stasjok/yaml-language-server?rev=36084f03f936d3a0b59934f4bf3ef70bc40bbf92";
flake = false;
};
vale-at-red-hat = {
url = "github:redhat-documentation/vale-at-red-hat";
flake = false;
};
};
outputs =
inputs@{
self,
nixpkgs,
home-manager,
nixvim,
catppuccin,
...
}:
let
system = "x86_64-linux";
homeManagerOverlay = import "${home-manager}/overlay.nix";
pkgs = import "${nixpkgs}/pkgs/top-level" {
localSystem = system;
overlays = [
homeManagerOverlay
self.overlays.default
];
};
inherit (pkgs) lib;
# Home configuration template
makeHomeConfiguration =
{
username ? "stas",
homeDirectory ? "/home/${username}",
stateVersion ? "24.11",
extraModules ? [ ],
extraSpecialArgs ? { },
isGenericLinux ? true,
}:
home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = extraSpecialArgs // {
inherit inputs;
};
modules = lib.flatten [
nixvim.homeManagerModules.nixvim
catppuccin.homeManagerModules.catppuccin
./modules
./home.nix
(lib.optional isGenericLinux ./linux.nix)
{
home = {
inherit username homeDirectory stateVersion;
};
}
extraModules
];
};
makeOverridableHomeConfiguration = args: lib.makeOverridable makeHomeConfiguration args;
in
{
homeConfigurations = {
stas = makeOverridableHomeConfiguration {
username = "stas";
};
"stas@server2" = makeOverridableHomeConfiguration {
username = "stas";
extraModules = [ ./server2.nix ];
};
admAsunkinSS = makeOverridableHomeConfiguration {
username = "admAsunkinSS";
extraModules = [ ./work.nix ];
};
};
devShells.${system} = pkgs.callPackages ./shell { inherit (self) homeConfigurations; };
formatter.${system} = pkgs.treefmt;
checks.${system}.tests = pkgs.callPackage ./tests {
homeConfiguration = self.homeConfigurations.stas;
};
overlays.default = import ./overlay { inherit inputs; };
# Provide all upstream packages
legacyPackages.${system} = pkgs;
};
}