-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
49 lines (45 loc) · 1.15 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
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default-linux";
};
outputs = {
self,
nixpkgs,
systems,
...
}: let
inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems);
pkgsFor = eachSystem (system:
import nixpkgs {
localSystem = system;
});
in {
packages = eachSystem (system: let
pkgs = pkgsFor.${system};
in {
default = self.packages.${system}.battery-notifier;
battery-notifier = pkgs.callPackage ./default.nix {};
});
nixosModules.default = import ./nix/nixos-module.nix self;
homeManagerModule.default = import ./nix/hm-module.nix self;
formatter = eachSystem (system: let
pkgs = pkgsFor.${system};
in
pkgs.alejandra);
devShells.default = eachSystem (system: let
pkgs = pkgsFor.${system};
in
pkgs.mkShell (let
rust-latest = pkgs.rust-bin.stable.latest.default.override {
extensions = [
"rust-src"
"rust-analyzer"
];
};
in {
buildInputs = with pkgs; [rust-analyzer cargo rust-latest];
}));
};
}