os/flake.nix

153 lines
4.0 KiB
Nix
Raw Permalink Normal View History

2019-12-03 05:18:30 +00:00
{
2023-09-12 20:07:05 +00:00
description = "b12f hosts";
2022-11-20 22:28:23 +00:00
inputs = {
# Track channels with commits tested and built by hydra
2023-12-17 16:14:19 +00:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs/master";
2022-11-20 22:28:23 +00:00
nixd.url = "github:nix-community/nixd/main";
2022-11-20 22:28:23 +00:00
flake-compat.url = "github:edolstra/flake-compat";
flake-compat.flake = false;
2024-03-27 14:22:24 +00:00
home-manager.url = "github:nix-community/home-manager/release-23.11";
2023-09-12 20:07:05 +00:00
home-manager.inputs.nixpkgs.follows = "nixpkgs";
2022-11-20 22:28:23 +00:00
2023-09-12 20:07:05 +00:00
flake-parts.url = "github:hercules-ci/flake-parts";
nixos-flake.url = "github:srid/nixos-flake";
2022-11-20 22:28:23 +00:00
2023-09-12 20:07:05 +00:00
deploy-rs.url = "github:serokell/deploy-rs";
deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
deploy-rs.inputs.flake-compat.follows = "flake-compat";
2022-11-20 22:28:23 +00:00
authelia-438.url = "github:nicomem/nixpkgs/authelia-4.38";
2022-11-20 22:28:23 +00:00
agenix.url = "github:ryantm/agenix";
2023-09-12 20:07:05 +00:00
agenix.inputs.nixpkgs.follows = "nixpkgs";
2022-11-20 22:28:23 +00:00
nixos-hardware.url = "github:nixos/nixos-hardware";
impermanence.url = "github:nix-community/impermanence";
2023-10-03 12:21:09 +00:00
mobile-nixos.url = "github:nixos/mobile-nixos";
mobile-nixos.flake = false;
2023-09-11 21:51:13 +00:00
musnix.url = "github:musnix/musnix";
2023-10-07 12:06:28 +00:00
2023-09-11 21:51:13 +00:00
adblock-unbound.url = "github:MayNiklas/nixos-adblock-unbound";
2023-09-12 20:07:05 +00:00
adblock-unbound.inputs.nixpkgs.follows = "nixpkgs";
2024-02-27 08:41:03 +00:00
openstreetmap.url = "github:b12f/nixos-openstreetmap/flake-nixosmodule";
openstreetmap.inputs.nixpkgs.follows = "nixpkgs";
deno2nix.url = "github:SnO2WMaN/deno2nix";
invoiceplane-template.url = "git+ssh://gitea@git.pub.solar/b12f/invoiceplane-templates";
invoiceplane-template.inputs.nixpkgs.follows = "nixpkgs";
2022-11-20 22:28:23 +00:00
};
2023-09-12 20:07:05 +00:00
outputs = inputs@{ self, ... }:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
2022-11-20 22:28:23 +00:00
];
2023-09-12 20:07:05 +00:00
imports = [
inputs.nixos-flake.flakeModule
2024-03-19 18:29:57 +00:00
./public-keys.nix
./lib
2023-09-12 20:07:05 +00:00
./modules
./hosts
./users
2023-10-07 18:14:16 +00:00
./overlays
2023-09-12 20:07:05 +00:00
];
2021-07-16 21:01:25 +00:00
2023-10-07 12:06:28 +00:00
perSystem = args@{ system, pkgs, lib, config, ... }: {
2023-09-12 20:07:05 +00:00
_module.args = {
inherit inputs;
pkgs = import inputs.nixpkgs {
inherit system;
overlays = with inputs; [
agenix.overlays.default
nixd.overlays.default
invoiceplane-template.overlays.default
];
2021-07-16 21:01:25 +00:00
};
2021-04-22 03:44:15 +00:00
};
2021-07-16 21:01:25 +00:00
2023-09-12 20:07:05 +00:00
devShells.default = pkgs.mkShell {
2023-11-12 17:17:35 +00:00
packages = with pkgs; [
nix
2023-10-03 12:21:09 +00:00
agenix
2024-02-03 11:21:27 +00:00
age-plugin-yubikey
2023-10-03 12:21:09 +00:00
cachix
2023-11-12 17:17:35 +00:00
nixos-generators
nvfetcher
2023-10-03 12:21:09 +00:00
editorconfig-checker
nodePackages.prettier
shellcheck
shfmt
treefmt
2023-11-12 17:17:35 +00:00
nixpkgs-fmt
deploy-rs
opentofu
terraform-backend-git
deno
2023-09-12 20:07:05 +00:00
];
2023-11-12 17:17:35 +00:00
shellHook = ''
export TF_BACKEND_GIT_GIT_REPOSITORY=gitea@git.pub.solar:b12f/terraform-state.git
export TF_BACKEND_GIT_GIT_REF=main
export TF_BACKEND_GIT_GIT_STATE=b12f.json
export TF_BACKEND_HTTP_ENCRYPTION_PROVIDER=sops
2024-03-19 20:00:28 +00:00
export TF_BACKEND_HTTP_SOPS_PGP_FP=FC623BBCBD2604D5CC9D90BAE77B0AAAF0D9B76B
2023-11-12 17:17:35 +00:00
export HOSTINGDE_AUTH_TOKEN=$(secret-tool lookup hosting-de terraform-auth-token)
'';
2023-02-01 12:52:00 +00:00
};
2022-11-20 22:28:23 +00:00
};
2021-04-22 03:44:15 +00:00
2023-09-12 20:07:05 +00:00
flake = {
2023-10-07 12:06:28 +00:00
deploy.nodes = self.lib.deploy.mkDeployNodes self.nixosConfigurations {
2023-10-03 11:50:01 +00:00
chocolatebar = {
sshUser = "b12f";
};
biolimo = {
sshUser = "b12f";
};
2024-01-27 22:53:36 +00:00
stroopwafel = {
sshUser = "b12f";
};
2023-10-03 11:50:01 +00:00
droppie = {
hostname = "droppie.b12f.io";
sshUser = "yule";
};
2023-10-03 11:50:01 +00:00
pie = {
2023-10-24 13:54:04 +00:00
hostname = "pie.b12f.io";
sshUser = "yule";
};
2023-09-12 18:11:29 +00:00
2023-10-24 13:54:04 +00:00
frikandel = {
hostname = "frikandel.b12f.io";
2023-10-24 15:56:14 +00:00
sshUser = "yule";
2023-10-24 13:54:04 +00:00
};
2023-10-03 11:50:01 +00:00
maoam = {
sshUser = "b12f";
};
2023-09-12 18:11:29 +00:00
};
2023-01-28 21:34:24 +00:00
};
2022-11-20 22:28:23 +00:00
};
2019-12-03 05:18:30 +00:00
}