-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
115 lines (111 loc) · 3.08 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{
description = "Home Manager configuration";
inputs = {
# Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixos/nixpkgs/release-23.11";
flake-utils.url = "github:numtide/flake-utils";
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
fenix = {
url = "github:nix-community/fenix/monthly";
inputs.nixpkgs.follows = "nixpkgs";
};
# non-flake inputs
cargo-clean-all = {
url = "github:dnlmlr/cargo-clean-all/v0.6.2";
flake = false;
};
mise = {
url = "github:jdx/mise/v2024.1.12";
flake = false;
};
sheldon = {
url = "github:rossmacarthur/sheldon/0.7.4";
flake = false;
};
};
outputs =
inputs@{ self
# flakes
, nixpkgs
, flake-utils
, home-manager
, fenix
# non-flakes
, cargo-clean-all
, mise
, sheldon
, ...
}:
let
user = "kh";
rustToolchain = { lib, system, fenix, ... }: fenix.fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-7QfkHty6hSrgNM0fspycYkRcB82eEqYa4CoAJ9qA3tU=";
};
rustPlatform = { callPackage, makeRustPlatform, ... }: makeRustPlatform rec {
rustc = callPackage rustToolchain { };
cargo = rustc;
};
in
{
overlays = {
fenix = fenix.overlays.default;
rustToolchain = final: prev: {
rustToolchain = prev.callPackage rustToolchain { };
};
rustPlatform = final: prev: {
rustPlatform = prev.callPackage rustPlatform { };
};
mise = final: prev: {
mise = prev.callPackage ./packages/mise.nix {
src = mise;
};
};
firge-nerd = final: prev: {
firge-nerd = prev.callPackage ./packages/firge-nerd.nix { };
};
cargo-clean-all = final: prev: {
cargo-clean-all = prev.callPackage ./packages/cargo-clean-all.nix {
src = cargo-clean-all;
};
};
sheldon = final: prev: {
sheldon = prev.callPackage ./packages/sheldon.nix {
src = sheldon;
};
};
};
} // flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlays.fenix
self.overlays.rustToolchain
self.overlays.mise
self.overlays.firge-nerd
self.overlays.cargo-clean-all
self.overlays.sheldon
];
};
in
{
packages = {
homeConfigurations."${user}" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
# Specify your home configuration modules here, for example,
# the path to your home.nix.
modules = [ ./home.nix ];
# Optionally use extraSpecialArgs
# to pass through arguments to home.nix
extraSpecialArgs = {
inherit user;
};
};
inherit (pkgs) rustToolchain sheldon mise firge-nerd cargo-clean-all;
};
});
}