16 Commits

Author SHA1 Message Date
ec51278987 Fix zitadel config 2024-08-11 22:27:14 +01:00
1250683996 Add zitadel config 2024-08-11 17:06:17 +01:00
bbb7548659 flake.lock: Update
Flake lock file updates:

• Updated input 'secrets':
    'git+ssh://git@git.vimium.com/jordan/nix-secrets.git?ref=refs/heads/master&rev=0cf25cbc71fcfe7c16250847e5f31abd730e04c4' (2024-08-11)
  → 'git+ssh://git@git.vimium.com/jordan/nix-secrets.git?ref=refs/heads/master&rev=b47efe67031e12a2d5560b94fdb4de7dca3df80c' (2024-08-11)
2024-08-11 15:07:10 +01:00
8216088c46 Split overlays into directories 2024-08-11 14:30:55 +01:00
d05d353ee7 flake.lock: Update
Flake lock file updates:

• Updated input 'agenix':
    'github:ryantm/agenix/3f1dae074a12feb7327b4bf43cbac0d124488bb7' (2024-07-30)
  → 'github:ryantm/agenix/f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41' (2024-08-10)
• Updated input 'nixos-hardware':
    'github:NixOS/nixos-hardware/107bb46eef1f05e86fc485ee8af9b637e5157988' (2024-08-08)
  → 'github:NixOS/nixos-hardware/c54cf53e022b0b3c1d3b8207aa0f9b194c24f0cf' (2024-08-10)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/21cc704b5e918c5fbf4f9fff22b4ac2681706d90' (2024-08-06)
  → 'github:NixOS/nixpkgs/a781ff33ae258bbcfd4ed6e673860c3e923bf2cc' (2024-08-10)
• Updated input 'nixpkgs-unstable':
    'github:NixOS/nixpkgs/cb9a96f23c491c081b38eab96d22fa958043c9fa' (2024-08-04)
  → 'github:NixOS/nixpkgs/5e0ca22929f3342b19569b21b2f3462f053e497b' (2024-08-09)
• Updated input 'secrets':
    'git+ssh://git@git.vimium.com/jordan/nix-secrets.git?ref=refs/heads/master&rev=dfe0e95be5ef539bf28602ff47beeea26cc4d1b8' (2024-08-03)
  → 'git+ssh://git@git.vimium.com/jordan/nix-secrets.git?ref=refs/heads/master&rev=0cf25cbc71fcfe7c16250847e5f31abd730e04c4' (2024-08-11)
2024-08-11 13:10:27 +01:00
b74bfc9683 Extract networking domain from host configs
All checks were successful
Check flake / build-amd64-linux (push) Successful in 4m22s
2024-08-11 10:06:26 +01:00
19dbe4c226 Add agenix to devshell
All checks were successful
Check flake / build-amd64-linux (push) Successful in 2m41s
2024-08-11 09:52:16 +01:00
a0bb510d8d Refactor deploy nodes config
All checks were successful
Check flake / build-amd64-linux (push) Successful in 2m37s
2024-08-11 09:40:45 +01:00
fdfacc0f97 Scope overlays and modules to specific host sets
All checks were successful
Check flake / build-amd64-linux (push) Successful in 2m39s
2024-08-11 09:21:08 +01:00
6eed6303f2 Use rpi libcamera fork
All checks were successful
Check flake / build-amd64-linux (push) Successful in 2m44s
2024-08-10 22:22:03 +01:00
1cb6482106 Fix udev rules on skycam
All checks were successful
Check flake / build-amd64-linux (push) Successful in 2m32s
2024-08-10 21:53:25 +01:00
3323f930d3 Add camera-streamer package to skycam 2024-08-10 21:53:09 +01:00
37d56b613e Patch out IPA signature validation in libcamera 2024-08-10 21:52:45 +01:00
6205824c0d Re-add default overlay 2024-08-10 21:52:20 +01:00
b613c266ed Patch out libdatachannel in camera-streamer 2024-08-10 21:51:35 +01:00
c9fa49b24d Update deployment hostnames
All checks were successful
Check flake / build-amd64-linux (push) Successful in 45m16s
2024-08-09 22:06:19 +01:00
38 changed files with 379 additions and 208 deletions

32
flake.lock generated
View File

