generated from foambubble/foam-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
executable file
·108 lines (104 loc) · 3.04 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
{
description = "lahoda.xyz";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
rust-overlay = {
url = "github:oxalica/rust-overlay/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nixgl = {
url = "github:guibou/nixGL/main";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
helix = {
url = "github:helix-editor/helix/25.01.1";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{
self,
flake-parts,
nixpkgs,
rust-overlay,
nixgl,
helix,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
perSystem =
{
config,
self',
inputs',
pkgs,
system,
...
}:
let
overlays = [
(import rust-overlay)
nixgl.overlay
(final: prev: {
rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
#home-manager = home-manager.packages.${system}.home-manager;
})
];
pkgs = import nixpkgs { inherit system overlays; };
in
{
_module.args.pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
formatter = pkgs.nixfmt-rfc-style;
packages = {
activate = pkgs.writeShellApplication {
name = "activate";
runtimeInputs = with pkgs; [ home-manager ];
text = builtins.readFile ./nix/activate.sh;
};
pdf = pkgs.writeShellApplication {
name = "pdf";
runtimeInputs = with pkgs; [ home-manager ];
text = builtins.readFile ./nix/pdf.sh;
};
};
};
flake =
let
system = "x86_64-linux";
overlays = [
(import rust-overlay)
nixgl.overlay
(final: prev: { rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; })
];
pkgs = import nixpkgs {
inherit system overlays;
config = {
packageOverrides = pkgs: {
helix = helix.packages.${system}.helix;
vscode = nixpkgs.legacyPackages.${system}.vscode;
brave = nixpkgs.legacyPackages.${system}.brave;
nix = nixpkgs.legacyPackages.${system}.nix;
rust-toolchain =
nixpkgs.legacyPackages.${system}.rust-bin.fromRustupToolchainFile
./rust-toolchain.toml;
};
};
};
in
{
homeConfigurations.dz = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./home.nix ];
};
};
};
}