-
Notifications
You must be signed in to change notification settings - Fork 1
/
base.nix
97 lines (87 loc) · 2.69 KB
/
base.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
# Configuration loaded for all NixOS hosts
{ config, pkgs, nixpkgs-stable, lib, stdenv, nur, nixpkgs-wazuh-agent, ... }:
let
system = pkgs.system;
wazuhPkg = pkgs.callPackage ./pkgs/wazuh.nix {};
stable-pkgs = import nixpkgs-stable {
inherit system;
config.allowUnfree = true;
};
in {
imports = [
./roles/virtualization/multiarch.nix
"${nixpkgs-wazuh-agent}/nixos/modules/services/security/wazuh/wazuh.nix"
];
# Allow olm for gomuks until issues are resolved
nixpkgs.config.permittedInsecurePackages = [
"olm-3.2.16"
];
# Enable flakes
nix.extraOptions = ''
extra-experimental-features = nix-command flakes
'';
# Automatically optimize store for better storage
nix.settings = {
auto-optimise-store = true;
trusted-users = [
"heywoodlh"
];
substituters = [
"https://nix-community.cachix.org"
"http://attic.barn-banana.ts.net/nixos"
"https://heywoodlh-helix.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nixos:ZffGHlb0Ng3oXu8cLT9msyOB/datC4r+/K9nImONIec=" # attic
"heywoodlh-helix.cachix.org-1:qHDV95nI/wX9pidAukzMzgeok1415rgjMAXinDsbb7M="
];
};
# Stable, system-wide packages
environment.systemPackages = with stable-pkgs; [
gptfdisk
(pkgs.writeShellScriptBin "nixos-switch" ''
[[ -d /home/heywoodlh/opt/nixos-configs ]] || ${pkgs.git}/bin/git clone https://github.com/heywoodlh/nixos-configs /home/heywoodlh/opt/nixos-configs
sudo chown -R heywoodlh /home/heywoodlh/opt/nixos-configs
sudo ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake /home/heywoodlh/opt/nixos-configs#$(hostname) $@
'')
mosh
];
# Enable appimage
programs.appimage = {
enable = true;
binfmt = true;
};
# Allow non-free applications to be installed
nixpkgs.config.allowUnfree = true;
home-manager = {
useGlobalPkgs = true;
extraSpecialArgs = {
inherit nur;
};
users.heywoodlh = { ... }: {
home.activation.docker-rootless-context = ''
if ! ${pkgs.docker-client}/bin/docker context ls | grep -iq rootless
then
${pkgs.docker-client}/bin/docker context create rootless --docker "host=unix:///run/user/1000/docker.sock" &> /dev/null || true
${pkgs.docker-client}/bin/docker context use rootless
fi
'';
};
};
# Wazuh configuration
services.wazuh = {
package = wazuhPkg;
agent = {
enable = true;
managerIP = "wazuh.barn-banana.ts.net";
};
};
# Enable gnupg agent
programs.gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-curses;
};
# NixOS version
system.stateVersion = "24.11";
}