-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
98 lines (92 loc) · 2.89 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
{
description = "beet's home";
inputs = {
nixos.url = "github:NixOS/nixpkgs/nixos-22.11";
nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nur.url = "github:nix-community/NUR";
darwin = {
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixos-unstable";
};
nixvim = {
url = "github:pta2002/nixvim";
inputs.nixpkgs.follows = "nixos-unstable";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixos-unstable";
};
};
outputs =
{ home-manager, nixos, nixos-unstable, nixos-hardware, nur, nixvim, darwin, ... }:
let
enablePkgs = { ... } @ args: builtins.mapAttrs (n: v: v // { enable = true; }) args;
pkgsWithUnfree = system: import nixos-unstable {
system = system;
config = { allowUnfree = true; };
overlays = [
(self: prev: {
npm_whistle = self.callPackage ./overlays/npm-whistle.nix { };
})
];
};
nurPkgs = system: import nur {
nurpkgs = pkgsWithUnfree system;
pkgs = pkgsWithUnfree system;
};
homeConf = homeConfFile: system: {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.beet = {
imports = [ homeConfFile ];
};
extraSpecialArgs = {
nixvim = nixvim;
enablePkgs = enablePkgs;
pkgs = pkgsWithUnfree system;
nur = nurPkgs system;
};
};
};
in
{
nixosConfigurations = {
be = nixos.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = { inherit nixvim; inherit enablePkgs; };
modules = [
./os/nixos/configuration.nix
# Custom hardware kernel
nixos-hardware.nixosModules.microsoft-surface-pro-intel
# Add config.nur
nur.nixosModules.nur
# nur.hmModules.nur
home-manager.nixosModules.home-manager
(homeConf ./os/nixos/users/beet.nix system)
];
};
};
darwinConfigurations = {
be = darwin.lib.darwinSystem rec {
system = "x86_64-darwin";
specialArgs = { inherit nixvim; inherit enablePkgs; };
modules = [
./os/macos/configuration.nix
home-manager.darwinModules.home-manager
(homeConf ./os/macos/users/beet.nix system)
];
};
be_aarch = darwin.lib.darwinSystem rec {
system = "aarch64-darwin";
specialArgs = { inherit nixvim; inherit enablePkgs; };
modules = [
./os/macos/configuration.nix
home-manager.darwinModules.home-manager
(homeConf ./os/macos/users/beet.nix system)
];
};
};
};
}