os/flake.nix

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

171 lines
5 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-09-12 20:07:05 +00:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
unstable.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 = "nixpkgs";
2022-11-20 22:28:23 +00:00
2023-09-12 20:07:05 +00:00
home-manager.url = "github:nix-community/home-manager/release-23.05";
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
agenix.url = "github:ryantm/agenix";
2023-09-12 20:07:05 +00:00
agenix.inputs.nixpkgs.follows = "nixpkgs";
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-01-28 21:34:24 +00:00
master.url = "github:nixos/nixpkgs/master";
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";
2023-09-12 20:07:05 +00:00
adblock-unbound.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"
"x86_64-darwin"
"aarch64-darwin"
];
2022-11-20 22:28:23 +00:00
2023-09-12 20:07:05 +00:00
imports = [
inputs.nixos-flake.flakeModule
./lib
2023-09-12 20:07:05 +00:00
./modules
./hosts
./users
];
2021-07-16 21:01:25 +00:00
2023-09-12 20:07:05 +00:00
perSystem = args@{ system, pkgs, config, ... }: {
_module.args = {
inherit inputs;
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
inputs.agenix.overlays.default
2021-07-16 21:01:25 +00:00
];
};
2023-09-12 20:07:05 +00:00
unstable = import inputs.unstable { inherit system; };
master = import inputs.master { inherit system; };
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 {
buildInputs = [
2023-10-03 11:50:01 +00:00
pkgs.deploy-rs
2023-09-12 20:07:05 +00:00
pkgs.nixpkgs-fmt
pkgs.agenix
pkgs.ssh-to-age
];
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 = {
nixosModules = rec {
base.imports = [
self.nixosModules.home-manager
inputs.agenix.nixosModules.default
inputs.musnix.nixosModules.musnix
({
flake,
pkgs,
lib,
unstable,
master,
...
}: {
nixpkgs.overlays = (import ./overlays) ++ [
(prev: next: {
scan2paperless = inputs.scan2paperless.legacyPackages.${prev.system}.scan2paperless;
nixd = inputs.unstable.legacyPackages.${prev.system}.nixd;
factorio-headless = inputs.master.legacyPackages.${prev.system}.factorio-headless;
paperless-ngx = inputs.master.legacyPackages.${prev.system}.paperless-ngx;
waybar = inputs.master.legacyPackages.${prev.system}.waybar;
element-desktop = inputs.master.legacyPackages.${prev.system}.element-desktop;
adlist = inputs.adblock-unbound.packages.${prev.system};
})
];
nix.nixPath = [
"nixpkgs=${inputs.nixpkgs}"
"nixos-config=${./lib/compat/nixos}"
"home-manager=${inputs.home-manager}"
];
})
2023-09-12 18:11:29 +00:00
2023-09-12 20:07:05 +00:00
self.nixosModules.arduino
self.nixosModules.audio
self.nixosModules.ci-runner
self.nixosModules.core
self.nixosModules.crypto
self.nixosModules.devops
self.nixosModules.docker
self.nixosModules.docker-ci-runner
self.nixosModules.email
self.nixosModules.gaming
self.nixosModules.graphical
self.nixosModules.mobile
self.nixosModules.nix
self.nixosModules.nextcloud
self.nixosModules.office
self.nixosModules.paperless
self.nixosModules.paranoia
self.nixosModules.printing
self.nixosModules.social
self.nixosModules.sway
self.nixosModules.terminal-life
self.nixosModules.uhk
self.nixosModules.user
self.nixosModules.virtualisation
self.nixosModules.root
];
2023-09-12 18:11:29 +00:00
};
2023-09-11 21:51:13 +00:00
2023-10-03 11:50:01 +00:00
deploy.nodes = self.b12f.lib.deploy.mkDeployNodes self.nixosConfigurations {
chocolatebar = {
sshUser = "b12f";
};
biolimo = {
sshUser = "b12f";
};
droppie = {
hostname = "backup.b12f.io";
sshUser = "yule";
};
2023-10-03 11:50:01 +00:00
pie = {
hostname = "pie.local";
sshUser = "yule";
};
2023-09-12 18:11:29 +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
};
};
2019-12-03 05:18:30 +00:00
}