forked from mitchellh/nixos-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
134 lines (120 loc) · 3.84 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
126
127
128
129
130
131
132
133
134
{
inputs = {
# Mirroring nixpkgs unstable
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.0.tar.gz";
# Updating nix itself
nix.url = "https://flakehub.com/f/DeterminateSystems/nix/2.0";
# For running GUI apps
# nixGL.url = "github:nix-community/nixGL";
# nixGL.inputs.nixpkgs.follows = "nixpkgs";
devenv.url = "github:cachix/devenv";
# Fix static linking issues
# flox.url = "github:flox/flox";
# ld-floxlib.url = "github:flox/ld-floxlib";
# Should follow nixpkgs for home-manager packages
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# Do not follow nixpkgs so it can be built reliably
# neovim.url = "github:nix-community/neovim-nightly-overlay";
# For rust nightly
# fenix.url = "github:nix-community/fenix";
# fenix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
inputs@{
self,
flake-parts,
home-manager,
# neovim,
# devenv,
# flox,
# ld-floxlib,
# nixGL,
# fenix,
...
}:
let
linux-user = "sand";
mac-user = "san.nguyen";
modules =
{ user }:
[
{
nix.settings.extra-trusted-users = [ user ];
nix.settings.extra-trusted-public-keys = [
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
"flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs="
];
nix.settings.extra-trusted-substituters = [
"https://devenv.cachix.org"
"https://cache.flox.dev"
];
}
./users/${user}/home.nix
inputs.nix.homeManagerModules.default
];
in
flake-parts.lib.mkFlake { inherit inputs; } (
{ withSystem, ... }:
{
systems = [ "aarch64-linux" ];
debug = true;
imports = [ inputs.devenv.flakeModule ];
perSystem =
{ ... }:
{
devenv.shells.default = {
languages.nix.enable = true;
};
};
flake.overlays.default = final: prev: {
# neovim-nightly = neovim.packages.${final.stdenv.system}.neovim;
comic-code = prev.callPackage ./pkgs/comic-code { };
nvchad = prev.callPackage ./pkgs/nvchad { };
# devenv = devenv.packages.${final.stdenv.system}.default;
# flox = flox.packages.${final.stdenv.system}.default;
};
flake.overlays.linux = final: prev: {
# nixGL = nixGL.packages.${final.stdenv.system}.default;
# ld-floxlib = ld-floxlib.packages.${final.stdenv.system}.ld-floxlib;
};
flake.homeConfigurations.${linux-user} = withSystem "aarch64-linux" (
{ system, ... }:
home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
self.overlays.default
self.overlays.linux
# fenix.overlays.default
];
};
extraSpecialArgs = {
username = linux-user;
};
modules = modules { user = linux-user; };
}
);
flake.homeConfigurations.${mac-user} = withSystem "aarch64-darwin" (
{ system, ... }:
home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
self.overlays.default
# fenix.overlays.default
];
};
extraSpecialArgs = {
username = mac-user;
};
modules = modules { user = mac-user; };
}
);
}
);
}