nixos_flake_config/flake.nix

186 lines
5.5 KiB
Nix
Raw Normal View History

2023-07-03 22:35:58 +02:00
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
2023-09-30 20:13:43 +02:00
nix-xilinx = {
url = "gitlab:asmir.abdulahovic/nix-xilinx";
inputs.nixpkgs.follows = "nixpkgs";
};
peerix = {
url = "gitlab:asmir.abdulahovic/peerix";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-09-20 19:43:01 +02:00
zremap = {
url = "gitlab:asmir.abdulahovic/zremap";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-10-26 22:48:08 +02:00
swaysw = {
url = "git+https://git.project-cloud.net/asmir/swaysw";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-10-27 01:46:36 +02:00
nvim = {
url = "git+https://git.project-cloud.net/asmir/nvim_flake";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
goatcounter = {
url = "github:asmir-abdulahovic/goatcounter-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-07-03 22:35:58 +02:00
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-10-01 16:03:02 +02:00
simple-nixos-mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-11-14 14:41:06 +01:00
project-cloud = {
url = "git+https://git.project-cloud.net/asmir/project-cloud";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-07-03 22:35:58 +02:00
};
outputs = inputs @ {
goatcounter,
2023-07-03 22:35:58 +02:00
home-manager,
2023-10-01 16:03:02 +02:00
nixpkgs,
2023-07-03 22:35:58 +02:00
nix-xilinx,
2023-10-27 12:40:58 +02:00
nvim,
2023-07-03 22:35:58 +02:00
peerix,
project-cloud,
2023-10-01 16:03:02 +02:00
simple-nixos-mailserver,
2023-07-03 22:35:58 +02:00
sops-nix,
2023-10-26 22:48:08 +02:00
swaysw,
2023-09-20 19:43:01 +02:00
zremap,
2023-07-03 22:35:58 +02:00
...
2023-07-03 23:10:39 +02:00
}: let
pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgs;
in {
2023-07-03 22:35:58 +02:00
nixosConfigurations = rec {
nixy = nixpkgs.lib.nixosSystem rec {
2023-07-03 22:35:58 +02:00
system = "x86_64-linux";
modules = [
{_module.args = inputs;}
2024-01-28 16:48:53 +01:00
{_module.args.system = system;}
2023-11-12 14:08:22 +01:00
{nix.registry.nixpkgs.flake = nixpkgs;}
2023-11-12 13:54:16 +01:00
./common/packages.nix
./common/suspend.nix
./nixy/configuration.nix
./nixy/hardware-configuration.nix
2023-07-03 22:35:58 +02:00
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.akill = import ./home/home.nix;
home-manager.extraSpecialArgs = {inherit inputs system;};
2023-07-03 22:35:58 +02:00
}
peerix.nixosModules.peerix
{
services.peerix = {
enable = true;
globalCacheTTL = 10;
package = peerix.packages.x86_64-linux.peerix;
openFirewall = true; # UDP/12304
privateKeyFile = nixy.config.sops.secrets."peerix/private".path;
publicKeyFile = ./nixy/peerix-public;
2023-07-03 22:35:58 +02:00
publicKey = "peerix-mediabox:UDgG3xdQYv7bmx2l4ZPNRPJtp2zMmY++H/fnGeJ9BQw=";
};
}
];
};
2023-09-07 10:57:18 +02:00
mediabox = nixpkgs.lib.nixosSystem rec {
2023-09-30 14:10:53 +02:00
system = "x86_64-linux";
modules = [
{_module.args = inputs;}
2024-01-28 16:48:53 +01:00
{_module.args.system = system;}
2023-11-12 14:08:22 +01:00
{nix.registry.nixpkgs.flake = nixpkgs;}
2023-09-30 14:10:53 +02:00
./common/packages.nix
./common/suspend.nix
./mediabox/configuration.nix
./mediabox/hardware-configuration.nix
2023-10-01 16:03:02 +02:00
./modules/qbittorrent.nix
2023-09-30 14:10:53 +02:00
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.akill = import ./home/home.nix;
home-manager.extraSpecialArgs = {inherit inputs system;};
2023-09-30 14:10:53 +02:00
}
peerix.nixosModules.peerix
{
services.peerix = {
enable = true;
globalCacheTTL = 10;
package = peerix.packages.x86_64-linux.peerix;
openFirewall = true; # UDP/12304
privateKeyFile = mediabox.config.sops.secrets."peerix/private".path;
2023-09-30 14:10:53 +02:00
publicKeyFile = ./mediabox/peerix-public;
publicKey = "peerix-nixy:8THqS0R2zWF/47ai0RFmqJnieYTZ1jaWOD9tnzpvA6s=";
};
}
];
};
blue = nixpkgs.lib.nixosSystem rec {
2023-09-07 10:57:18 +02:00
system = "x86_64-linux";
modules = [
{_module.args = inputs;}
2024-01-28 16:48:53 +01:00
{_module.args.system = system;}
2023-11-12 14:08:22 +01:00
{nix.registry.nixpkgs.flake = nixpkgs;}
2023-09-07 10:57:18 +02:00
./blue/configuration.nix
./blue/hardware-configuration.nix
./common/packages.nix
2023-09-07 10:57:18 +02:00
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.akill = import ./home/home.nix;
home-manager.extraSpecialArgs = {inherit inputs system;};
2023-09-07 10:57:18 +02:00
}
];
};
magpie = nixpkgs.lib.nixosSystem rec {
2023-10-01 16:03:02 +02:00
system = "arm64-linux";
modules = [
{_module.args = inputs;}
2024-01-28 16:48:53 +01:00
{_module.args.system = system;}
2023-11-12 14:08:22 +01:00
{nix.registry.nixpkgs.flake = nixpkgs;}
2023-10-01 16:03:02 +02:00
./magpie/configuration.nix
./magpie/hardware-configuration.nix
goatcounter.nixosModules.goatcounter
2023-10-01 16:11:38 +02:00
simple-nixos-mailserver.nixosModule
sops-nix.nixosModules.sops
2023-10-01 16:03:02 +02:00
(builtins.toPath "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix")
];
};
2023-07-03 22:35:58 +02:00
};
2023-07-03 23:10:39 +02:00
devShell.x86_64-linux = pkgs.mkShell {
2023-09-30 16:16:21 +02:00
buildInputs = with pkgs; [sops ssh-to-age age];
2023-07-03 23:10:39 +02:00
shellHook = ''
echo "Configuring NixOS!"
'';
};
2023-07-06 22:29:34 +02:00
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
2023-07-03 22:35:58 +02:00
};
}