-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
112 lines (99 loc) · 3.1 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
{
description = "Home Manager configuration of mohammed";
inputs = {
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*.tar.gz";
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.0.tar.gz";
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "https://flakehub.com/f/nix-community/home-manager/0.1.0.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
catppuccin.url = "https://flakehub.com/f/catppuccin/nix/1.0.*.tar.gz";
#*** Non-flake source code ***#
# forked from nvim-lua/kickstart.nvim
minvim = {
url = "github:alrefai/minvim/config";
flake = false;
};
# forked from gpakosz/.tmux
mitmux = {
url = "github:alrefai/mitmux/config";
flake = false;
};
# yazi plugins
yazi-plugins = {
url = "github:yazi-rs/plugins";
flake = false;
};
# starship prompt yazi plugin
starship-yazi = {
url = "github:Rolv-Apneseth/starship.yazi";
flake = false;
};
};
outputs = {
flake-schemas,
nixpkgs,
lix-module,
home-manager,
catppuccin,
...
} @ inputs: let
# A higher-order helper function that generates system-specific
# outputs
forEachSystem = supportedSystems: generateConfig:
nixpkgs.lib.genAttrs supportedSystems (
system:
generateConfig {
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
}
);
# A higher-order function to generate home-manager configurations for
# given username and system
generateHomeConfigurations = username: {pkgs}: {
# Define the home-manager configuration for the defined user
homeConfigurations = {
${username} = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
# Pass arguments to the configuration modules
extraSpecialArgs = {inherit inputs username;};
# List of configuration modules to include
modules = [
./home.nix
catppuccin.homeManagerModules.catppuccin
];
};
};
};
# List of supported systems/architectures
allSystems = [
"aarch64-darwin"
"x86_64-darwin"
"aarch64-linux"
"x86_64-linux"
];
# Partially apply the system list to `forEachSystem` function
forAllSystems = forEachSystem allSystems;
# Apply the configuration generator to all supported systems
# for the provided username
homeConfigsForAllSystems = forAllSystems (
generateHomeConfigurations "mohammed"
);
in {
# Schemas tell Nix about the structure of your flake's outputs
inherit (flake-schemas) schemas;
#*** home-manager configurations ***#
legacyPackages = homeConfigsForAllSystems;
#*** nixos configurations ***#
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [./configuration.nix lix-module.nixosModules.default];
};
};
}