nixos/flake.nix

124 lines
3.4 KiB
Nix
Raw Normal View History

2021-12-11 14:21:48 +01:00
{
2021-12-11 14:44:46 +01:00
description = "Andreas Zweili's Nixos configuration";
inputs = {
2022-05-31 09:11:44 +02:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";
2021-12-11 14:44:46 +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
2021-12-11 15:42:32 +01:00
nixos-hardware.url = "github:nixos/nixos-hardware";
2021-12-16 20:19:21 +01:00
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 = {
2022-05-31 09:11:44 +02:00
url = "github:nix-community/home-manager/release-22.05";
2021-12-11 14:44:46 +01:00
inputs.nixpkgs.follows = "nixpkgs";
};
};
2021-12-11 15:42:32 +01:00
outputs =
2022-01-03 20:29:08 +01:00
inputs@{ self
2022-03-16 14:46:33 +01:00
, agenix
2021-12-11 15:42:32 +01:00
, nixpkgs
, nixpkgs-unstable
, nixos-hardware
, home-manager
}:
let
2022-11-04 19:35:57 +01:00
custom = import ./custom { inherit inputs; };
mkComputer = import "${custom.inputs.self}/lib/mk_computer.nix";
mkRaspi = import "${custom.inputs.self}/lib/mk_raspi.nix";
2022-11-05 19:59:40 +01:00
mksdImage = host: (self.nixosConfigurations.${host}.extendModules {
modules = [ "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" ];
}).config.system.build.sdImage;
in
{
2022-11-05 19:08:12 +01:00
images = {
2022-11-05 19:59:40 +01:00
git = mksdImage "git";
loki-test = mksdImage "loki-test";
2022-11-08 21:22:24 +01:00
plex = mksdImage "plex";
2022-11-05 19:59:40 +01:00
proxy = mksdImage "proxy";
2022-11-08 21:22:51 +01:00
mail = mksdImage "mail";
2022-11-05 19:59:40 +01:00
management = mksdImage "management";
2022-11-08 21:26:00 +01:00
nextcloud = mksdImage "nextcloud";
2022-11-08 21:26:13 +01:00
pihole = mksdImage "pihole";
2022-11-08 21:26:24 +01:00
restic-server = mksdImage "restic-server";
2022-11-09 01:20:52 +01:00
ttrss = mksdImage "ttrss";
2022-11-05 19:08:12 +01:00
};
nixosConfigurations = {
2022-03-16 15:53:39 +01:00
gwyn = mkComputer {
hostname = "gwyn";
home-module = "desktop";
2022-11-04 19:35:57 +01:00
inherit custom;
2022-03-16 15:53:39 +01:00
};
2022-09-08 14:45:27 +02:00
desktop-vm = mkComputer {
2022-03-16 15:53:39 +01:00
hostname = "desktop-vm";
home-module = "desktop";
2022-11-04 19:35:57 +01:00
inherit custom;
2022-03-16 15:53:39 +01:00
};
staubfinger = mkComputer {
hostname = "staubfinger";
home-module = "desktop";
2022-11-04 19:35:57 +01:00
inherit custom;
2022-03-16 15:53:39 +01:00
};
2022-02-28 22:19:52 +01:00
# Servers
2022-11-04 14:09:46 +01:00
git = mkRaspi {
2022-03-16 15:53:39 +01:00
hostname = "git";
2022-11-04 19:35:57 +01:00
inherit custom;
2022-03-16 15:53:39 +01:00
};
2022-09-16 12:23:48 +02:00
loki-test = mkRaspi {
hostname = "loki-test";
2022-11-04 19:35:57 +01:00
inherit custom;
2022-09-16 12:23:48 +02:00
};
2022-11-08 21:22:51 +01:00
mail = mkRaspi {
2022-03-16 15:53:39 +01:00
hostname = "mail";
2022-11-04 19:35:57 +01:00
inherit custom;
2022-03-16 15:53:39 +01:00
};
2022-11-08 21:26:00 +01:00
nextcloud = mkRaspi {
2022-03-16 15:53:39 +01:00
hostname = "nextcloud";
2022-11-04 19:35:57 +01:00
inherit custom;
2022-03-16 15:53:39 +01:00
};
2022-11-08 21:26:13 +01:00
pihole = mkRaspi {
2022-03-16 15:53:39 +01:00
hostname = "pihole";
2022-11-04 19:35:57 +01:00
inherit custom;
2022-03-16 15:53:39 +01:00
};
2022-11-08 21:22:24 +01:00
plex = mkRaspi {
2022-03-16 15:53:39 +01:00
hostname = "plex";
home-module = "plex";
2022-11-04 19:35:57 +01:00
inherit custom;
2022-03-16 15:53:39 +01:00
};
2022-09-03 10:02:24 +02:00
proxy = mkRaspi {
2022-03-16 15:53:39 +01:00
hostname = "proxy";
2022-11-04 19:35:57 +01:00
inherit custom;
2022-03-16 15:53:39 +01:00
};
2022-10-14 08:39:51 +02:00
management = mkRaspi {
hostname = "management";
2022-10-12 11:01:49 +02:00
home-module = "management";
2022-11-04 19:35:57 +01:00
inherit custom;
2022-03-16 15:53:39 +01:00
};
2022-11-08 21:26:24 +01:00
restic-server = mkRaspi {
2022-03-16 15:53:39 +01:00
hostname = "restic-server";
2022-11-04 19:35:57 +01:00
inherit custom;
2022-03-16 15:53:39 +01:00
};
2022-11-09 01:20:52 +01:00
ttrss = mkRaspi {
2022-03-16 15:53:39 +01:00
hostname = "ttrss";
2022-11-04 19:35:57 +01:00
inherit custom;
2022-03-16 15:53:39 +01:00
};
2022-01-01 15:26:53 +01:00
};
homeConfigurations = {
2022-02-16 22:19:13 +01:00
"${custom.username}@co-ws-con4" = home-manager.lib.homeManagerConfiguration {
2022-11-04 19:35:57 +01:00
configuration = import "${custom.inputs.self}/home-manager/work-wsl.nix";
2022-09-14 11:56:32 +02:00
system = "x86_64-linux";
2022-09-07 17:36:29 +02:00
username = custom.username;
2022-02-16 22:19:13 +01:00
homeDirectory = "/home/${custom.username}";
extraSpecialArgs = {
2022-11-04 19:35:57 +01:00
inherit custom;
2022-01-24 11:33:17 +01:00
};
};
};
2022-01-24 11:33:17 +01:00
};
}