-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
58 lines (51 loc) · 1.53 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
{
description = "Home Manager Diff";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs = {
nixpkgs.follows = "nixpkgs";
systems.follows = "systems";
flake-utils.follows = "flake-utils";
nix-github-actions.follows = "";
treefmt-nix.follows = "";
};
};
};
outputs = inputs@{ flake-parts, systems, ... }: flake-parts.lib.mkFlake { inherit inputs; } ({ moduleWithSystem, ... }: {
systems = import systems;
perSystem = { pkgs, system, config, ... }: {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ inputs.poetry2nix.overlays.default ];
};
packages = {
hmd = pkgs.callPackage ./nix/package.nix { };
default = config.packages.hmd;
};
devShells = {
default = pkgs.mkShell {
name = "home-manager-diff";
buildInputs = [ pkgs.bashInteractive ];
packages = with pkgs; [
poetry
just
];
};
};
};
flake = {
hmModules.default = moduleWithSystem (perSystem@{ config }: { ... }: {
imports = [ ./nix/hm-module.nix ];
programs.hmd.package = perSystem.config.packages.hmd;
});
};
});
}