-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
79 lines (79 loc) · 1.95 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
{
outputs = inputs @ {
self,
home,
nixpkgs,
utils,
devenv,
wsl,
neovim,
...
}: let
host = "wsl";
user = "vicenzo";
supportedSystems = ["x86_64-linux"];
modules = [
home.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${user} = {};
sharedModules = import_ ./home;
extraSpecialArgs = {inherit host user;};
};
}
];
sharedOverlays = [
overlay
utils.overlay
neovim.overlay
];
x = builtins;
import_ = name:
map (i: "${name}/${i}")
(x.attrNames (x.readDir name));
overlay = y: z: let
dirContents = x.readDir ./pkgs;
genPackage = name: {
inherit name;
value = y.callPackage (./pkgs + "/${name}") {};
};
names = x.attrNames dirContents;
in
x.listToAttrs (map genPackage names);
outputsBuilder = x: let
pkgs = x.nixpkgs;
shell = import ./shell {inherit pkgs inputs devenv;};
in {
devShells = shell;
formatter = pkgs.alejandra;
};
channelsConfig = import ./nix {inherit nixpkgs user;};
hosts = {
wsl = {
modules = [
wsl.nixosModules.wsl
./systems/wsl.nix
];
};
};
hostDefaults = {
inherit modules;
channelName = "unstable";
extraArgs = {inherit user;};
};
in
utils.lib.mkFlake {
inherit self inputs sharedOverlays channelsConfig outputsBuilder supportedSystems hosts hostDefaults;
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/release-23.05";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home.url = "github:nix-community/home-manager";
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
devenv.url = "github:cachix/devenv";
neovim.url = "github:nix-community/neovim-nightly-overlay";
wsl.url = "github:nix-community/NixOS-WSL";
};
}