-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
125 lines (114 loc) · 4.04 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
113
114
115
116
117
118
119
120
121
122
123
124
125
{
description = "Home configuration";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs-stable.url = "github:nixos/nixpkgs/nixpkgs-21.11-darwin";
nixpkgs-master.url = "github:nixos/nixpkgs/master";
nixpkgs-netcoredbg.url = "github:SilverCoder/nixpkgs/ca3d39623c53420339f6b1c6bde016451b50f927";
nixpkgs-omnisharp.url = "github:NixOS/nixpkgs/bad8fbc216f12c5b79a83f3ca86a40c22ef5cf21";
nvim-tokyonight = {
url = "github:folke/tokyonight.nvim";
flake = false;
};
# Used for home-manager darwin applications hack
mkAlias = {
url = "github:cdmistman/mkAlias";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ self, flake-utils, nixpkgs, home-manager, nixpkgs-stable, nixpkgs-master, nixpkgs-netcoredbg, nixpkgs-omnisharp, ... }:
let
nixpkgsOverlay = self: super: {
stable = nixpkgs-stable.legacyPackages.${super.system};
master = nixpkgs-master.legacyPackages.${super.system};
nixpkgs-netcoredbg = nixpkgs-netcoredbg.legacyPackages.${super.system};
nixpkgs-omnisharp = nixpkgs-omnisharp.legacyPackages.${super.system};
};
poetryOverlay = self: super: {
poetry = super.nixpkgs-stable.poetry;
};
netcoredbgOverlay = self: super: {
netcoredbg = super.nixpkgs-netcoredbg.netcoredbg;
};
neovimOverlay = self: super: {
myVimPlugins = {
tokyonight = super.pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "tokyonight.nvim";
version = "master";
src = inputs.nvim-tokyonight;
};
};
};
# https://github.com/OmniSharp/omnisharp-roslyn/issues/2574
omnisharpOverlay = self: super: {
omnisharp-roslyn = super.nixpkgs-omnisharp.omnisharp-roslyn;
};
mkAliasOverlay = self: super: {
# https://github.com/nix-community/home-manager/issues/1341#issuecomment-1468889352
mkAlias = inputs.mkAlias.outputs.apps.${super.system}.default.program;
};
overlays = [
(import ./spotify.nix)
nixpkgsOverlay
neovimOverlay
netcoredbgOverlay
mkAliasOverlay
omnisharpOverlay
];
configurations = [
{
username = "ole.pedersen";
imports = [ ./machine/belgium ];
homeDirectory = "/Users/olekristianpedersen";
}
{
username = "ole.kristian.eidem.pedersen";
imports = [ ./machine/venezuela ];
homeDirectory = "/Users/ole.kristian.eidem.pedersen";
}
{
username = "docker";
imports = [ ./minimal.nix ./neovim.nix ];
homeDirectory = "/home/docker";
}
];
in
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ]
(system: {
defaultPackage = home-manager.defaultPackage.${system};
packages.homeConfigurations = (builtins.listToAttrs
(map
(conf: {
name = "${conf.username}";
value = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
modules = [
{
# nixpkgs.config.allowUnfree = true; # FIXME: https://github.com/nix-community/home-manager/issues/2942
nixpkgs.config.allowUnfreePredicate = (pkg: true);
nixpkgs.overlays = overlays;
imports = conf.imports;
}
{
home = {
username = conf.username;
homeDirectory = conf.homeDirectory;
stateVersion = "22.11";
};
}
];
};
})
configurations
)
);
}) //
{
belgium = self.homeConfigurations."ole.pedersen".activationPackage;
};
}