-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
96 lines (90 loc) · 2.58 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
{
description = "Niklas dotfiles";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/release-24.05";
darwin = {
# nix will normally use the nixpkgs defined in home-managers inputs, we only want one copy of nixpkgs though
url = "github:niklasravnsborg/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin-custom-icons = {
url = "github:ryanccn/nix-darwin-custom-icons";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
dotfiles-secrets = {
url = "git+ssh://git@github.com/niklasravnsborg/dotfiles-secrets?shallow=1";
flake = false;
};
};
outputs =
{
nixpkgs,
darwin,
darwin-custom-icons,
home-manager,
sops-nix,
...
}@inputs:
let
sharedModules = [
inputs.sops-nix.homeManagerModules.sops
./tmux/tmux-module.nix
];
secretsPath = builtins.toString inputs.dotfiles-secrets;
in
{
formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.nixfmt-rfc-style;
darwinConfigurations."Niklas-Machbuch" = darwin.lib.darwinSystem {
system = "aarch64-darwin"; # "x86_64-darwin" if you're using a pre M1 mac
specialArgs = {
inherit secretsPath;
};
modules = [
./nix/darwin.nix
sops-nix.darwinModules.sops
darwin-custom-icons.darwinModules.default
home-manager.darwinModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
users.nik = import ./nix/home.nix;
inherit sharedModules;
extraSpecialArgs = {
inherit secretsPath;
};
};
}
];
};
nixosConfigurations."Niklas-Workstation" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit secretsPath;
};
modules = [
./nixos/configuration.nix
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.nik = import ./nix/home.nix;
inherit sharedModules;
extraSpecialArgs = {
inherit secretsPath;
};
};
}
];
};
};
}