Flake lock file updates:
• Updated input 'disko':
'github:nix-community/disko/af087d076d3860760b3323f6b583f4d828c1ac17' (2025-11-04)
→ 'github:nix-community/disko/2055a08fd0e2fd41318279a5355eb8a161accf26' (2025-11-28)
• Updated input 'nixpkgs':
'https://releases.nixos.org/nixos/25.05/nixos-25.05.813095.1c8ba8d3f763/nixexprs.tar.xz?lastModified=1763948260&narHash=sha256-zZk7fn2ARAqmLwaYTpxBJmj81KIdz11NiWt7ydHHD/M%3D&rev=1c8ba8d3f7634acac4a2094eef7c32ad9106532c' (2025-11-24)
→ 'https://releases.nixos.org/nixos/25.05/nixos-25.05.813221.9a7b80b6f82a/nixexprs.tar.xz?lastModified=1764316264&narHash=sha256-UcoE0ISg9Nnzx/2n7VvQl3fRsLg%2BDcVa/ZGf/DZNHbs%3D&rev=9a7b80b6f82a71ea04270d7ba11b48855681c4b0' (2025-11-28)
• Updated input 'nixpkgs-unstable':
'https://releases.nixos.org/nixos/unstable/nixos-25.11pre900642.050e09e09111/nixexprs.tar.xz?lastModified=1763835633&narHash=sha256-nzRnw0UkYQpDm0o20AKvG/5oHCXy5qEGOsFAVhB5NmA%3D&rev=050e09e091117c3d7328c7b2b7b577492c43c134' (2025-11-22)
→ 'https://releases.nixos.org/nixos/unstable/nixos-26.05pre903292.2fad6eac6077/nixexprs.tar.xz?lastModified=1764242076&narHash=sha256-6/1EG2fiKvLoUJ8FD7ymRx87e4zcfJTzAdUYgo4CDLA%3D&rev=2fad6eac6077f03fe109c4d4eb171cf96791faa4' (2025-11-27)
• Updated input 'sops-nix':
'github:Mic92/sops-nix/877bb495a6f8faf0d89fc10bd142c4b7ed2bcc0b' (2025-11-20)
→ 'github:Mic92/sops-nix/c482a1c1bbe030be6688ed7dc84f7213f304f1ec' (2025-11-24)
184 lines
4.5 KiB
Nix
184 lines
4.5 KiB
Nix
{
|
|
description = "tlater.net host configuration";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "https://channels.nixos.org/nixos-25.05/nixexprs.tar.xz";
|
|
nixpkgs-unstable.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz";
|
|
|
|
## Nix/OS utilities
|
|
|
|
disko = {
|
|
url = "github:nix-community/disko";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
deploy-rs = {
|
|
url = "github:serokell/deploy-rs";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
sops-nix = {
|
|
url = "github:Mic92/sops-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
## Programs
|
|
|
|
flint = {
|
|
url = "github:NotAShelf/flint";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
## Services
|
|
|
|
foundryvtt = {
|
|
url = "github:reckenrode/nix-foundryvtt";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
sonnenshift = {
|
|
url = "git+ssh://git@github.com/sonnenshift/battery-manager";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs";
|
|
crate2nix.inputs = {
|
|
flake-compat.follows = "deploy-rs/flake-compat";
|
|
devshell.inputs.flake-utils.follows = "deploy-rs/utils";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
sops-nix,
|
|
...
|
|
}@inputs:
|
|
let
|
|
system = "x86_64-linux";
|
|
|
|
vm = nixpkgs.lib.nixosSystem {
|
|
inherit system;
|
|
specialArgs.flake-inputs = inputs;
|
|
|
|
modules = [
|
|
./configuration
|
|
./configuration/hardware-specific/vm.nix
|
|
];
|
|
};
|
|
|
|
# deploy-rs unfortunately uses an `import nixpkgs`, and its
|
|
# library functions depend on an instantiated nixpkgs, so we
|
|
# can't get around multi-nixpkgs-eval.
|
|
inherit
|
|
(import nixpkgs {
|
|
inherit system;
|
|
overlays = [
|
|
inputs.deploy-rs.overlays.default
|
|
(_: prev: {
|
|
deploy-rs = {
|
|
inherit (nixpkgs.legacyPackages.${system}) deploy-rs;
|
|
inherit (prev.deploy-rs) lib;
|
|
};
|
|
})
|
|
];
|
|
})
|
|
deploy-rs
|
|
;
|
|
in
|
|
{
|
|
##################
|
|
# Configurations #
|
|
##################
|
|
nixosConfigurations = {
|
|
# The actual system definition
|
|
hetzner-1 = nixpkgs.lib.nixosSystem {
|
|
inherit system;
|
|
specialArgs.flake-inputs = inputs;
|
|
|
|
modules = [
|
|
./configuration
|
|
./configuration/hardware-specific/hetzner
|
|
];
|
|
};
|
|
};
|
|
|
|
############################
|
|
# Deployment configuration #
|
|
############################
|
|
deploy.nodes = {
|
|
hetzner-1 = {
|
|
hostname = "116.202.158.55";
|
|
|
|
profiles.system = {
|
|
user = "root";
|
|
path = deploy-rs.lib.activate.nixos self.nixosConfigurations.hetzner-1;
|
|
};
|
|
|
|
sshUser = "tlater";
|
|
sshOpts = [
|
|
"-p"
|
|
"2222"
|
|
"-o"
|
|
"ForwardAgent=yes"
|
|
];
|
|
};
|
|
};
|
|
|
|
#########
|
|
# Tests #
|
|
#########
|
|
checks = import ./checks { flake-inputs = inputs; };
|
|
|
|
###########################
|
|
# Garbage collection root #
|
|
###########################
|
|
|
|
packages.${system} = {
|
|
default = vm.config.system.build.vm;
|
|
}
|
|
// import ./pkgs {
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
flake-inputs = inputs;
|
|
};
|
|
|
|
###################
|
|
# Utility scripts #
|
|
###################
|
|
apps.${system} = {
|
|
default = self.apps.${system}.run-vm;
|
|
|
|
run-vm = {
|
|
type = "app";
|
|
program =
|
|
(nixpkgs.legacyPackages.${system}.writeShellScript "" ''
|
|
${vm.config.system.build.vm.outPath}/bin/run-testvm-vm
|
|
'').outPath;
|
|
};
|
|
};
|
|
|
|
###########################
|
|
# Development environment #
|
|
###########################
|
|
devShells.${system} = {
|
|
default = nixpkgs.legacyPackages.${system}.mkShell {
|
|
sopsPGPKeyDirs = [
|
|
"./keys/hosts/"
|
|
"./keys/users/"
|
|
];
|
|
|
|
packages = nixpkgs.lib.attrValues {
|
|
inherit (sops-nix.packages.${system}) sops-import-keys-hook sops-init-gpg-key;
|
|
inherit (deploy-rs) deploy-rs;
|
|
};
|
|
};
|
|
|
|
minecraft = nixpkgs.legacyPackages.${system}.mkShell {
|
|
packages = nixpkgs.lib.attrValues { inherit (nixpkgs.legacyPackages.${system}) packwiz; };
|
|
};
|
|
|
|
webserver = self.packages.${system}.webserver.devShell;
|
|
};
|
|
};
|
|
}
|