2021-12-11 14:21:48 +01:00
|
|
|
{
|
2021-12-11 14:44:46 +01:00
|
|
|
description = "Andreas Zweili's Nixos configuration";
|
|
|
|
inputs = {
|
2023-12-01 17:37:22 +01:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
|
2023-03-20 12:44:47 +01:00
|
|
|
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
2021-12-16 20:19:21 +01:00
|
|
|
# look here for the hardware options https://github.com/NixOS/nixos-hardware/blob/master/flake.nix#L5
|
2023-06-04 18:29:19 +02:00
|
|
|
nixos-hardware.url = "github:nixos/nixos-hardware";
|
2022-03-16 14:30:12 +01:00
|
|
|
agenix = {
|
|
|
|
url = "github:ryantm/agenix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2021-12-11 14:44:46 +01:00
|
|
|
home-manager = {
|
2023-12-01 17:37:22 +01:00
|
|
|
url = "github:nix-community/home-manager/release-23.11";
|
2021-12-11 14:44:46 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-02-02 13:45:05 +01:00
|
|
|
outputs =
|
|
|
|
inputs@{
|
|
|
|
self,
|
|
|
|
agenix,
|
|
|
|
nixpkgs,
|
|
|
|
nixpkgs-unstable,
|
|
|
|
nixos-hardware,
|
|
|
|
home-manager,
|
|
|
|
}:
|
2021-12-11 16:35:32 +01:00
|
|
|
let
|
2023-06-07 20:14:44 +02:00
|
|
|
mkComputer = import "${inputs.self}/lib/mk_computer.nix";
|
|
|
|
mkRaspi = import "${inputs.self}/lib/mk_raspi.nix";
|
2024-02-02 13:45:05 +01:00
|
|
|
mksdImage =
|
|
|
|
host:
|
2024-01-01 13:14:24 +01:00
|
|
|
(self.nixosConfigurations.${host}.extendModules {
|
2024-02-02 13:45:05 +01:00
|
|
|
modules = [ "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" ];
|
2024-01-01 13:14:24 +01:00
|
|
|
}).config.system.build.sdImage;
|
2023-06-28 09:32:13 +02:00
|
|
|
# required for home-manager only setup {
|
|
|
|
overlay-unstable = final: prev: {
|
|
|
|
unstable = import inputs.nixpkgs-unstable {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
config.allowUnfree = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
pkgs = import inputs.nixpkgs {
|
|
|
|
system = "x86_64-linux";
|
2024-02-02 13:45:05 +01:00
|
|
|
config = {
|
|
|
|
allowUnfree = true;
|
|
|
|
};
|
2024-01-01 13:14:24 +01:00
|
|
|
overlays = [ overlay-unstable ];
|
2023-06-28 09:32:13 +02:00
|
|
|
};
|
2024-04-08 20:05:22 +02:00
|
|
|
# }
|
|
|
|
raspis = {
|
|
|
|
"git" = { };
|
|
|
|
"plex" = { };
|
|
|
|
"proxy" = { };
|
|
|
|
"mail" = { };
|
|
|
|
"management" = {
|
|
|
|
home-module = "management";
|
|
|
|
};
|
|
|
|
"nextcloud" = { };
|
|
|
|
"restic-server" = { };
|
|
|
|
"ttrss" = { };
|
|
|
|
};
|
|
|
|
raspiConfigs = nixpkgs.lib.attrsets.mapAttrs (
|
|
|
|
hostname:
|
|
|
|
{
|
|
|
|
home-module ? "headless",
|
|
|
|
}:
|
|
|
|
(mkRaspi { inherit inputs hostname home-module; })
|
|
|
|
) raspis;
|
|
|
|
|
|
|
|
pcs = {
|
|
|
|
"gwyn" = {
|
|
|
|
home-module = "desktop";
|
|
|
|
};
|
|
|
|
"staubfinger" = {
|
|
|
|
home-module = "desktop";
|
|
|
|
};
|
|
|
|
"desktop-vm" = {
|
|
|
|
home-module = "work-vm";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
pcConfigs = nixpkgs.lib.attrsets.mapAttrs (
|
|
|
|
hostname:
|
|
|
|
{
|
|
|
|
home-module ? "headless",
|
|
|
|
}:
|
|
|
|
(mkComputer { inherit inputs hostname home-module; })
|
|
|
|
) pcs;
|
2024-02-02 13:45:05 +01:00
|
|
|
in
|
|
|
|
{
|
2024-04-08 21:28:22 +02:00
|
|
|
images = nixpkgs.lib.attrsets.mapAttrs (name: _: mksdImage name) raspis;
|
2024-04-08 20:05:22 +02:00
|
|
|
nixosConfigurations = raspiConfigs // pcConfigs;
|
2022-01-24 11:27:31 +01:00
|
|
|
homeConfigurations = {
|
2023-02-10 09:26:53 +01:00
|
|
|
"zweili@co-ws-con4" = home-manager.lib.homeManagerConfiguration {
|
2023-06-28 09:32:13 +02:00
|
|
|
inherit pkgs;
|
2022-12-02 09:05:58 +01:00
|
|
|
modules = [
|
2023-06-08 13:43:48 +02:00
|
|
|
"${inputs.self}/home-manager/profiles/work-wsl.nix"
|
2023-08-22 18:41:05 +02:00
|
|
|
inputs.agenix.homeManagerModules.age
|
2022-12-02 09:05:58 +01:00
|
|
|
];
|
2022-01-24 11:27:31 +01:00
|
|
|
extraSpecialArgs = {
|
2023-06-07 20:14:44 +02:00
|
|
|
inherit inputs;
|
2024-02-02 13:45:05 +01:00
|
|
|
nixosConfig = {
|
|
|
|
az-username = "zweili";
|
|
|
|
};
|
2022-01-24 11:33:17 +01:00
|
|
|
};
|
2022-01-24 11:27:31 +01:00
|
|
|
};
|
|
|
|
};
|
2022-01-24 11:33:17 +01:00
|
|
|
};
|
|
|
|
}
|