Skip to content

Commit 2d851a3

Browse files
authored
feat: add some apps (#10)
1 parent c25f96c commit 2d851a3

File tree

33 files changed

+616
-443
lines changed

33 files changed

+616
-443
lines changed

flake.lock

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@
4141

4242
# Color scheme
4343
stylix.url = "github:danth/stylix";
44+
45+
crowdsec = {
46+
url = "git+https://codeberg.org/kampka/nix-flake-crowdsec.git";
47+
inputs.nixpkgs.follows = "nixpkgs";
48+
};
49+
50+
nixunits = {
51+
url = "git+https://git.aevoo.com/aevoo/os/nixunits.git";
52+
inputs.nixpkgs.follows = "nixpkgs";
53+
};
4454
};
4555

4656
outputs =
@@ -201,9 +211,57 @@
201211
modules = [ inputs.sops-nix.nixosModules.sops ./hosts/rpi40 ];
202212
};
203213

204-
srvhoma = nixpkgs.lib.nixosSystem {
214+
hype16 = nixpkgs.lib.nixosSystem {
205215
specialArgs = { inherit inputs outputs; };
206-
modules = [ inputs.sops-nix.nixosModules.sops ./hosts/srvhoma ];
216+
modules = [
217+
inputs.sops-nix.nixosModules.sops
218+
inputs.crowdsec.nixosModules.crowdsec
219+
inputs.crowdsec.nixosModules.crowdsec-firewall-bouncer
220+
inputs.nixunits.nixosModules.default
221+
./hosts/hype16
222+
223+
home-manager.nixosModules.home-manager
224+
{
225+
home-manager = {
226+
useGlobalPkgs = true;
227+
useUserPackages = true;
228+
verbose = true;
229+
extraSpecialArgs = { inputs = self.inputs; };
230+
users = {
231+
root = import ./users/root/hype16.nix;
232+
badele = {
233+
imports = [
234+
nur.nixosModules.nur
235+
stylix.homeManagerModules.stylix
236+
./users/badele/hype16.nix
237+
];
238+
};
239+
};
240+
};
241+
}
242+
];
243+
};
244+
245+
#######################################################################
246+
# Hypervised applications
247+
#######################################################################
248+
249+
gw-dmz = nixpkgs.lib.nixosSystem {
250+
system = "x86_64-linux";
251+
modules = [
252+
"${nixpkgs}/nixos/modules/virtualisation/lxc-container.nix"
253+
inputs.sops-nix.nixosModules.sops
254+
./hosts/hypervised/gw-dmz
255+
];
256+
};
257+
258+
trilium = nixpkgs.lib.nixosSystem {
259+
system = "x86_64-linux";
260+
modules = [
261+
"${nixpkgs}/nixos/modules/virtualisation/lxc-container.nix"
262+
inputs.sops-nix.nixosModules.sops
263+
./hosts/hypervised/trilium
264+
];
207265
};
208266
};
209267

hosts/badxps/default.nix

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
##########################################################
1+
# #########################################################
22
# NIXOS (hosts)
33
##########################################################
4-
{ inputs
5-
, config
6-
, pkgs
7-
, lib
8-
, ...
9-
}:
10-
{
4+
{ inputs, config, pkgs, lib, ... }: {
115
imports = [
126
inputs.hardware.nixosModules.dell-xps-15-9570-intel
137
./hardware-configuration.nix
@@ -24,14 +18,13 @@
2418
../../nix/nixos/features/homelab
2519
../../nix/nixos/features/system/containers.nix
2620

27-
# Virtualisation
2821
../../nix/nixos/features/virtualisation/incus.nix
2922
../../nix/nixos/features/virtualisation/libvirt.nix
3023

3124
# Desktop
3225
../../nix/nixos/features/system/bluetooth.nix
3326
../../nix/nixos/features/desktop/wm/xorg/lightdm.nix
34-
#
27+
3528
# # Roles
3629
../../nix/nixos/roles # Automatically load service from <host.modules> sectionn from `homelab.json` file
3730
];
@@ -40,6 +33,9 @@
4033
# Boot
4134
####################################
4235

36+
# Docker
37+
virtualisation.docker.storageDriver = "zfs";
38+
4339
nixpkgs.config = {
4440
# allowBroken = true;
4541
# nvidia.acceptLicense = true;
@@ -51,7 +47,7 @@
5147
"i915.force_probe=3e9b"
5248
"mem_sleep_default=deep"
5349
"acpi_osi=!"
54-
"acpi_osi=\"Windows 2015\""
50+
''acpi_osi="Windows 2015"''
5551
"acpi_backlight=vendor"
5652
];
5753

@@ -72,7 +68,15 @@
7268
};
7369

7470
initrd = {
75-
availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "sr_mod" "rtsx_pci_sdmmc" ];
71+
availableKernelModules = [
72+
"xhci_pci"
73+
"ahci"
74+
"nvme"
75+
"usb_storage"
76+
"sd_mod"
77+
"sr_mod"
78+
"rtsx_pci_sdmmc"
79+
];
7680
kernelModules = [ ];
7781
};
7882
};
@@ -85,7 +89,6 @@
8589
#hardware.nvidia.package = boot.kernelPackages.nvidiaPackages.stable;
8690
#hardware.nvidia.modesetting.enable = true;
8791

