This commit is contained in:
2025-01-29 21:33:37 +01:00
commit a2247c5b26
30 changed files with 1036 additions and 0 deletions

149
flake.nix Normal file
View File

@@ -0,0 +1,149 @@
{
description = "rpqt's Nix configs";
outputs =
inputs@{
nixpkgs,
deploy-rs,
home-manager,
impermanence,
nixos-generators,
nixos-hardware,
self,
...
}:
{
nixosConfigurations = {
# Hetzner VPS
crocus = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
inherit (import ./parts) keys;
};
system = "x86_64-linux";
modules = [
./hosts/crocus
./system
];
};
# Raspberry Pi 4
genepi = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
inherit (import ./parts) keys;
};
system = "aarch64-linux";
modules = [
home-manager.nixosModules.home-manager
./system
./hosts/genepi
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.rpqt = ./hosts/genepi/home.nix;
}
];
};
};
# Raspberry Pi 4 installer ISO.
packages.aarch64-linux.installer-sd-image = nixos-generators.nixosGenerate {
specialArgs = {
inherit inputs;
inherit (import ./parts) keys;
};
system = "aarch64-linux";
format = "sd-aarch64-installer";
modules = [
nixos-hardware.nixosModules.raspberry-pi-4
./system/core
./hosts/genepi/network.nix
./hosts/genepi/hardware.nix
{
nixpkgs.overlays = [
(final: super: {
makeModulesClosure = x: super.makeModulesClosure (x // { allowMissing = true; });
})
];
}
];
};
homeConfigurations = {
"rpqt@haze" = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = {
inherit inputs;
};
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
./hosts/haze/home.nix
];
};
};
deploy.nodes.crocus = {
hostname = "crocus";
profiles = {
system = {
user = "root";
sshUser = "rpqt";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.crocus;
};
};
};
deploy.nodes.genepi = {
hostname = "genepi";
profiles = {
system = {
user = "root";
sshUser = "rpqt";
path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.genepi;
remoteBuild = true;
};
};
};
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
};
inputs = {
nixpkgs = {
url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence = {
url = "github:nix-community/impermanence";
};
nixos-hardware = {
url = "github:NixOS/nixos-hardware/master";
};
nixos-generators = {
url = "github:nix-community/nixos-generators";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
nixConfig = {
substituters = [
"https://cache.nixos.org"
];
};
}