Created
September 22, 2024 13:31
-
-
Save nonsleepr/cfabbb13c9def2cdfc6151ca7b1582ef to your computer and use it in GitHub Desktop.
LXD container for AdGuardHome capable running with cgroups v1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install with: | |
# incus image import --alias nixos/adguard-home \ | |
# $(nix build .#nixosConfigurations.adguard-home.config.system.build.metadata --print-out-paths)/tarball/nixos-system-x86_64-linux.tar.xz \ | |
# $(nix build .#nixosConfigurations.adguard-home.config.system.build.tarball --print-out-paths)/tarball/nixos-system-x86_64-linux.tar.xz | |
{ | |
description = "AdGuardHome Container"; | |
inputs = { | |
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; # The systemd supporting cgroups v1 | |
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | |
}; | |
outputs = { self, nixpkgs, nixpkgs-unstable, ... }: | |
{ | |
nixosConfigurations = { | |
adguard-home = nixpkgs.lib.nixosSystem rec { | |
system = "x86_64-linux"; | |
modules = [ | |
"${nixpkgs}/nixos/modules/virtualisation/lxc-container.nix" | |
( | |
{ pkgs, ... }: | |
{ | |
nixpkgs.overlays = [ | |
(self: super: { | |
adguardhome = (import nixpkgs-unstable { inherit system; }).adguardhome; | |
}) | |
]; | |
services.adguardhome = { | |
enable = true; | |
mutableSettings = true; | |
}; | |
services.sshd.enable = false; | |
networking.firewall.enable = false; | |
} | |
) | |
]; | |
}; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment