-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
133 lines (116 loc) · 4.14 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nur.url = "github:nix-community/NUR";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-overlay.url = "github:nix-community/emacs-overlay";
myDrvs.url = "github:huuff/derivations";
secrets.url = "git+ssh://git@github.com/huuff/secrets.git";
scripts = {
url = "github:huuff/nix-scripts";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-soapui.url = "github:huuff/nix-soapui";
nix-portable-shell.url = "github:huuff/nix-portable-shell";
nix-home-modules = {
url = "github:huuff/nix-home-modules";
inputs.nixpkgs.follows = "nixpkgs";
};
hm-kubernetes.url = "github:huuff/hm-kubernetes";
nix-index-database.url = "github:Mic92/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, nixpkgs-unstable, nix-soapui, home-manager, nix-home-modules, nur, emacs-overlay, myDrvs, secrets, nix-portable-shell, hm-kubernetes, scripts, nix-index-database}:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
unstablePkgs = import nixpkgs-unstable { inherit system; };
mkConfig = host: user: extraModules: nixpkgs.lib.nixosSystem rec {
inherit system;
specialArgs = {
inherit user emacs-overlay nur secrets unstablePkgs;
scripts = scripts.packages.x86_64-linux;
myModules = myDrvs.nixosModules;
myHomeModules = nix-home-modules.homeManagerModules;
# TODO: Maybe it should be in an overlay?
derivations = {
soapui57 = nix-soapui.packages.x86_64-linux.default;
};
modules = {
shell = nix-portable-shell.nixosModules.shell;
kubernetes = hm-kubernetes.nixosModules.kubernetes;
};
};
modules = [
host
# For using comma (,) TODO: Maybe put it somewhere else?
# TODO: The official example (/~https://github.com/nix-community/nix-index-database) puts nix-index in home-manager
nix-index-database.nixosModules.nix-index
{
programs.nix-index-database.comma.enable = true;
# XXX: Can't build it without it
programs.command-not-found.enable = false;
}
{
# Set the registry nixpkgs to the one currently in use
# This will avoid redownloading nixpkgs on every nix operation
nix.registry.nixpkgs.flake = nixpkgs;
# The netrc file can contain credentials for sources from which to download
# nix derivations
nix.extraOptions = ''
netrc-file = /etc/nix/netrc
'';
}
./nixos/user.nix
./nixos/fonts.nix
./nixos/xorg.nix
./nixos/audio.nix
./nixos/java.nix
./nixos/nixconf.nix
./nixos/ssh.nix
./nixos/virtualization.nix
./nixos/gnupg.nix
./nixos/scanner.nix
{
# XXX: I have it enabled in home-manager but that seems to not be enough
# because of an assertion somewhere
programs.zsh.enable = true;
}
# {
# # TODO honestly I need something better than just putting all of my host configs here
# services.udev.enable = true;
# imports = [ ./home/screens.nix ];
# }
home-manager.nixosModules.home-manager
{
home-manager.useUserPackages = true;
home-manager.users.${user} = import ./home/home.nix;
home-manager.extraSpecialArgs = specialArgs;
}
{
boot.supportedFilesystems = [ "ntfs" ];
}
] ++ extraModules;
};
in
{
nixosConfigurations = {
zen = mkConfig ./nixos/hosts/zen/configuration.nix "haf"
[
./nixos/wireless.nix { haf.networking.interface = "wlp1s0"; }
./nixos/bluetooth.nix
];
};
# TODO formatting and pre-commit
devShells.${system}.default = with pkgs; mkShell {
buildInputs = [
nil
git-crypt
];
};
};
}