2022-02-20 17:46:48 +01:00
|
|
|
{
|
|
|
|
description = "NixOS configurations by tboerger";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs = {
|
2022-04-11 00:02:22 +02:00
|
|
|
url = "github:nixos/nixpkgs/nixos-unstable";
|
2022-02-20 17:46:48 +01:00
|
|
|
};
|
|
|
|
|
2024-01-30 15:47:02 +01:00
|
|
|
utils = {
|
|
|
|
url = "github:numtide/flake-utils";
|
2022-02-20 17:46:48 +01:00
|
|
|
};
|
|
|
|
|
2024-01-30 14:00:15 +01:00
|
|
|
devshell = {
|
|
|
|
url = "github:numtide/devshell";
|
2022-09-28 13:54:01 +02:00
|
|
|
};
|
|
|
|
|
2024-01-30 14:00:15 +01:00
|
|
|
deploy-rs = {
|
|
|
|
url = "github:serokell/deploy-rs";
|
|
|
|
};
|
|
|
|
|
|
|
|
disko = {
|
|
|
|
url = "github:nix-community/disko";
|
2022-10-25 09:53:40 +02:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
homemanager = {
|
|
|
|
url = "github:nix-community/home-manager";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2024-01-30 14:00:15 +01:00
|
|
|
homeage = {
|
|
|
|
url = "github:jordanisaacs/homeage";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
agenix = {
|
|
|
|
url = "github:ryantm/agenix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2022-10-25 09:53:40 +02:00
|
|
|
hardware = {
|
|
|
|
url = "github:nixos/nixos-hardware";
|
2022-02-20 17:46:48 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-01-30 15:47:02 +01:00
|
|
|
outputs = { self, nixpkgs, utils, devshell, deploy-rs, disko, homemanager, homeage, agenix, hardware, ... }@inputs:
|
2022-02-20 17:46:48 +01:00
|
|
|
let
|
2024-01-30 14:00:15 +01:00
|
|
|
inherit (self) outputs;
|
|
|
|
|
2022-10-26 20:37:14 +02:00
|
|
|
mkComputer = configurationNix: systemName: extraModules: nixpkgs.lib.nixosSystem {
|
2022-10-26 17:52:42 +02:00
|
|
|
system = systemName;
|
|
|
|
|
|
|
|
modules = [
|
|
|
|
({ pkgs, ... }:
|
|
|
|
{
|
|
|
|
nixpkgs = {
|
|
|
|
overlays = [
|
|
|
|
(import ./overlays)
|
|
|
|
];
|
|
|
|
};
|
2024-01-30 14:00:15 +01:00
|
|
|
}
|
|
|
|
)
|
2022-10-26 17:52:42 +02:00
|
|
|
homemanager.nixosModules.home-manager
|
2023-02-15 09:10:48 +01:00
|
|
|
agenix.nixosModules.default
|
2022-10-26 17:52:42 +02:00
|
|
|
configurationNix
|
2022-10-26 18:35:12 +02:00
|
|
|
] ++ extraModules;
|
2022-10-26 18:22:17 +02:00
|
|
|
|
2022-10-26 17:52:42 +02:00
|
|
|
specialArgs = {
|
|
|
|
inherit inputs;
|
|
|
|
};
|
|
|
|
};
|
2022-09-28 13:54:01 +02:00
|
|
|
|
2022-02-20 17:46:48 +01:00
|
|
|
in
|
|
|
|
{
|
2024-01-30 15:47:02 +01:00
|
|
|
diskoConfigurations = {
|
|
|
|
anubis = import ./desktops/anubis/disko.nix;
|
|
|
|
chnum = import ./desktops/chnum/disko.nix;
|
|
|
|
asgard = import ./servers/asgard/disko.nix;
|
|
|
|
utgard = import ./servers/utgard/disko.nix;
|
|
|
|
vanaheim = import ./servers/vanaheim/disko.nix;
|
|
|
|
};
|
|
|
|
|
2022-02-20 17:46:48 +01:00
|
|
|
nixosConfigurations = {
|
2022-11-22 11:15:02 +01:00
|
|
|
anubis = mkComputer
|
|
|
|
./desktops/anubis
|
2022-11-15 10:32:56 +01:00
|
|
|
"x86_64-linux"
|
|
|
|
[
|
2024-01-30 14:00:15 +01:00
|
|
|
disko.nixosModules.disko
|
|
|
|
./home/thomas/user.nix
|
|
|
|
./home/anna/user.nix
|
|
|
|
./home/adrian/user.nix
|
|
|
|
./home/tabea/user.nix
|
|
|
|
|
|
|
|
{
|
|
|
|
home-manager = {
|
|
|
|
extraSpecialArgs = {
|
|
|
|
desktopSystem = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
users = {
|
|
|
|
thomas = {
|
|
|
|
imports = [
|
|
|
|
homeage.homeManagerModules.homeage
|
|
|
|
./home/thomas
|
|
|
|
];
|
|
|
|
};
|
|
|
|
anna = {
|
|
|
|
imports = [
|
|
|
|
homeage.homeManagerModules.homeage
|
|
|
|
./home/anna
|
|
|
|
];
|
|
|
|
};
|
|
|
|
adrian = {
|
|
|
|
imports = [
|
|
|
|
homeage.homeManagerModules.homeage
|
|
|
|
./home/adrian
|
|
|
|
];
|
|
|
|
};
|
|
|
|
tabea = {
|
|
|
|
imports = [
|
|
|
|
homeage.homeManagerModules.homeage
|
|
|
|
./home/tabea
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
2022-11-15 10:32:56 +01:00
|
|
|
];
|
|
|
|
|
2022-11-22 11:15:02 +01:00
|
|
|
chnum = mkComputer
|
|
|
|
./desktops/chnum
|
2022-11-15 10:32:56 +01:00
|
|
|
"x86_64-linux"
|
|
|
|
[
|
2024-01-30 14:00:15 +01:00
|
|
|
disko.nixosModules.disko
|
|
|
|
./home/thomas/user.nix
|
|
|
|
./home/anna/user.nix
|
|
|
|
./home/adrian/user.nix
|
|
|
|
./home/tabea/user.nix
|
2022-11-15 10:32:56 +01:00
|
|
|
|
2024-01-30 14:00:15 +01:00
|
|
|
{
|
|
|
|
home-manager = {
|
|
|
|
extraSpecialArgs = {
|
|
|
|
desktopSystem = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
users = {
|
|
|
|
thomas = {
|
|
|
|
imports = [
|
|
|
|
homeage.homeManagerModules.homeage
|
|
|
|
./home/thomas
|
|
|
|
];
|
|
|
|
};
|
|
|
|
anna = {
|
|
|
|
imports = [
|
|
|
|
homeage.homeManagerModules.homeage
|
|
|
|
./home/anna
|
|
|
|
];
|
|
|
|
};
|
|
|
|
adrian = {
|
|
|
|
imports = [
|
|
|
|
homeage.homeManagerModules.homeage
|
|
|
|
./home/adrian
|
|
|
|
];
|
|
|
|
};
|
|
|
|
tabea = {
|
|
|
|
imports = [
|
|
|
|
homeage.homeManagerModules.homeage
|
|
|
|
./home/tabea
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
2022-09-26 15:14:32 +02:00
|
|
|
];
|
|
|
|
|
2022-10-26 17:52:42 +02:00
|
|
|
asgard = mkComputer
|
2022-11-15 10:32:56 +01:00
|
|
|
./servers/asgard
|
2022-10-26 17:52:42 +02:00
|
|
|
"x86_64-linux"
|
|
|
|
[
|
2024-01-30 14:00:15 +01:00
|
|
|
disko.nixosModules.disko
|
|
|
|
./home/thomas/user.nix
|
|
|
|
|
|
|
|
{
|
|
|
|
home-manager = {
|
|
|
|
extraSpecialArgs = {
|
|
|
|
desktopSystem = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
users = {
|
|
|
|
thomas = {
|
|
|
|
imports = [
|
|
|
|
homeage.homeManagerModules.homeage
|
|
|
|
./home/thomas
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
2022-09-26 15:14:32 +02:00
|
|
|
];
|
|
|
|
|
2022-10-26 17:52:42 +02:00
|
|
|
utgard = mkComputer
|
2022-11-15 10:32:56 +01:00
|
|
|
./servers/utgard
|
2022-10-26 17:52:42 +02:00
|
|
|
"x86_64-linux"
|
|
|
|
[
|
2024-01-30 14:00:15 +01:00
|
|
|
disko.nixosModules.disko
|
|
|
|
./home/thomas/user.nix
|
|
|
|
|
|
|
|
{
|
|
|
|
home-manager = {
|
|
|
|
extraSpecialArgs = {
|
|
|
|
desktopSystem = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
users = {
|
|
|
|
thomas = {
|
|
|
|
imports = [
|
|
|
|
homeage.homeManagerModules.homeage
|
|
|
|
./home/thomas
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
2022-10-26 17:52:42 +02:00
|
|
|
];
|
2022-09-26 15:14:32 +02:00
|
|
|
|
2024-01-30 14:00:15 +01:00
|
|
|
vanaheim = mkComputer
|
|
|
|
./servers/vanaheim
|
|
|
|
"x86_64-linux"
|
2022-10-26 17:52:42 +02:00
|
|
|
[
|
2024-01-30 14:00:15 +01:00
|
|
|
disko.nixosModules.disko
|
|
|
|
./home/thomas/user.nix
|
|
|
|
|
|
|
|
{
|
|
|
|
home-manager = {
|
|
|
|
extraSpecialArgs = {
|
|
|
|
desktopSystem = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
users = {
|
|
|
|
thomas = {
|
|
|
|
imports = [
|
|
|
|
homeage.homeManagerModules.homeage
|
|
|
|
./home/thomas
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
2022-09-26 15:14:32 +02:00
|
|
|
];
|
2024-01-30 14:00:15 +01:00
|
|
|
|
|
|
|
# yggdrasil = mkComputer
|
|
|
|
# ./servers/yggdrasil
|
|
|
|
# "aarch64-linux"
|
|
|
|
# [
|
|
|
|
# hardware.nixosModules.raspberry-pi-4
|
|
|
|
# ./home/thomas/user.nix
|
|
|
|
|
|
|
|
# {
|
|
|
|
# home-manager = {
|
|
|
|
# extraSpecialArgs = {
|
|
|
|
# desktopSystem = false;
|
|
|
|
# };
|
|
|
|
|
|
|
|
# users = {
|
|
|
|
# thomas = {
|
|
|
|
# imports = [
|
|
|
|
# homeage.homeManagerModules.homeage
|
|
|
|
# ./home/thomas
|
|
|
|
# ];
|
|
|
|
# };
|
|
|
|
# };
|
|
|
|
# };
|
|
|
|
# }
|
|
|
|
# ];
|
|
|
|
};
|
|
|
|
|
|
|
|
deploy = {
|
|
|
|
nodes = {
|
|
|
|
asgard = {
|
|
|
|
sshOpts = [ "-p" "22" ];
|
|
|
|
hostname = "asgard.boerger.ws";
|
|
|
|
fastConnection = true;
|
|
|
|
profiles = {
|
|
|
|
system = {
|
2024-01-30 23:48:00 +01:00
|
|
|
sshUser = "thomas";
|
2024-01-30 14:00:15 +01:00
|
|
|
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.asgard;
|
|
|
|
user = "root";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
utgard = {
|
|
|
|
sshOpts = [ "-p" "22" ];
|
|
|
|
hostname = "utgard.boerger.ws";
|
|
|
|
fastConnection = true;
|
|
|
|
profiles = {
|
|
|
|
system = {
|
2024-01-30 23:48:00 +01:00
|
|
|
sshUser = "thomas";
|
2024-01-30 14:00:15 +01:00
|
|
|
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.utgard;
|
|
|
|
user = "root";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
vanaheim = {
|
|
|
|
sshOpts = [ "-p" "22" ];
|
|
|
|
hostname = "vanaheim.boerger.ws";
|
|
|
|
fastConnection = true;
|
|
|
|
profiles = {
|
|
|
|
system = {
|
2024-01-30 23:48:00 +01:00
|
|
|
sshUser = "thomas";
|
2024-01-30 14:00:15 +01:00
|
|
|
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.vanaheim;
|
|
|
|
user = "root";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
# yggdrasil = {
|
|
|
|
# sshOpts = [ "-p" "22" ];
|
|
|
|
# hostname = "yggdrasil.boerger.ws";
|
|
|
|
# fastConnection = true;
|
|
|
|
# profiles = {
|
|
|
|
# system = {
|
2024-01-30 23:48:00 +01:00
|
|
|
# sshUser = "thomas";
|
2024-01-30 14:00:15 +01:00
|
|
|
# path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.yggdrasil;
|
|
|
|
# user = "root";
|
|
|
|
# };
|
|
|
|
# };
|
|
|
|
# };
|
2022-09-28 13:54:01 +02:00
|
|
|
};
|
2024-01-30 14:00:15 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
|
2024-01-30 15:47:02 +01:00
|
|
|
} // utils.lib.eachDefaultSystem
|
|
|
|
(system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [ devshell.overlays.default ];
|
2024-01-30 14:00:15 +01:00
|
|
|
};
|
|
|
|
|
2024-01-30 15:47:02 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
devShells.default = pkgs.devshell.mkShell {
|
2024-01-30 14:00:15 +01:00
|
|
|
commands = [
|
|
|
|
{
|
|
|
|
name = "age-encrypt";
|
|
|
|
category = "secrets commands";
|
|
|
|
help = "Encrypt secret with age";
|
|
|
|
command = "${pkgs.rage}/bin/rage -e -a -i ~/.ssh/id_ed25519";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "age-decrypt";
|
|
|
|
category = "secrets commands";
|
|
|
|
help = "Decrypt secret with age";
|
|
|
|
command = "${pkgs.rage}/bin/rage -d -i ~/.ssh/id_ed25519";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "agenix-rekey";
|
|
|
|
category = "secrets commands";
|
|
|
|
help = "Rekey agenix secrets";
|
|
|
|
command = "cd secrets && agenix -r";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
package = "nixpkgs-fmt";
|
|
|
|
category = "formatter commands";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
packages = with pkgs; [
|
2024-01-30 15:47:02 +01:00
|
|
|
inputs.agenix.packages.${system}.default
|
|
|
|
inputs.deploy-rs.packages.${system}.default
|
2024-01-30 14:00:15 +01:00
|
|
|
git
|
|
|
|
gnumake
|
|
|
|
home-manager
|
|
|
|
nixpkgs-fmt
|
|
|
|
nixUnstable
|
|
|
|
rage
|
|
|
|
];
|
|
|
|
};
|
2024-01-30 15:47:02 +01:00
|
|
|
}
|
|
|
|
);
|
2022-02-20 17:46:48 +01:00
|
|
|
}
|