os/flake.nix

116 lines
3 KiB
Nix

{
description = "b12f hosts";
nixConfig.extra-experimental-features = "nix-command flakes";
inputs = {
# Track channels with commits tested and built by hydra
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs/master";
flake-compat.url = "github:edolstra/flake-compat";
flake-compat.flake = false;
nix-darwin.url = "github:lnl7/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager/release-23.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
nixos-flake.url = "github:srid/nixos-flake";
deploy-rs.url = "github:serokell/deploy-rs";
deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
deploy-rs.inputs.flake-compat.follows = "flake-compat";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
agenix.inputs.darwin.follows = "nix-darwin";
nixos-hardware.url = "github:nixos/nixos-hardware";
mobile-nixos.url = "github:nixos/mobile-nixos";
mobile-nixos.flake = false;
scan2paperless.url = "git+https://git.pub.solar/b12f/scan2paperless.git";
musnix.url = "github:musnix/musnix";
adblock-unbound.url = "github:MayNiklas/nixos-adblock-unbound";
adblock-unbound.inputs.nixpkgs.follows = "nixpkgs";
};
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
./lib
./modules
./hosts
./users
];
perSystem = args@{ system, pkgs, config, ... }: {
_module.args = {
inherit inputs;
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
inputs.agenix.overlays.default
];
};
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
deploy-rs
nixpkgs-fmt
agenix
cachix
editorconfig-checker
nix
nodePackages.prettier
nvfetcher
shellcheck
shfmt
treefmt
nixos-generators
];
};
};
flake = {
deploy.nodes = self.b12f-os.lib.deploy.mkDeployNodes self.nixosConfigurations {
chocolatebar = {
sshUser = "b12f";
};
biolimo = {
sshUser = "b12f";
};
droppie = {
hostname = "backup.b12f.io";
sshUser = "yule";
};
pie = {
hostname = "pie.local";
sshUser = "yule";
};
maoam = {
sshUser = "b12f";
};
};
};
};
}