@@ -8,11 +8,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1722339003,
"narHash": "sha256-ZeS51uJI30ehNkcZ4uKqT4ZDARPyqrHADSKAwv5vVCU=",
"lastModified": 1723293904,
"narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=",
"owner": "ryantm",
"repo": "agenix",
"rev": "3f1dae074a12feb7327b4bf43cbac0d124488bb7",
"rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41",
"type": "github"
},
"original": {
@@ -388,11 +388,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1723149858,
"narHash": "sha256-3u51s7jdhavmEL1ggtd8wqrTH2clTy5yaZmhLvAXTqc=",
"lastModified": 1723310128,
"narHash": "sha256-IiH8jG6PpR4h9TxSGMYh+2/gQiJW9MwehFvheSb5rPc=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "107bb46eef1f05e86fc485ee8af9b637e5157988",
"rev": "c54cf53e022b0b3c1d3b8207aa0f9b194c24f0cf",
"type": "github"
},
"original": {
@@ -459,11 +459,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1722813957,
"narHash": "sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y=",
"lastModified": 1723175592,
"narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "cb9a96f23c491c081b38eab96d22fa958043c9fa",
"rev": "5e0ca22929f3342b19569b21b2f3462f053e497b",
"type": "github"
},
"original": {
@@ -490,11 +490,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1722987190,
"narHash": "sha256-68hmex5efCiM2aZlAAEcQgmFI4ZwWt8a80vOeB/5w3A=",
"lastModified": 1723282977,
"narHash": "sha256-oTK91aOlA/4IsjNAZGMEBz7Sq1zBS0Ltu4/nIQdYDOg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "21cc704b5e918c5fbf4f9fff22b4ac2681706d90",
"rev": "a781ff33ae258bbcfd4ed6e673860c3e923bf2cc",
"type": "github"
},
"original": {
@@ -576,11 +576,11 @@
"secrets": {
"flake": false,
"locked": {
"lastModified": 1722712220,
"narHash": "sha256-gEmbk/DROfVZ+v/BAZHDloHzS0KdqIzxtW7z9g2eH4Y=",
"lastModified": 1723385164,
"narHash": "sha256-/z4nBwpHsGWl1gmGv7FQQgoOcPwUaVzL7rfjI5nTOLg=",
"ref": "refs/heads/master",
"rev": "dfe0e95be5ef539bf28602ff47beeea26cc4d1b8",
"revCount": 22,
"rev": "b47efe67031e12a2d5560b94fdb4de7dca3df80c",
"revCount": 24,
"type": "git",
"url": "ssh://git@git.vimium.com/jordan/nix-secrets.git"
},

130
flake.nix
View File

@@ -51,81 +51,60 @@
};
};
outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, agenix, deploy-rs, disko, home-manager, nixos-hardware, nixos-mailserver, ... }:
outputs = inputs @ { self, nixpkgs, ... }:
let
inherit (nixpkgs) lib;
domain = "mesh.vimium.net";
forEverySystem = lib.getAttrs lib.systems.flakeExposed;
forEachSystem = lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
];
mkPkgsForSystem = system: inputs.nixpkgs;
customPkgs = forEachSystem (system:
lib.packagesFromDirectoryRecursive {
callPackage = nixpkgs.legacyPackages.${system}.callPackage;
directory = ./pkgs;
});
overlays = [
agenix.overlays.default
(import ./overlays/gnome.nix)
(
final: prev: {
unstable = import inputs.nixpkgs-unstable { system = final.system; };
}
)
];
commonModules = [
agenix.nixosModules.age
disko.nixosModules.disko
nixos-mailserver.nixosModule
home-manager.nixosModule
./modules
];
mkNixosSystem = { system, name, extraModules ? [] }:
let
nixpkgs = mkPkgsForSystem system;
lib = (import nixpkgs { inherit overlays system; }).lib;
in
inputs.nixpkgs.lib.nixosSystem {
inherit lib system;
specialArgs = { modulesPath = toString (nixpkgs + "/nixos/modules"); inherit inputs; };
baseModules = import (nixpkgs + "/nixos/modules/module-list.nix");
modules = commonModules ++ [
({ config, ... }:
{
nixpkgs.pkgs = import nixpkgs {
inherit overlays system;
config.allowUnfree = true;
config.nvidia.acceptLicense = true;
};
networking.hostName = name;
})
./hosts/${name}
] ++ extraModules;
mkDeployNode = hostName: {
hostname = "${hostName}.${domain}";
profiles.system = {
user = "root";
path = inputs.deploy-rs.lib.${self.nixosConfigurations.${hostName}.config.system.build.toplevel.system}.activate.nixos self.nixosConfigurations.${hostName};
};
};
in
{
overlays = lib.packagesFromDirectoryRecursive {
callPackage = path: overrides: import path;
directory = ./overlays;
};
legacyPackages = forEachSystem (system:
lib.packagesFromDirectoryRecursive {
callPackage = nixpkgs.legacyPackages.${system}.callPackage;
directory = ./pkgs;
});
nixosConfigurations = {
atlas = mkNixosSystem { system = "x86_64-linux"; name = "atlas"; };
eos = mkNixosSystem { system = "x86_64-linux"; name = "eos"; };
helios = mkNixosSystem { system = "x86_64-linux"; name = "helios"; };
hypnos = mkNixosSystem { system = "x86_64-linux"; name = "hypnos"; };
library = mkNixosSystem { system = "x86_64-linux"; name = "library"; };
mail = mkNixosSystem { system = "x86_64-linux"; name = "mail"; };
odyssey = mkNixosSystem { system = "x86_64-linux"; name = "odyssey"; };
pi = mkNixosSystem { system = "aarch64-linux"; name = "pi"; extraModules = [ nixos-hardware.nixosModules.raspberry-pi-4 ]; };
skycam = mkNixosSystem { system = "aarch64-linux"; name = "skycam"; extraModules = [ nixos-hardware.nixosModules.raspberry-pi-4 ]; };
vps1 = mkNixosSystem { system = "x86_64-linux"; name = "vps1"; };
};
nixosConfigurations = lib.pipe ./hosts [
builtins.readDir
(lib.filterAttrs (name: value: value == "directory"))
(lib.mapAttrs (name: value:
lib.nixosSystem {
specialArgs = { inherit self; };
modules = [
{
networking = {
inherit domain;
hostName = name;
};
}
./hosts/${name}
];
}))
];
devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {
buildInputs = [
deploy-rs.packages.x86_64-linux.deploy-rs
inputs.agenix.packages.x86_64-linux.agenix
inputs.deploy-rs.packages.x86_64-linux.deploy-rs
];
};
@@ -133,43 +112,10 @@
magicRollback = true;
autoRollback = true;
sshUser = "root";
nodes = {
mail = {
hostname = "mail.mesh.vimium.net";
profiles.system = {
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.mail;
};
};
vps1 = {
hostname = "vps1.mesh.vimium.net";
profiles.system = {
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.vps1;
};
};
pi = {
hostname = "pi.mesh.vimium.net";
profiles.system = {
user = "root";
path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.pi;
};
};
skycam = {
hostname = "skycam.mesh.vimium.net";
profiles.system = {
user = "root";
path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.skycam;
};
};
};
nodes = lib.genAttrs [ "mail" "pi" "skycam" "vps1" ] mkDeployNode;
};
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib;
};
}

