os/flake.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

216 lines
7 KiB
Nix
Raw Normal View History

2019-12-03 05:18:30 +00:00
{
2023-09-12 20:07:05 +00:00
description = "b12f hosts";
nixConfig.extra-experimental-features = "nix-command flakes";
inputs = {
# Track channels with commits tested and built by hydra
2023-06-11 20:54:11 +00:00
nixos.url = "github:nixos/nixpkgs/nixos-23.05";
2023-09-14 09:01:28 +00:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
2022-11-20 22:28:23 +00:00
flake-compat.url = "github:edolstra/flake-compat";
flake-compat.flake = false;
2022-11-20 22:28:23 +00:00
2023-09-12 20:07:05 +00:00
nix-darwin.url = "github:lnl7/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixos";
home-manager.url = "github:nix-community/home-manager/release-23.05";
home-manager.inputs.nixpkgs.follows = "nixos";
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-29 20:01:03 +00:00
deploy-rs.url = "github:serokell/deploy-rs";
deploy-rs.inputs.nixpkgs.follows = "nixos";
deploy-rs.inputs.flake-compat.follows = "flake-compat";
2022-11-20 22:28:23 +00:00
agenix.url = "github:ryantm/agenix";
2022-02-02 03:15:24 +00:00
agenix.inputs.nixpkgs.follows = "nixos";
2023-09-29 20:01:03 +00:00
agenix.inputs.darwin.follows = "nix-darwin";
2022-11-20 22:28:23 +00:00
2021-03-02 03:30:47 +00:00
nixos-hardware.url = "github:nixos/nixos-hardware";
2022-11-20 22:28:23 +00:00
2023-07-02 10:48:54 +00:00
keycloak-theme-pub-solar.url = "git+https://git.pub.solar/pub-solar/keycloak-theme?ref=main";
keycloak-theme-pub-solar.inputs.nixpkgs.follows = "nixos";
2023-01-28 21:34:24 +00:00
master.url = "github:nixos/nixpkgs/master";
2023-07-03 11:20:13 +00:00
fix-yubikey-agent.url = "github:pub-solar/nixpkgs/fix/use-latest-unstable-yubikey-agent";
fix-atomic-container-restarts.url = "github:pub-solar/nixpkgs/fix/atomic-container-restarts";
2023-02-21 11:37:18 +00:00
scan2paperless.url = "git+https://git.pub.solar/b12f/scan2paperless.git";
2023-09-11 21:51:13 +00:00
musnix.url = "github:musnix/musnix";
adblock-unbound.url = "github:MayNiklas/nixos-adblock-unbound";
adblock-unbound.inputs.nixpkgs.follows = "nixos";
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"
"x86_64-darwin"
"aarch64-darwin"
];
imports = [
inputs.nixos-flake.flakeModule
];
2023-09-29 20:01:03 +00:00
perSystem = { system, pkgs, config, ... }: {
2023-09-14 09:01:28 +00:00
# Code to consume overlays, see https://flake.parts/overlays#consuming-an-overlay
_module.args.pkgs = import inputs.nixos {
inherit system;
overlays = [
2023-09-29 20:01:03 +00:00
inputs.agenix.overlays.default
2023-09-14 09:01:28 +00:00
(import ./pkgs/default.nix)
];
};
2023-09-29 20:01:03 +00:00
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.nixpkgs-fmt
pkgs.sops
pkgs.ssh-to-age
];
};
2023-09-14 09:01:28 +00:00
};
2023-09-12 20:07:05 +00:00
flake = {
# Configurations for Linux (NixOS) machines
nixosConfigurations = {
2023-09-29 20:01:03 +00:00
biolimo = self.nixos-flake.lib.mkLinuxSystem {
nixpkgs.hostPlatform = "x86_64-linux";
2023-09-12 20:07:05 +00:00
imports = [
2023-09-29 20:01:03 +00:00
self.nixosModules.base
2023-09-12 20:07:05 +00:00
./hosts/biolimo/default.nix
2023-09-29 20:01:03 +00:00
./users/b12f/default.nix
];
};
chocolatebar = self.nixos-flake.lib.mkLinuxSystem {
nixpkgs.hostPlatform = "x86_64-linux";
imports = [
self.nixosModules.base
./hosts/chocolatebar/default.nix
./users/b12f/default.nix
];
};
pie = self.nixos-flake.lib.mkLinuxSystem {
nixpkgs.hostPlatform = "aarch64-linux";
imports = [
self.nixosModules.base
inputs.nixos-hardware.nixosModules.raspberry-pi-4
./hosts/pie/default.nix
./users/yule/default.nix
];
};
maoam = self.nixos-flake.lib.mkLinuxSystem {
nixpkgs.hostPlatform = "aarch64-linux";
imports = [
self.nixosModules.base
./hosts/maoam/default.nix
./users/yule/default.nix
2023-09-12 20:07:05 +00:00
];
};
};
nixosModules = rec {
arduino = import ./modules/arduino/default.nix;
audio = import ./modules/audio/default.nix;
2023-09-29 20:01:03 +00:00
# ci-runner = import ./modules/ci-runner/default.nix;
2023-09-12 20:07:05 +00:00
core = import ./modules/core/default.nix;
crypto = import ./modules/crypto/default.nix;
devops = import ./modules/devops/default.nix;
2023-09-29 20:01:03 +00:00
# docker = import ./modules/docker/default.nix;
# docker-ci-runner = import ./modules/docker-ci-runner/default.nix;
2023-09-12 20:07:05 +00:00
email = import ./modules/email/default.nix;
gaming = import ./modules/gaming/default.nix;
graphical = import ./modules/graphical/default.nix;
mobile = import ./modules/mobile/default.nix;
2023-09-29 20:01:03 +00:00
# nextcloud = import ./modules/nextcloud/default.nix;
# office = import ./modules/office/default.nix;
2023-09-12 20:07:05 +00:00
paperless = import ./modules/paperless/default.nix;
paranoia = import ./modules/paranoia/default.nix;
printing = import ./modules/printing/default.nix;
social = import ./modules/social/default.nix;
sway = import ./modules/sway/default.nix;
terminal-life = import ./modules/terminal-life/default.nix;
uhk = import ./modules/uhk/default.nix;
user = import ./modules/user/default.nix;
2023-09-29 20:01:03 +00:00
# virtualisation = import ./modules/virtualisation/default.nix;
2023-09-12 20:07:05 +00:00
2023-09-29 20:01:03 +00:00
root = import ./users/root/default.nix;
2023-09-12 20:07:05 +00:00
2023-09-29 20:01:03 +00:00
base.imports = [
self.nixosModules.home-manager
inputs.agenix.nixosModules.default
inputs.musnix.nixosModules.musnix
2023-09-12 20:07:05 +00:00
2023-09-29 20:01:03 +00:00
({ flake, pkgs, lib, ... }: {
nixpkgs.overlays = [ (import ./pkgs/default.nix) ];
})
2021-07-16 21:01:25 +00:00
2023-09-29 20:01:03 +00:00
arduino
audio
# ci-runner
core
crypto
devops
# docker
# docker-ci-runner
email
gaming
graphical
mobile
# nextcloud
# office
paperless
paranoia
printing
social
sway
terminal-life
uhk
user
# virtualisation
root
2022-01-31 16:52:56 +00:00
];
2023-09-12 18:11:29 +00:00
2023-09-29 20:01:03 +00:00
full-install = {
# pub-solar.audio.bluetooth.enable = true;
# pub-solar.docker.enable = true;
# pub-solar.nextcloud.enable = true;
# pub-solar.office.enable = true;
2023-09-12 18:11:29 +00:00
};
2022-11-20 22:28:23 +00:00
};
2023-01-28 21:27:52 +00:00
2023-09-29 20:01:03 +00:00
homeModules = { };
2022-11-20 22:28:23 +00:00
};
2021-04-22 03:44:15 +00:00
2023-09-29 20:01:03 +00:00
# deploy.nodes = {
# droppie = {
# hostname = "backup.b12f.io";
# sshUser = "yule";
# remoteBuild = true;
# path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.droppie;
# };
# pie = {
# sshUser = "yule";
# remoteBuild = true;
# path = inputs.deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.pie;
# };
# maoam = {
# sshUser = "b12f";
# remoteBuild = true;
# path = inputs.deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.maoam;
# };
# };
# checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib;
};
2019-12-03 05:18:30 +00:00
}