-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
110 lines (100 loc) · 3.34 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
{
description = "Home Manager configuration";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
nix-colors.url = "github:misterio77/nix-colors";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = "github:pjones/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
android-nixpkgs = {
url = "github:tadfisher/android-nixpkgs/stable";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
home-manager,
nix-colors,
plasma-manager,
android-nixpkgs,
} @ inputs: let
username = "furqan"; # $USER
name = "Muhammad Furqan"; # $NAME
email = "[email protected]"; # $EMAIL
system = "x86_64-linux"; # x86_64-linux, aarch64-multiplatform, etc.
stateVersion = "23.05"; # See https://nixos.org/manual/nixpkgs/stable for most recent
homeDirectory = "/home/${username}";
configs = {inherit username name email homeDirectory system stateVersion;};
inherit (self) outputs;
pkgs-common-config = {
inherit system;
config = {
allowUnfree = true; # Allow proprietary software.
};
};
pkgs-config =
pkgs-common-config
// {
overlays = [
android-nixpkgs.overlays.default
];
};
pkgs = import nixpkgs pkgs-config;
home = import ./home {
inherit configs inputs outputs;
};
in {
homeManagerModules = import ./modules/home-manager;
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {inherit configs inputs outputs;};
modules = [
home
];
};
nixosConfigurations = {
pc = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {inherit pkgs configs inputs outputs;};
modules = [
./system/pc.nix
home-manager.nixosModules.home-manager
{
# https://nix-community.github.io/home-manager/nixos-options.html
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
# On activation move existing files by appending the given file extension rather than exiting with an error.
home-manager.backupFileExtension = "backup";
home-manager.users.${username} = home;
home-manager.extraSpecialArgs = {inherit configs inputs outputs;};
}
];
};
cc = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {inherit pkgs configs inputs outputs;};
modules = [
./system/cc.nix
home-manager.nixosModules.home-manager
{
# https://nix-community.github.io/home-manager/nixos-options.html
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
# On activation move existing files by appending the given file extension rather than exiting with an error.
home-manager.backupFileExtension = "backup";
home-manager.users.${username} = home;
home-manager.extraSpecialArgs = {inherit configs inputs outputs;};
}
];
};
};
devShells.${system}.default = import ./shells/node14.nix {inherit pkgs;};
};
}