View File

@@ -1,4 +1,4 @@
{ config, lib, ... }:
{ config, ... }:
{
imports = [
@@ -6,6 +6,8 @@
../desktop.nix
];
nixpkgs.hostPlatform = "x86_64-linux";
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;

View File

@@ -1,6 +1,22 @@
{ config, pkgs, ... }:
{ config, pkgs, self, ... }:
{
imports = [
self.inputs.agenix.nixosModules.age
self.inputs.home-manager.nixosModule
../modules
];
nixpkgs.overlays = [
self.inputs.agenix.overlays.default
(import ../overlays/default.nix)
(
final: prev: {
unstable = import self.inputs.nixpkgs-unstable { system = final.system; };
}
)
];
time.timeZone = "Europe/London";
i18n.defaultLocale = "en_GB.UTF-8";

View File

@@ -1,10 +1,14 @@
{ config, lib, pkgs, ... }:
{ config, pkgs, ... }:
{
imports = [
./common.nix
];
nixpkgs.overlays = [
(import ../overlays/gnome)
];
services.printing.enable = true;
services.openssh.startWhenNeeded = true;

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ config, ... }:
{
imports = [
@@ -6,6 +6,8 @@
../desktop.nix
];
nixpkgs.hostPlatform = "x86_64-linux";
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
{ config, ... }:
{
imports = [
@@ -6,6 +6,8 @@
../desktop.nix
];
nixpkgs.hostPlatform = "x86_64-linux";
boot = {
loader.grub = {
enable = true;

View File

@@ -1,12 +1,21 @@
{ config, lib, ... }:
{ config, lib, self, ... }:
{
imports = [
self.inputs.disko.nixosModules.disko
./hardware-configuration.nix
./disko-config.nix
../desktop.nix
];
nixpkgs = {
hostPlatform = "x86_64-linux";
config = {
allowUnfree = true;
nvidia.acceptLicense = true;
};
};
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;

View File

@@ -6,6 +6,8 @@
../server.nix
];
nixpkgs.hostPlatform = "x86_64-linux";
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
@@ -13,7 +15,6 @@
};
networking = {
domain = "mesh.vimium.net";
hostId = "d24ae953";
firewall = {
enable = true;

View File

@@ -1,15 +1,17 @@
{ config, lib, pkgs, inputs, ... }:
{ config, lib, self, ... }:
{
imports = [
self.inputs.disko.nixosModules.disko
./hardware-configuration.nix
./disko-config.nix
../server.nix
];
nixpkgs.hostPlatform = "x86_64-linux";
networking = {
hostId = "08ac2f14";
domain = "mesh.vimium.net";
firewall = {
enable = true;
allowedTCPPorts = [

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
{ config, ... }:
{
imports = [
@@ -6,6 +6,14 @@
../desktop.nix
];
nixpkgs = {
hostPlatform = "x86_64-linux";
config = {
allowUnfree = true;
nvidia.acceptLicense = true;
};
};
boot.loader = {
systemd-boot = {
enable = true;

View File

@@ -1,12 +1,13 @@
{ config, lib, pkgs, inputs, ... }:
{ config, lib, pkgs, self, ... }:
{
imports = [
self.inputs.nixos-hardware.nixosModules.raspberry-pi-4
./hardware-configuration.nix
../server.nix
];
networking.hostId = "731d1660";
nixpkgs.hostPlatform = "aarch64-linux";
hardware = {
raspberry-pi."4" = {
@@ -97,6 +98,8 @@
];
};
networking.hostId = "731d1660";
sound.enable = true;
security.rtkit.enable = true;
@@ -108,7 +111,7 @@
};
age.secrets."files/services/home-assistant/secrets.yaml" = {
file = "${inputs.secrets}/files/services/home-assistant/secrets.yaml.age";
file = "${self.inputs.secrets}/files/services/home-assistant/secrets.yaml.age";
path = "${config.services.home-assistant.configDir}/secrets.yaml";
owner = "hass";
group = "hass";
@@ -173,7 +176,7 @@
};
age.secrets."files/services/zigbee2mqtt/secret.yaml" = {
file = "${inputs.secrets}/files/services/zigbee2mqtt/secret.yaml.age";
file = "${self.inputs.secrets}/files/services/zigbee2mqtt/secret.yaml.age";
path = "${config.services.zigbee2mqtt.dataDir}/secret.yaml";
owner = "zigbee2mqtt";
group = "zigbee2mqtt";

View File

@@ -1,11 +1,14 @@
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, self, ... }:
{
imports = [
self.inputs.nixos-hardware.nixosModules.raspberry-pi-4
./hardware-configuration.nix
../server.nix
];
nixpkgs.hostPlatform = "aarch64-linux";
hardware = {
raspberry-pi."4" = {
apply-overlays-dtmerge.enable = true;
@@ -46,11 +49,13 @@
};
services.udev.extraRules = ''
SUBSYSTEM="dma_heap", GROUP="video", MODE="0600"
SUBSYSTEM=="rpivid-*", GROUP="video", MODE="0660"
KERNEL=="vcsm-cma", GROUP="video", MODE="0660"
SUBSYSTEM=="dma_heap", GROUP="video", MODE="0660"
'';
nixpkgs.overlays = [
(import ./../overlays/libcamera.nix)
(import ./../../overlays/libcamera)
];
networking = {
@@ -82,6 +87,8 @@
--host=0.0.0.0 \
--resolution=4608x2592
'';
DynamicUser = "yes";
SupplementaryGroups = [ "video" ];
Restart = "always";
RestartSec = 10;
};
@@ -90,6 +97,7 @@
};
environment.systemPackages = with pkgs; [
camera-streamer
git
neovim
libcamera

View File

@@ -1,7 +1,4 @@
{
lib,
...
}:
{ config, lib, self, ... }:
{
imports = [
@@ -9,9 +6,10 @@
../server.nix
];
nixpkgs.hostPlatform = "x86_64-linux";
networking = {
hostId = "08bf6db3";
domain = "mesh.vimium.net";
firewall = {
enable = true;
allowedTCPPorts = [
@@ -43,6 +41,90 @@
services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password";
services.postgresql = {
ensureUsers = [
{
name = "zitadel";
ensureDBOwnership = true;
ensureClauses = {
superuser = true;
};
}
];
ensureDatabases = [ "zitadel" ];
};
age.secrets."files/services/zitadel/masterkey" = {
file = "${self.inputs.secrets}/files/services/zitadel/masterkey.age";
owner = "zitadel";
group = "zitadel";
};
systemd.services.zitadel = {
requires = [ "postgresql.service" ];
after = [ "postgresql.service" ];
};
services.zitadel = {
enable = true;
masterKeyFile = config.age.secrets."files/services/zitadel/masterkey".path;
settings = {
Database.postgres = {
Host = "/run/postgresql";
Port = 5432;
Database = "zitadel";
User = {
Username = "zitadel";
SSL.Mode = "disable";
};
Admin = {
ExistingDatabase = "zitadel";
Username = "zitadel";
SSL.Mode = "disable";
};
};
ExternalDomain = "id.vimium.com";
ExternalPort = 443;
ExternalSecure = true;
Machine = {
Identification = {
Hostname.Enabled = true;
PrivateIp.Enabled = false;
Webhook.Enabled = false;
};
};
Port = 8081;
WebAuthNName = "Vimium";
};
steps.FirstInstance = {
InstanceName = "Vimium";
Org.Name = "Vimium";
Org.Human = {
UserName = "jordan@vimium.com";
FirstName = "Jordan";
LastName = "Holt";
Email = {
Address = "jordan@vimium.com";
Verified = true;
};
Password = "Password1!";
PasswordChangeRequired = true;
};
LoginPolicy.AllowRegister = false;
};
};
services.nginx.virtualHosts."id.vimium.com" = {
enableACME = true;
forceSSL = true;
locations."/" = {
extraConfig = ''
grpc_pass grpc://localhost:${builtins.toString config.services.zitadel.settings.Port};
grpc_set_header Host $host:$server_port;
'';
};
};
modules = rec {
databases.postgresql.enable = true;
services = {

View File

@@ -17,6 +17,7 @@ in {
config = lib.mkIf cfg.enable {
services.postgresql = {
enable = true;
enableJIT = true;
initdbArgs = [
"--allow-group-access"
"--encoding=UTF8"

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
{ config, lib, self, ... }:
let cfg = config.modules.desktop.apps.thunderbird;
in {
@@ -10,7 +10,7 @@ in {
};
config = lib.mkIf cfg.enable {
home.file.".thunderbird/Default/chrome/thunderbird-gnome-theme".source = inputs.thunderbird-gnome-theme;
home.file.".thunderbird/Default/chrome/thunderbird-gnome-theme".source = self.inputs.thunderbird-gnome-theme;
home.programs.thunderbird = {
enable = true;

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
{ config, lib, pkgs, ... }:
let cfg = config.modules.desktop.browsers.brave;
in {

View File

@@ -1,4 +1,4 @@
{ config, lib, inputs, ... }:
{ config, lib, self, ... }:
let cfg = config.modules.desktop.browsers.firefox;
in {
@@ -10,7 +10,7 @@ in {
};
config = lib.mkIf cfg.enable {
home.file.".mozilla/firefox/Default/chrome/firefox-gnome-theme".source = inputs.firefox-gnome-theme;
home.file.".mozilla/firefox/Default/chrome/firefox-gnome-theme".source = self.inputs.firefox-gnome-theme;
home.programs.firefox = {
enable = true;

View File

@@ -1,4 +1,4 @@
{ config, inputs, lib, pkgs, ... }:
{ config, lib, pkgs, self, ... }:
let cfg = config.modules.desktop.gnome;
in {
@@ -207,7 +207,7 @@ in {
"Kvantum/kvantum.kvconfig".text = lib.generators.toINI {} {
General.theme = "KvLibadwaitaDark";
};
"Kvantum/KvLibadwaita".source = "${inputs.kvlibadwaita}/src/KvLibadwaita";
"Kvantum/KvLibadwaita".source = "${self.inputs.kvlibadwaita}/src/KvLibadwaita";
};
user.packages = with pkgs; [

View File

@@ -1,4 +1,4 @@
{ config, inputs, lib, pkgs, ... }:
{ config, lib, pkgs, self, ... }:
let
cfg = config.modules.networking.tailscale;
@@ -18,7 +18,7 @@ in {
config = lib.mkIf cfg.enable {
age.secrets."passwords/services/tailscale/${hostname}-authkey" = {
file = "${inputs.secrets}/passwords/services/tailscale/${hostname}-authkey.age";
file = "${self.inputs.secrets}/passwords/services/tailscale/${hostname}-authkey.age";
};
environment.systemPackages = [ pkgs.tailscale ];

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
{ config, lib, pkgs, self, ... }:
with lib;
@@ -19,7 +19,7 @@ in {
config = mkIf cfg.enable {
age.secrets."passwords/networks" = {
file = "${inputs.secrets}/passwords/networks.age";
file = "${self.inputs.secrets}/passwords/networks.age";
};
networking = {

View File

@@ -1,4 +1,4 @@
{ config, options, lib, home-manager, inputs, ... }:
{ config, options, lib, self, ... }:
with lib;
{
@@ -29,7 +29,7 @@ with lib;
};
config = {
age.secrets."passwords/users/jordan".file = "${inputs.secrets}/passwords/users/jordan.age";
age.secrets."passwords/users/jordan".file = "${self.inputs.secrets}/passwords/users/jordan.age";
user =
let user = builtins.getEnv "USER";
name = if elem user [ "" "root" ] then "jordan" else user;
@@ -68,8 +68,8 @@ with lib;
};
sharedModules = [
inputs.nixvim.homeManagerModules.nixvim
inputs.plasma-manager.homeManagerModules.plasma-manager
self.inputs.nixvim.homeManagerModules.nixvim
self.inputs.plasma-manager.homeManagerModules.plasma-manager
];
};

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
{ config, lib, self, ... }:
let
cfg = config.modules.services.borgmatic;
@@ -27,7 +27,7 @@ in {
config = lib.mkIf cfg.enable {
age.secrets."passwords/services/borg/${hostname}-passphrase" = {
file = "${inputs.secrets}/passwords/services/borg/${hostname}-passphrase.age";
file = "${self.inputs.secrets}/passwords/services/borg/${hostname}-passphrase.age";
};
services.borgmatic = {

View File

@@ -1,9 +1,4 @@
{
config,
lib,
inputs,
...
}:
{ config, lib, self, ... }:
let
cfg = config.modules.services.coturn;
@@ -54,13 +49,13 @@ in {
age.secrets = {
"passwords/services/coturn/static-auth-secret" = {
file = "${inputs.secrets}/passwords/services/coturn/static-auth-secret.age";
file = "${self.inputs.secrets}/passwords/services/coturn/static-auth-secret.age";
owner = "turnserver";
group = "turnserver";
};
} // (if cfg.matrixIntegration then {
"passwords/services/coturn/matrix-turn-config.yml" = {
file = "${inputs.secrets}/passwords/services/coturn/matrix-turn-config.yml.age";
file = "${self.inputs.secrets}/passwords/services/coturn/matrix-turn-config.yml.age";
owner = "matrix-synapse";
group = "matrix-synapse";
};

View File

@@ -1,4 +1,4 @@
{ pkgs, config, lib, inputs, ... }:
{ pkgs, config, lib, self, ... }:
# Based on: https://git.clan.lol/clan/clan-infra/src/branch/main/modules/web01/gitea/actions-runner.nix
@@ -176,7 +176,7 @@ in
users.groups.nix-ci-user = { };
age.secrets."files/services/gitea-runner/${hostname}-token" = {
file = "${inputs.secrets}/files/services/gitea-runner/${hostname}-token.age";
file = "${self.inputs.secrets}/files/services/gitea-runner/${hostname}-token.age";
group = "podman";
};

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
{ config, lib, pkgs, self, ... }:
let
cfg = config.modules.services.gitea;
@@ -40,9 +40,9 @@ in {
systemd.tmpfiles.rules = [
"d '${config.services.gitea.customDir}/public/assets/css' 0750 ${config.services.gitea.user} ${config.services.gitea.group} - -"
"L+ '${config.services.gitea.customDir}/public/assets/css/theme-github.css' - - - - ${inputs.gitea-github-theme}/theme-github.css"
"L+ '${config.services.gitea.customDir}/public/assets/css/theme-github-auto.css' - - - - ${inputs.gitea-github-theme}/theme-github-auto.css"
"L+ '${config.services.gitea.customDir}/public/assets/css/theme-github-dark.css' - - - - ${inputs.gitea-github-theme}/theme-github-dark.css"
"L+ '${config.services.gitea.customDir}/public/assets/css/theme-github.css' - - - - ${self.inputs.gitea-github-theme}/theme-github.css"
"L+ '${config.services.gitea.customDir}/public/assets/css/theme-github-auto.css' - - - - ${self.inputs.gitea-github-theme}/theme-github-auto.css"
"L+ '${config.services.gitea.customDir}/public/assets/css/theme-github-dark.css' - - - - ${self.inputs.gitea-github-theme}/theme-github-dark.css"
];
services.gitea = rec {

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
{ config, lib, pkgs, ... }:
with lib;

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ config, lib, self, ... }:
let
cfg = config.modules.services.mail;
@@ -22,6 +22,10 @@ in {
};
};
imports = [
self.inputs.nixos-mailserver.nixosModule
];
config = lib.mkIf cfg.enable {
services.roundcube = {
enable = true;

View File

@@ -1,10 +1,4 @@
{
config,
lib,
pkgs,
inputs,
...
}:
{ config, lib, pkgs, self, ... }:
let
cfg = config.modules.services.matrix;
@@ -197,7 +191,7 @@ in {
age.secrets = if cfg.slidingSync.enable then {
"files/services/matrix/sliding-sync" = {
file = "${inputs.secrets}/files/services/matrix/sliding-sync.age";
file = "${self.inputs.secrets}/files/services/matrix/sliding-sync.age";
};
} else {};

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
{ config, lib, pkgs, ... }:
with lib;

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, inputs, ... }:
{ config, lib, pkgs, self, ... }:
with lib;
@@ -36,7 +36,7 @@ in {
};
age.secrets."passwords/services/photoprism/admin" = {
file = "${inputs.secrets}/passwords/services/photoprism/admin.age";
file = "${self.inputs.secrets}/passwords/services/photoprism/admin.age";
};
services.photoprism = {

View File

@@ -1,8 +1,8 @@
self: super:
final: prev:
{
gnome = super.gnome.overrideScope' (gself: gsuper: {
gnome = prev.gnome.overrideScope' (gself: gsuper: {
mutter = gsuper.mutter.overrideAttrs (oldAttrs: {
src = super.fetchurl {
src = prev.fetchurl {
url = "https://gitlab.gnome.org/Community/Ubuntu/mutter/-/archive/triple-buffering-v4-46/mutter-triple-buffering-v4-46.tar.gz";
sha256 = "mmFABDsRMzYnLO3+Cf3CJ60XyUBl3y9NAUj+vs7nLqE=";
};

View File

@@ -1,25 +0,0 @@
final: prev:
{
libcamera = prev.libcamera.overrideAttrs (old: {
postPatch = ''
patchShebangs utils/ src/py/
'';
patches = [
./0001-Remove-relative-config-lookups.patch
];
mesonFlags = old.mesonFlags ++ [
"--buildtype=release"
"-Dpipelines=rpi/vc4"
"-Dipas=rpi/vc4"
"-Dgstreamer=enabled"
"-Dtest=false"
"-Dcam=enabled"
];
});
camera-streamer = prev.callPackage ../pkgs/camera-streamer/package.nix {
libcamera = final.libcamera;
};
}

View File

@@ -0,0 +1,25 @@
From 625939e594ce255afa3fab3a40c3e524460e1f8b Mon Sep 17 00:00:00 2001
From: Jordan Holt <jordan@vimium.com>
Date: Sat, 10 Aug 2024 18:28:08 +0100
Subject: [PATCH] Ignore IPA signing
---
src/libcamera/ipa_manager.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp
index 6d5bbd05..43004175 100644
--- a/src/libcamera/ipa_manager.cpp
+++ b/src/libcamera/ipa_manager.cpp
@@ -295,7 +295,7 @@ bool IPAManager::isSignatureValid([[maybe_unused]] IPAModule *ipa) const
if (data.empty())
return false;
- bool valid = pubKey_.verify(data, ipa->signature());
+ bool valid = true;
LOG(IPAManager, Debug)
<< "IPA module " << ipa->path() << " signature is "
--
2.44.1

View File

@@ -0,0 +1,64 @@
final: prev:
{
libpisp = final.stdenv.mkDerivation {
name = "libpisp";
version = "1.0.5";
src = final.fetchFromGitHub {
owner = "raspberrypi";
repo = "libpisp";
rev = "v1.0.5";
hash = "sha256-CHd44CH5dBcZuK+5fZtONZ8HE/lwGKwK5U0BYUK8gG4=";
};
nativeBuildInputs = with final; [
pkg-config
meson
ninja
];
buildInputs = with final; [
nlohmann_json
boost
];
BOOST_INCLUDEDIR = "${prev.lib.getDev final.boost}/include";
BOOST_LIBRARYDIR = "${prev.lib.getLib final.boost}/lib";
};
libcamera = prev.libcamera.overrideAttrs (old: {
src = final.fetchFromGitHub {
owner = "raspberrypi";
repo = "libcamera";
rev = "eb00c13d7c9f937732305d47af5b8ccf895e700f";
hash = "sha256-p0/inkHPRUkxSIsTmj7VI7sIaX7OXdqjMGZ31W7cnt4=";
};
postPatch = ''
patchShebangs utils/ src/py/
'';
patches = [
./0001-Remove-relative-config-lookups.patch
./0001-Ignore-IPA-signing.patch
];
buildInputs = old.buildInputs ++ (with final; [
libpisp
libglibutil
]);
mesonFlags = old.mesonFlags ++ [
"--buildtype=release"
"-Dpipelines=rpi/vc4,rpi/pisp"
"-Dipas=rpi/vc4,rpi/pisp"
"-Dgstreamer=enabled"
"-Dtest=false"
"-Dcam=enabled"
"-Dpycamera=disabled"
];
});
camera-streamer = prev.callPackage ../pkgs/camera-streamer/package.nix {
libcamera = final.libcamera;
};
}

View File

@@ -0,0 +1,25 @@
From 0f17bb86772afe9495891e420a809a0b3c071caf Mon Sep 17 00:00:00 2001
From: Jordan Holt <jordan@vimium.com>
Date: Sat, 10 Aug 2024 15:37:15 +0100
Subject: [PATCH] Disable libdatachannel
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index d5029bd..e50ba1a 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ USE_HW_H264 ?= 1
USE_FFMPEG ?= $(shell pkg-config libavutil libavformat libavcodec && echo 1)
USE_LIBCAMERA ?= $(shell pkg-config libcamera && echo 1)
USE_RTSP ?= $(shell pkg-config live555 && echo 1)
-USE_LIBDATACHANNEL ?= $(shell [ -e $(LIBDATACHANNEL_PATH)/CMakeLists.txt ] && echo 1)
+USE_LIBDATACHANNEL ?= 0
ifeq (1,$(DEBUG))
CFLAGS += -g
--
2.44.1

View File

@@ -1,5 +1,5 @@
{ stdenv
, fetchFromGitea
, fetchFromGitHub
, cmake
, gnumake
@@ -24,15 +24,18 @@ stdenv.mkDerivation (finalAttrs: {
pname = "camera-streamer";
version = "0.2.8";
src = fetchFromGitea {
domain = "git.vimium.com";
owner = "jordan";
src = fetchFromGitHub {
owner = "ayufan";
repo = "camera-streamer";
rev = "464f05172c725b4b302464eecdb8b6e85fda6e84";
hash = "sha256-IkLR/oozYU+hfpct+GXej2T3GEhauQtqwWOcrQAErbM=";
rev = "refs/tags/v${finalAttrs.version}";
hash = "sha256-8vV8BMFoDeh22I1/qxk6zttJROaD/lrThBxXHZSPpT4=";
fetchSubmodules = true;
};
patches = [
./0001-Disable-libdatachannel.patch
];
# Second replacement fixes literal newline in generated version.h.
postPatch = ''
substituteInPlace Makefile \