88-
8992
####################################
9093
# host profile
9194
####################################
@@ -101,16 +104,16 @@
101104
# Hardware
102105
####################################
103106

104-
105107
# Enable OpenGL acceleration
106108
hardware.graphics.enable = true;
107109

108110
# intel
109111
hardware.opengl = {
110112
enable = true;
111-
extraPackages = with pkgs; [
112-
vpl-gpu-rt # for newer GPUs on NixOS >24.05 or unstable
113-
];
113+
extraPackages = with pkgs;
114+
[
115+
vpl-gpu-rt # for newer GPUs on NixOS >24.05 or unstable
116+
];
114117
};
115118

116119
# Nvidia
@@ -141,7 +144,8 @@
141144
services.pipewire.enable = false;
142145
hardware.pulseaudio = {
143146
enable = true;
144-
support32Bit = true; ## If compatibility with 32-bit applications is desired
147+
support32Bit =
148+
true; # # If compatibility with 32-bit applications is desired
145149
#extraConfig = "load-module module-combine-sink";
146150
};
147151

@@ -152,9 +156,7 @@
152156
# Programs
153157
####################################
154158
powerManagement.powertop.enable = true;
155-
programs = {
156-
dconf.enable = true;
157-
};
159+
programs = { dconf.enable = true; };
158160

159161
####################################
160162
# Secrets

hosts/bootstore/default.nix

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
{ lib
2-
, pkgs
3-
, ...
4-
}:
5-
{
1+
{ lib, pkgs, ... }: {
62
imports = [
73
./hardware-configuration.nix
84

hosts/demovm/default.nix

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
##########################################################
1+
# #########################################################
22
# NIXOS (hosts)
33
##########################################################
4-
{ inputs
5-
, config
6-
, pkgs
7-
, lib
8-
, ...
9-
}:
10-
{
4+
{ inputs, config, pkgs, lib, ... }: {
115
imports = [
126
./hardware-configuration.nix
137
./disks.nix
@@ -17,6 +11,7 @@
1711
# /home/badele/ghq/github.com/badele/nix-homelab/nix/nixos/features/commons/sops.nix
1812
# Secret loaded from hosts/${config.networking.hostName}/secrets.yml";
1913

14+
# Users
2015
../root.nix
2116
../demo.nix
2217

@@ -35,11 +30,8 @@
3530
# Boot
3631
####################################
3732

38-
3933
boot = {
40-
kernelParams = [
41-
"mem_sleep_default=deep"
42-
];
34+
kernelParams = [ "mem_sleep_default=deep" ];
4335
blacklistedKernelModules = [ ];
4436
kernelModules = [ "kvm-intel" ];
4537
supportedFilesystems = [ "btrfs" ];
@@ -57,15 +49,22 @@
5749

5850
# Qemu support
5951
initrd = {
60-
availableKernelModules = [ "virtio_net" "virtio_pci" "virtio_mmio" "virtio_blk" "virtio_scsi" "9p" "9pnet_virtio" ];
52+
availableKernelModules = [
53+
"virtio_net"
54+
"virtio_pci"
55+
"virtio_mmio"
56+
"virtio_blk"
57+
"virtio_scsi"
58+
"9p"
59+
"9pnet_virtio"
60+
];
6161
kernelModules = [ "virtio_balloon" "virtio_console" "virtio_rng" ];
62-
postDeviceCommands = lib.mkIf (!config.boot.initrd.systemd.enable)
63-
''
64-
# Set the system time from the hardware clock to work around a
65-
# bug in qemu-kvm > 1.5.2 (where the VM clock is initialised
66-
# to the *boot time* of the host).
67-
hwclock -s
68-
'';
62+
postDeviceCommands = lib.mkIf (!config.boot.initrd.systemd.enable) ''
63+
# Set the system time from the hardware clock to work around a
64+
# bug in qemu-kvm > 1.5.2 (where the VM clock is initialised
65+
# to the *boot time* of the host).
66+
hwclock -s
67+
'';
6968
};
7069
};
7170

@@ -91,7 +90,8 @@
9190
services.pipewire.enable = false;
9291
hardware.pulseaudio = {
9392
enable = true;
94-
support32Bit = true; ## If compatibility with 32-bit applications is desired
93+
support32Bit =
94+
true; # # If compatibility with 32-bit applications is desired
9595
#extraConfig = "load-module module-combine-sink";
9696
};
9797

@@ -102,9 +102,7 @@
102102
# Programs
103103
####################################
104104
powerManagement.powertop.enable = true;
105-
programs = {
106-
dconf.enable = true;
107-
};
105+
programs = { dconf.enable = true; };
108106

109107
nixpkgs.hostPlatform.system = "x86_64-linux";
110108
system.stateVersion = "24.05";

0 commit comments

Comments
 (0)