-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathflake.nix
118 lines (108 loc) · 3.5 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
{
description = "my dotfiles";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
# my custom neovim
feovim.url = "github:breuerfelix/feovim";
krewfile.url = "github:brumhard/krewfile";
# sketchybar config
sketchybar = {
url = "github:FelixKratz/dotfiles";
flake = false;
};
};
outputs = { self, nixpkgs, darwin, home-manager, ... }@inputs:
let
nixpkgsConfig = {
allowUnfree = true;
allowUnsupportedSystem = false;
};
unstable = import inputs.nixpkgs-unstable { inherit system; };
overlays = with inputs; [ feovim.overlay krewfile.overlay ];
user = "felix";
hostname = "brummi";
system = "aarch64-darwin";
in {
formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt;
# nix-darwin with home-manager for macOS
darwinConfigurations.${hostname} = darwin.lib.darwinSystem {
inherit system;
# makes all inputs availble in imported files
specialArgs = { inherit inputs; inherit unstable; };
modules = [
inputs.nix-index-database.darwinModules.nix-index
./darwin
({ pkgs, inputs, ... }: {
nixpkgs.config = nixpkgsConfig;
nixpkgs.overlays = overlays;
system = {
stateVersion = 4;
configurationRevision = self.rev or self.dirtyRev or null;
};
users.users.${user} = {
home = "/Users/${user}";
shell = pkgs.zsh;
};
networking = {
computerName = hostname;
hostName = hostname;
localHostName = hostname;
};
nix = {
# enable flakes per default
package = pkgs.nixVersions.stable;
gc = {
automatic = false;
user = user;
};
settings = {
allowed-users = [ user ];
experimental-features = [ "nix-command" "flakes" ];
warn-dirty = false;
# produces linking issues when updating on macOS
# https://github.com/NixOS/nix/issues/7273
auto-optimise-store = false;
};
};
})
home-manager.darwinModule
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
# makes all inputs available in imported files for hm
extraSpecialArgs = {
inherit inputs;
inherit unstable;
pkgs-zsh-fzf-tab =
import inputs.nixpkgs-zsh-fzf-tab { inherit system; };
};
users.${user} = { ... }:
with inputs; {
imports = [ feovim.feovim ./home-manager ./shell ];
home.stateVersion = "23.11";
# from feovim
feovim = {
ideavim.enable = true;
vscode.enable = true;
};
};
};
}
];
};
};
}