-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
93 lines (90 loc) · 2 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
astal = {
url = "github:aylur/astal";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
astal,
}:
let
inherit (nixpkgs) lib;
genSystems = lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
];
in
{
overlays.default =
self: prev:
let
lua = prev.lua.override {
packageOverrides = luaself: luaprev: {
snowy_utils = prev.callPackage ./rust/package.nix { };
};
};
in
{
luaPackages = lua.pkgs;
};
homeManagerModules = {
default = self.homeManagerModules.snowy-shell;
snowy-shell = import ./nix/hm-module.nix self;
};
devShells = genSystems (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
in
{
default = pkgs.mkShell {
packages = with pkgs; [
cargo
rustc
pkg-config
clippy
rustfmt
(lua.withPackages (
ps: with ps; [
stdlib
]
))
luarocks
luarocks-nix
luaPackages.luarocks-build-rust-mlua
luaPackages.snowy_utils
luaPackages.stdlib
];
};
}
);
packages = genSystems (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
in
{
default = self.packages.${system}.snowy-shell;
snowy-shell = pkgs.callPackage ./nix/package.nix {
inherit
self
astal
system
pkgs
;
};
}
);
};
}