-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
188 lines (168 loc) · 5.08 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
{
description = "Jose Luis Nix flake configuration";
inputs = {
# nixpkgs.url = "/home/jlle/nixpkgs";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# add your model from this list: https://github.com/NixOS/nixos-hardware/blob/master/flake.nix
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
# url = "/home/jlle/home-manager";
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# githud = {
# url = "github:gbataille/gitHUD";
# };
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
# wired = {
# url = "github:Toqozz/wired-notify";
# inputs.nixpkgs.follows = "nixpkgs";
# };
nix-medley = {
# url = "/home/jlle/projects/nix-medley";
url = "github:jlesquembre/nix-medley";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-database =
{
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
neovim = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
# ghostty = {
# url = "github:ghostty-org/ghostty";
# };
};
outputs = { self, nixpkgs, nixos-hardware, flake-utils, ... }@inputs:
let
system = "x86_64-linux";
username = "jlle";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [ (import ./overlays { }) ];
};
ageKeyFile = "/etc/nixos/key.txt";
utils = (import ./lib { inherit pkgs; inherit ageKeyFile; });
extraArgs =
{
rootPath = ./.;
nix-medley = inputs.nix-medley.lib pkgs;
inherit ageKeyFile;
};
hosts = {
alfa = { };
beta = {
wifi = true;
bluetooth = true;
};
};
in
{
homeConfigurations = utils.mkHomeConfig
{
inherit hosts system username pkgs inputs extraArgs;
hmConfigDir = (builtins.toString ./home-manager);
};
nixosConfigurations =
(utils.mkHosts
{
inherit hosts system username pkgs inputs extraArgs;
configDir = (builtins.toString ./nixos);
})
// {
# nix build .#nixosConfigurations.iso-image.config.system.build.isoImage
iso-image = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
(nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
{
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.supportedFilesystems = pkgs.lib.mkForce [ "bcachefs" "vfat" "f2fs" ];
environment.systemPackages = with pkgs; [
rsync
];
}
];
};
};
} //
flake-utils.lib.eachSystem [ flake-utils.lib.system.x86_64-linux ] (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [ (import ./overlays { }) ];
};
nix-medley = inputs.nix-medley.lib pkgs;
utils = (import ./lib { inherit pkgs; });
in
{
devShells =
{
default =
pkgs.mkShell {
packages = with pkgs;[
coreutils
curl
fish
git
imagemagick
nix
paperkey
pass
qrencode
sops
v4l-utils
zbar
];
};
};
packages =
let
nvimConfig = import ./home-manager/neovim.nix {
inherit pkgs nix-medley;
rootPath = ./.;
lib = pkgs.lib;
config = null;
};
in
{
nvim-master =
utils.mkNeovim (nvimConfig.programs.neovim // {
nvimPackage = inputs.neovim.packages."${system}".neovim;
});
nvim =
utils.mkNeovim nvimConfig.programs.neovim;
};
apps =
{
update-vim-plugins = {
type = "app";
program =
let
vimDir = "./home-manager";
update-vim-plugins = pkgs.writeShellScriptBin "update-vim-plugins"
''
${pkgs.vimPluginsUpdater}/bin/vim-plugins-updater \
-i ${vimDir}/neovim-plugins.txt \
-o ${vimDir}/neovim-plugins-generated.nix --no-commit \
--nixpkgs ${builtins.toString nixpkgs}
'';
in
"${update-vim-plugins}/bin/update-vim-plugins";
};
};
});
}