-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
87 lines (76 loc) · 2.33 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
{
description = "Yuki's dotfiles";
inputs = {
utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
helix.url = "github:helix-editor/helix";
zig.url = "github:mitchellh/zig-overlay";
zls = {
url = "github:zigtools/zls";
inputs.zig-overlay.follows = "zig";
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ { self, utils, nixpkgs, home-manager, nix-darwin, ... }:
let
inherit (home-manager.lib) homeManagerConfiguration;
inherit (nixpkgs) lib;
inherit (nix-darwin.lib) darwinSystem;
overlays =
[
inputs.zig.overlays.default
(self: super: {
inherit (inputs.devenv.packages.${self.system}) devenv;
inherit (inputs.helix.packages.${self.system}) helix;
inherit (inputs.zls.packages.${self.system}) zls;
})
];
mkConfiguration = system: config:
let
inherit (lib.systems.elaborate { inherit system; }) isLinux isDarwin;
pkgs = import nixpkgs {
inherit system overlays;
config.allowUnfree = true;
};
in
homeManagerConfiguration ({
inherit pkgs;
modules = [
({
home = {
homeDirectory = if isDarwin then "/Users/yuki" else "/home/yuki";
username = "yuki";
stateVersion = "22.11";
};
})
config
];
extraSpecialArgs = {
inherit system isLinux isDarwin;
};
});
in {
packages = {
aarch64-darwin.homeConfigurations.yuki = mkConfiguration "aarch64-darwin" ./home;
x86_64-linux.homeConfigurations.yuki = mkConfiguration "x86_64-linux" ./home;
};
darwinConfigurations.leveilleur = darwinSystem {
modules = [
{ nixpkgs.overlays = overlays; }
./darwin.nix
];
specialArgs = {
inherit inputs;
flake = self;
};
};
darwinConfigurations.xanathaea = self.darwinConfigurations.leveilleur;
};
}