Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
118 lines (113 loc) · 3.14 KB
/
Copy pathflake.nix
File metadata and controls
118 lines (113 loc) · 3.14 KB
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
116
117
118
{
description = "Single-machine NixOS dotfiles with a reference macOS configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-darwin.url = "github:NixOS/nixpkgs/nixpkgs-26.05-darwin";
nix-darwin = {
url = "github:nix-darwin/nix-darwin/nix-darwin-26.05";
inputs.nixpkgs.follows = "nixpkgs-darwin";
};
dms = {
url = "github:AvengeMedia/DankMaterialShell/stable";
inputs.nixpkgs.follows = "nixpkgs";
};
dank-greeter = {
url = "github:AvengeMedia/dank-greeter";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{
nixpkgs,
home-manager,
nix-darwin,
...
}:
let
root = ./.;
hostConfig = import ./host/meta.nix;
isDarwin = nixpkgs.lib.hasSuffix "-darwin" hostConfig.platform;
paths = {
root = toString root;
assets = toString (root + "/assets");
};
in
if isDarwin then
{
darwinConfigurations.${hostConfig.hostName} = nix-darwin.lib.darwinSystem {
system = hostConfig.platform;
specialArgs = {
inherit
hostConfig
inputs
paths
root
;
};
modules = [ ./host/system.nix ];
};
}
else
let
pkgs = import nixpkgs {
system = hostConfig.platform;
config.allowUnfree = hostConfig.allowUnfree;
};
pkgsUnstable = import inputs.nixpkgs-unstable {
system = hostConfig.platform;
config.allowUnfree = hostConfig.allowUnfree;
};
in
{
nixosConfigurations.${hostConfig.hostName} = nixpkgs.lib.nixosSystem {
system = hostConfig.platform;
specialArgs = {
inherit
hostConfig
inputs
paths
pkgsUnstable
root
;
};
modules = [
./host/system.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit
hostConfig
inputs
paths
root
pkgsUnstable
;
};
home-manager.users.${hostConfig.user.name} = import ./host/home.nix;
}
];
};
homeConfigurations."${hostConfig.user.name}@${hostConfig.hostName}" =
home-manager.lib.homeManagerConfiguration
{
inherit pkgs;
extraSpecialArgs = {
inherit
hostConfig
inputs
paths
root
pkgsUnstable
;
};
modules = [ ./host/home.nix ];
};
};
}