-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
120 lines (106 loc) · 3.59 KB
/
flake.nix
File metadata and controls
120 lines (106 loc) · 3.59 KB
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
{
description = "Machine configurations with nix";
inputs = {
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-25.11-darwin";
nixpkgs-nixos.url = "github:NixOs/nixpkgs/nixos-25.11";
darwin.url = "github:lnl7/nix-darwin/nix-darwin-25.11";
darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager = {
url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
flake-utils.url = "github:numtide/flake-utils";
nix-kubectl-gs.url = "github:swoehrl-mw/nix-kubectl-gs";
};
outputs = { self, home-manager, darwin, ... }@inputs:
let
system.silicon = "aarch64-darwin";
user.work = "schmitt";
user.m1 = "lockejan";
system.raspbi = "aarch64-linux";
pkgs = import inputs.nixpkgs {
system = system.silicon;
config.allowUnfree = true;
};
pkgsUnstable = import inputs.nixpkgs-unstable {
system = system.silicon;
config.allowUnfree = true;
};
stateVersion = "25.11";
# Common home-manager modules shared across configurations
commonHomeModules = [
./home-manager/home.nix
./home-manager/modules/alacritty.nix
./home-manager/modules/cli.nix
./home-manager/modules/git.nix
./home-manager/modules/gpg.nix
./home-manager/modules/kitty.nix
./home-manager/modules/k8s.nix
./home-manager/modules/neovim.nix
./home-manager/modules/ssh.nix
./home-manager/modules/tmux.nix
];
# Common special arguments passed to all home-manager configurations
commonExtraSpecialArgs = {
inherit inputs;
inherit stateVersion;
inherit pkgsUnstable;
};
in
{
darwinConfigurations = {
m1 = darwin.lib.darwinSystem {
modules = [
home-manager.darwinModules.home-manager
./darwin/configuration.nix
{ nixpkgs.config.allowUnfree = true; }
{
home-manager = {
users.${user.m1}.imports = commonHomeModules ++ [
# Machine-specific modules
./home-manager/modules/osx.nix
./home-manager/machines/personal.nix
];
extraSpecialArgs = commonExtraSpecialArgs // {
username = user.m1;
};
};
}
];
specialArgs = {
# inherit inputs;
inherit pkgsUnstable;
username = user.m1;
};
system = system.silicon;
};
};
homeConfigurations."${user.work}" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
# Specify your home configuration modules here, for example,
# the path to your home.nix.
modules = commonHomeModules ++ [
# Machine-specific modules
./home-manager/modules/osx.nix
./home-manager/machines/work.nix
];
# Optionally use extraSpecialArgs
# to pass through arguments to home.nix
extraSpecialArgs = commonExtraSpecialArgs // {
username = user.work;
};
};
nixosConfigurations = {
nixos-raspbi = inputs.nixpkgs-nixos.lib.nixosSystem {
system = system.raspbi;
modules = [
./nixos/configuration.nix
inputs.nixos-hardware.nixosModules.raspberry-pi-4
];
};
};
};
}