This repository has been archived by the owner on Dec 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
58 lines (54 loc) · 1.59 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {
self,
nixpkgs,
home-manager,
}: let
inherit (nixpkgs) lib;
genSystems = lib.genAttrs lib.systems.flakeExposed;
hmConfig = baseDistro:
home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-linux";
modules = [
(import ./home.nix inputs)
self.homeModules.default
{wsl.baseDistro = baseDistro;}
];
};
in {
homeModules.default = import ./module.nix;
homeConfigurations =
{
sample = self.homeConfigurations.sample-alpine;
}
// (lib.mapAttrs' (name: _: lib.nameValuePair "sample-${name}" (hmConfig name)) (builtins.readDir ./distros));
packages = genSystems (system:
(builtins.mapAttrs (_: value: value.config.wsl.tarball) (builtins.removeAttrs self.homeConfigurations ["sample"]))
// {
default = self.homeConfigurations.sample.config.wsl.tarball;
});
formatter = genSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
devShells = genSystems (system: {
default = with nixpkgs.legacyPackages.${system};
mkShellNoCC {
packages = [
nvfetcher
yq
shellcheck
shfmt
self.formatter.${system}
(python3.withPackages (p: [p.black]))
fakeroot
htmlq
];
};
});
};
}