b543e8f5e9
For device discovery over local network. Trying this out because ESPHome is not able to locate wirelessly connected devices for OTA updates.
190 lines
5.7 KiB
Nix
190 lines
5.7 KiB
Nix
{
|
|
description = "NixOS configuration (flake edition)";
|
|
|
|
inputs = {
|
|
nixpkgs = {
|
|
url = "github:nixos/nixpkgs/nixos-unstable";
|
|
};
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
agenix = {
|
|
url = "github:ryantm/agenix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
|
deploy-rs.url = "github:serokell/deploy-rs";
|
|
|
|
nixpkgs-pihole.url = "github:williamvds/nixpkgs/add_pihole";
|
|
};
|
|
|
|
outputs =
|
|
{ self
|
|
, nixpkgs
|
|
, home-manager
|
|
, agenix
|
|
, nixos-hardware
|
|
, deploy-rs
|
|
, nixpkgs-pihole
|
|
, ...
|
|
}:
|
|
let
|
|
common-modules = [
|
|
./cachix.nix
|
|
./modules/nix.nix
|
|
./modules/common.nix
|
|
./modules/fish.nix
|
|
];
|
|
in
|
|
{
|
|
overlay = final: prev: {
|
|
inherit (nixpkgs-pihole.legacyPackages.${prev.system})
|
|
pihole pihole-ftl pihole-adminlte;
|
|
};
|
|
|
|
homeConfigurations."payasrelekar" = home-manager.lib.homeManagerConfiguration {
|
|
pkgs = import nixpkgs {
|
|
system = "x86_64-darwin";
|
|
};
|
|
modules = [ ./hosts/charles/home.nix ];
|
|
|
|
# Optionally use extraSpecialArgs
|
|
# to pass through arguments to home.nix
|
|
};
|
|
|
|
|
|
nixosConfigurations = {
|
|
# The Workhorse: WSL2 edition
|
|
hermes = nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = common-modules ++ [
|
|
|
|
# Modules and module config
|
|
./modules/users.nix
|
|
./modules/fonts.nix
|
|
./modules/plasma-desktop.nix
|
|
./modules/audio.nix
|
|
./modules/dev-common.nix
|
|
|
|
# Host-specific config
|
|
./hosts/hermes/configuration.nix
|
|
./hosts/hermes/syncthing.nix
|
|
agenix.nixosModules.age
|
|
./hosts/hermes/secrets/agenix.nix
|
|
|
|
# User-specific config
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
users = {
|
|
payas = import ./hosts/hermes/home.nix;
|
|
root = import ./modules/root-home.nix;
|
|
};
|
|
};
|
|
}
|
|
];
|
|
};
|
|
|
|
# GPD MicroPC
|
|
phoebe = nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = common-modules ++ [
|
|
|
|
# Modules and module config
|
|
./modules/users.nix
|
|
./modules/fonts.nix
|
|
./modules/plasma-desktop.nix
|
|
./modules/audio.nix
|
|
./modules/dev-common.nix
|
|
|
|
# Host-specific config
|
|
nixos-hardware.nixosModules.gpd-micropc
|
|
./hosts/phoebe/configuration.nix
|
|
./hosts/phoebe/syncthing.nix
|
|
agenix.nixosModules.age
|
|
./hosts/phoebe/secrets/agenix.nix
|
|
|
|
# User-specific config
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
users = {
|
|
payas = import ./hosts/phoebe/home.nix;
|
|
root = import ./modules/root-home.nix;
|
|
};
|
|
};
|
|
}
|
|
];
|
|
};
|
|
|
|
# My Pi
|
|
bebop = nixpkgs.lib.nixosSystem {
|
|
system = "aarch64-linux";
|
|
modules = common-modules ++ [
|
|
|
|
{ nixpkgs.overlays = [ self.overlay ]; }
|
|
"${nixpkgs-pihole}/nixos/modules/services/networking/pihole-ftl.nix"
|
|
"${nixpkgs-pihole}/nixos/modules/services/web-apps/pihole-adminlte.nix"
|
|
|
|
# Modules and module config
|
|
./modules/mail.nix
|
|
./modules/monitoring/monitoring.nix
|
|
./modules/books.nix
|
|
./modules/paperless.nix
|
|
./modules/minio.nix
|
|
./modules/plausible.nix
|
|
./modules/vaultwarden.nix
|
|
./modules/hledger.nix
|
|
./modules/etesync.nix
|
|
./modules/uptime_kuma.nix
|
|
./modules/rss.nix
|
|
./modules/wiki.nix
|
|
|
|
# Host-specific config
|
|
nixos-hardware.nixosModules.raspberry-pi-4
|
|
./hosts/bebop/configuration.nix
|
|
./hosts/bebop/syncthing.nix
|
|
./hosts/bebop/navidrome.nix
|
|
./hosts/bebop/pihole.nix
|
|
./hosts/bebop/ssh.nix
|
|
./hosts/bebop/cloudflared.nix
|
|
./hosts/bebop/gitea.nix
|
|
|
|
agenix.nixosModules.age
|
|
./hosts/bebop/secrets/agenix.nix
|
|
|
|
# User-specific config : Home-manager
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
users.payas = import ./hosts/bebop/home.nix;
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
|
|
deploy.nodes = {
|
|
bebop = {
|
|
hostname = "bebop";
|
|
fastConnection = true;
|
|
remoteBuild = true;
|
|
profiles.system = {
|
|
sshUser = "payas";
|
|
user = "root";
|
|
path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.bebop;
|
|
};
|
|
};
|
|
};
|
|
|
|
# This is highly advised, and will prevent many possible mistakes
|
|
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
|
|
};
|
|
}
|