-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathflake.nix
80 lines (70 loc) · 2.21 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
{
description = "Home-manager configuration";
inputs = {
utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, home-manager, nixpkgs, utils }:
let
pkgsForSystem = system: import nixpkgs {
inherit system;
config.allowUnfree = true;
};
mkHomeConfiguration = args: home-manager.lib.homeManagerConfiguration (rec {
modules = [ (import ./home.nix) ] ++ (args.modules or []);
pkgs = pkgsForSystem (args.system or "x86_64-linux");
} // { inherit (args) extraSpecialArgs; });
in utils.lib.eachSystem [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ] (system: rec {
legacyPackages = pkgsForSystem system;
devShells.default = with legacyPackages; mkShell {
packages = [ home-manager.packages.${system}.default ];
};
}) // {
# non-system suffixed items should go here
nixosModules.home = import ./home.nix; # attr set or list
homeConfigurations.jon = mkHomeConfiguration {
extraSpecialArgs = {
withGUI = true;
isDesktop = true;
networkInterface = "enp5s0";
};
};
homeConfigurations.server = mkHomeConfiguration {
extraSpecialArgs = {
withGUI = false;
isDesktop = false;
networkInterface = "enp68s0";
};
};
homeConfigurations.laptop = mkHomeConfiguration {
extraSpecialArgs = {
withGUI = true;
isDesktop = true;
networkInterface = "wlp1s0";
};
};
homeConfigurations.work = mkHomeConfiguration {
modules = [ ({lib,...}:
{
home.username = lib.mkForce "jringer";
home.homeDirectory = lib.mkForce "/home/jringer";
})];
extraSpecialArgs = {
withGUI = true;
isDesktop = true;
networkInterface = "wlp1s0";
};
};
homeConfigurations.mac-mini = mkHomeConfiguration {
extraSpecialArgs = {
withGUI = false;
isDesktop = false;
networkInterface = "en1";
};
};
inherit home-manager;
inherit (home-manager) packages;
};
}