-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
140 lines (133 loc) · 4.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
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
135
136
137
138
139
140
{
description = "My nix configuration";
inputs = {
flake-utils = {
url = "github:numtide/flake-utils";
};
nixpkgs = {
url = "github:nixos/nixpkgs/nixos-24.11";
};
nixpkgs-unstable = {
url = "github:nixos/nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
color-scheme-sync = {
url = "github:bash/color-scheme-sync";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = {
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
mac-app-util = {
url = "github:hraban/mac-app-util";
# This does not work due to broken packages
# inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs:
{
nixosConfigurations =
let
system = "x86_64-linux";
config = {
allowUnfree = true;
input-fonts.acceptLicense = true;
permittedInsecurePackages = [
"dotnet-sdk-7.0.410"
];
};
pkgs = import inputs.nixpkgs { inherit system config; };
pkgs-unstable = import inputs.nixpkgs-unstable { inherit system config; };
nixosConfig =
{
nixosModule,
homeManagerModule ? { },
}:
inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
inherit pkgs pkgs-unstable;
};
modules = [
./common/nixos.nix
nixosModule
inputs.color-scheme-sync.nixosModules.default
inputs.home-manager.nixosModules.home-manager
{
home-manager.users.jeremy.imports = [
./common/home-manager.nix
./common/nixos-home-manager.nix
homeManagerModule
];
home-manager.useGlobalPkgs = true;
home-manager.extraSpecialArgs = {
inherit pkgs-unstable;
};
}
];
};
in
{
"volt-nixos" = nixosConfig {
nixosModule = ./volt/nixos-configuration.nix;
homeManagerModule = ./volt/home-manager.nix;
};
"zephyr-nixos" = nixosConfig { nixosModule = ./zephyr/nixos-configuration.nix; };
};
darwinConfigurations =
let
system = "aarch64-darwin";
config = {
allowUnfree = true;
input-fonts.acceptLicense = true;
};
pkgs = import inputs.nixpkgs { inherit system config; };
pkgs-unstable = import inputs.nixpkgs-unstable { inherit system config; };
in
{
"work-macbook" = inputs.darwin.lib.darwinSystem {
inherit system;
modules = [
{
nix.useDaemon = true;
nix.settings = {
trusted-users = [ "jeremy" ];
experimental-features = [
"nix-command"
"flakes"
];
};
system.stateVersion = 4;
nixpkgs.config = config;
environment.shells = [ pkgs.zsh ];
programs.zsh.enable = true;
users.users.jeremy.home = "/Users/jeremy";
fonts.packages = [ pkgs.jetbrains-mono ];
}
inputs.home-manager.darwinModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.jeremy.imports = [
./common/home-manager.nix
./darwin-home-manager.nix
];
extraSpecialArgs = {
inherit pkgs-unstable;
};
sharedModules = [ inputs.mac-app-util.homeManagerModules.default ];
};
}
];
};
};
}
// inputs.flake-utils.lib.eachDefaultSystem (system: {
formatter = inputs.nixpkgs-unstable.legacyPackages.${system}.nixfmt-rfc-style;
});
}