Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
ec51278987
|
|||
1250683996
|
|||
bbb7548659
|
|||
8216088c46
|
|||
d05d353ee7
|
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
|||||||
Copyright (C) 2025 by Jordan Holt <jordan@vimium.com>
|
Copyright (C) 2023 by Jordan Holt <jordan@vimium.com>
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
purpose with or without fee is hereby granted.
|
purpose with or without fee is hereby granted.
|
||||||
|
@ -6,8 +6,8 @@ System and user configuration for NixOS-based systems.
|
|||||||
|-|-|
|
|-|-|
|
||||||
| **Shell:** | zsh |
|
| **Shell:** | zsh |
|
||||||
| **DE:** | GNOME |
|
| **DE:** | GNOME |
|
||||||
| **Theme:** | Adwaita |
|
| **Theme:** | adwaita |
|
||||||
| **Terminal:** | Ghostty |
|
| **Terminal:** | Console |
|
||||||
|
|
||||||
## Provisioning a new host
|
## Provisioning a new host
|
||||||
> [nixos-anywhere](https://github.com/nix-community/nixos-anywhere) is the module used
|
> [nixos-anywhere](https://github.com/nix-community/nixos-anywhere) is the module used
|
||||||
@ -52,3 +52,4 @@ tailscale up --login-server https://headscale.vimium.net
|
|||||||
then visit the URL, SSH onto `vps1` and run `headscale --user mesh nodes register --key <key>`.
|
then visit the URL, SSH onto `vps1` and run `headscale --user mesh nodes register --key <key>`.
|
||||||
|
|
||||||
The new node can optionally be given a friendly name with `headscale node rename -i <index> <hostname>`.
|
The new node can optionally be given a friendly name with `headscale node rename -i <index> <hostname>`.
|
||||||
|
|
||||||
|
836
flake.lock
generated
836
flake.lock
generated
File diff suppressed because it is too large
Load Diff
96
flake.nix
96
flake.nix
@ -2,7 +2,7 @@
|
|||||||
description = "NixOS system configuration";
|
description = "NixOS system configuration";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "nixpkgs/nixos-25.05";
|
nixpkgs.url = "nixpkgs/nixos-24.05";
|
||||||
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
|
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
|
||||||
# nixpkgs-master.url = "nixpkgs";
|
# nixpkgs-master.url = "nixpkgs";
|
||||||
agenix.url = "github:ryantm/agenix";
|
agenix.url = "github:ryantm/agenix";
|
||||||
@ -12,14 +12,9 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-25.05";
|
url = "github:nix-community/home-manager/release-24.05";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
hyprland.url = "github:hyprwm/Hyprland";
|
|
||||||
hyprland-plugins = {
|
|
||||||
url = "github:hyprwm/hyprland-plugins";
|
|
||||||
inputs.hyprland.follows = "hyprland";
|
|
||||||
};
|
|
||||||
firefox-gnome-theme = {
|
firefox-gnome-theme = {
|
||||||
url = "github:rafaelmardojai/firefox-gnome-theme";
|
url = "github:rafaelmardojai/firefox-gnome-theme";
|
||||||
flake = false;
|
flake = false;
|
||||||
@ -28,23 +23,23 @@
|
|||||||
url = "git+ssh://git@git.vimium.com/jordan/gitea-github-theme.git?ref=main";
|
url = "git+ssh://git@git.vimium.com/jordan/gitea-github-theme.git?ref=main";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
impermanence.url = "github:nix-community/impermanence";
|
|
||||||
kvlibadwaita = {
|
kvlibadwaita = {
|
||||||
url = "github:GabePoel/KvLibadwaita";
|
url = "github:GabePoel/KvLibadwaita";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
||||||
nixos-mailserver = {
|
nixos-mailserver = {
|
||||||
url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-25.05";
|
url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
nixvim = {
|
nixvim = {
|
||||||
url = "github:nix-community/nixvim/nixos-25.05";
|
url = "github:nix-community/nixvim/nixos-24.05";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
pre-commit-hooks = {
|
plasma-manager = {
|
||||||
url = "github:cachix/git-hooks.nix";
|
url = "github:nix-community/plasma-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.home-manager.follows = "home-manager";
|
||||||
};
|
};
|
||||||
secrets = {
|
secrets = {
|
||||||
url = "git+ssh://git@git.vimium.com/jordan/nix-secrets.git";
|
url = "git+ssh://git@git.vimium.com/jordan/nix-secrets.git";
|
||||||
@ -56,12 +51,12 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs = inputs @ { self, nixpkgs, ... }:
|
||||||
inputs@{ self, nixpkgs, ... }:
|
|
||||||
let
|
let
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
|
|
||||||
domain = "mesh.vimium.net";
|
domain = "mesh.vimium.net";
|
||||||
|
forEverySystem = lib.getAttrs lib.systems.flakeExposed;
|
||||||
forEachSystem = lib.genAttrs [
|
forEachSystem = lib.genAttrs [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
"aarch64-linux"
|
"aarch64-linux"
|
||||||
@ -71,11 +66,7 @@
|
|||||||
|
|
||||||
profiles.system = {
|
profiles.system = {
|
||||||
user = "root";
|
user = "root";
|
||||||
path =
|
path = inputs.deploy-rs.lib.${self.nixosConfigurations.${hostName}.config.system.build.toplevel.system}.activate.nixos self.nixosConfigurations.${hostName};
|
||||||
inputs.deploy-rs.lib.${
|
|
||||||
self.nixosConfigurations.${hostName}.config.system.build.toplevel.system
|
|
||||||
}.activate.nixos
|
|
||||||
self.nixosConfigurations.${hostName};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
@ -85,21 +76,18 @@
|
|||||||
directory = ./overlays;
|
directory = ./overlays;
|
||||||
};
|
};
|
||||||
|
|
||||||
legacyPackages = forEachSystem (
|
legacyPackages = forEachSystem (system:
|
||||||
system:
|
|
||||||
lib.packagesFromDirectoryRecursive {
|
lib.packagesFromDirectoryRecursive {
|
||||||
callPackage = nixpkgs.legacyPackages.${system}.callPackage;
|
callPackage = nixpkgs.legacyPackages.${system}.callPackage;
|
||||||
directory = ./pkgs;
|
directory = ./pkgs;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
nixosConfigurations = lib.pipe ./hosts [
|
nixosConfigurations = lib.pipe ./hosts [
|
||||||
builtins.readDir
|
builtins.readDir
|
||||||
(lib.filterAttrs (name: value: value == "directory"))
|
(lib.filterAttrs (name: value: value == "directory"))
|
||||||
(lib.mapAttrs (
|
(lib.mapAttrs (name: value:
|
||||||
name: value:
|
|
||||||
lib.nixosSystem {
|
lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit self; };
|
||||||
|
|
||||||
modules = [
|
modules = [
|
||||||
{
|
{
|
||||||
@ -110,58 +98,24 @@
|
|||||||
}
|
}
|
||||||
./hosts/${name}
|
./hosts/${name}
|
||||||
];
|
];
|
||||||
}
|
}))
|
||||||
))
|
|
||||||
];
|
];
|
||||||
|
|
||||||
checks =
|
devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {
|
||||||
builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib
|
buildInputs = [
|
||||||
// (forEachSystem (system: {
|
inputs.agenix.packages.x86_64-linux.agenix
|
||||||
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
|
inputs.deploy-rs.packages.x86_64-linux.deploy-rs
|
||||||
src = ./.;
|
];
|
||||||
hooks = {
|
};
|
||||||
check-case-conflicts.enable = true;
|
|
||||||
check-executables-have-shebangs.enable = true;
|
|
||||||
check-merge-conflicts.enable = true;
|
|
||||||
deadnix = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
noLambdaArg = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
detect-private-keys.enable = true;
|
|
||||||
end-of-file-fixer.enable = true;
|
|
||||||
fix-byte-order-marker.enable = true;
|
|
||||||
mixed-line-endings.enable = true;
|
|
||||||
nixfmt-rfc-style.enable = true;
|
|
||||||
trim-trailing-whitespace.enable = true;
|
|
||||||
};
|
|
||||||
excludes = [ "pkgs/libcamera-rpi/libcamera-rpi-ipa-priv-key.pem" ];
|
|
||||||
};
|
|
||||||
}));
|
|
||||||
|
|
||||||
formatter = forEachSystem (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
|
|
||||||
|
|
||||||
devShells = forEachSystem (system: {
|
|
||||||
default = nixpkgs.legacyPackages.${system}.mkShell {
|
|
||||||
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
|
||||||
buildInputs = [
|
|
||||||
inputs.agenix.packages.${system}.agenix
|
|
||||||
inputs.deploy-rs.packages.${system}.deploy-rs
|
|
||||||
] ++ self.checks.${system}.pre-commit-check.enabledPackages;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
deploy = {
|
deploy = {
|
||||||
magicRollback = true;
|
magicRollback = true;
|
||||||
autoRollback = true;
|
autoRollback = true;
|
||||||
sshUser = "root";
|
sshUser = "root";
|
||||||
nodes = lib.genAttrs [
|
nodes = lib.genAttrs [ "mail" "pi" "skycam" "vps1" ] mkDeployNode;
|
||||||
"mail"
|
|
||||||
"pi"
|
|
||||||
"skycam"
|
|
||||||
"vps1"
|
|
||||||
] mkDeployNode;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -22,6 +22,30 @@
|
|||||||
users.extraGroups.vboxusers.members = [ "jordan" ];
|
users.extraGroups.vboxusers.members = [ "jordan" ];
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
|
desktop = {
|
||||||
|
apps = {
|
||||||
|
qbittorrent.enable = true;
|
||||||
|
thunderbird.enable = true;
|
||||||
|
};
|
||||||
|
browsers = {
|
||||||
|
firefox.enable = true;
|
||||||
|
};
|
||||||
|
media.graphics = {
|
||||||
|
raster.enable = true;
|
||||||
|
vector.enable = true;
|
||||||
|
};
|
||||||
|
office.libreoffice.enable = true;
|
||||||
|
};
|
||||||
|
dev = {
|
||||||
|
node.enable = true;
|
||||||
|
};
|
||||||
|
editors = {
|
||||||
|
neovim.enable = true;
|
||||||
|
};
|
||||||
|
security = {
|
||||||
|
gpg.enable = true;
|
||||||
|
pass.enable = true;
|
||||||
|
};
|
||||||
services = {
|
services = {
|
||||||
borgmatic = {
|
borgmatic = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -31,6 +55,10 @@
|
|||||||
repoPath = "ssh://uzu2y5b1@uzu2y5b1.repo.borgbase.com/./repo";
|
repoPath = "ssh://uzu2y5b1@uzu2y5b1.repo.borgbase.com/./repo";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
shell = {
|
||||||
|
git.enable = true;
|
||||||
|
zsh.enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = "22.11";
|
system.stateVersion = "22.11";
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -11,14 +6,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd.availableKernelModules = [
|
initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
"xhci_pci"
|
|
||||||
"ehci_pci"
|
|
||||||
"ahci"
|
|
||||||
"usbhid"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
];
|
|
||||||
initrd.kernelModules = [ ];
|
initrd.kernelModules = [ ];
|
||||||
initrd.supportedFilesystems = [ "zfs" ];
|
initrd.supportedFilesystems = [ "zfs" ];
|
||||||
kernelModules = [ "kvm-intel" ];
|
kernelModules = [ "kvm-intel" ];
|
||||||
|
@ -1,32 +1,21 @@
|
|||||||
{
|
{ config, pkgs, self, ... }:
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.agenix.nixosModules.age
|
self.inputs.agenix.nixosModules.age
|
||||||
inputs.home-manager.nixosModules.home-manager
|
self.inputs.home-manager.nixosModule
|
||||||
../modules/nixos
|
../modules
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs = {
|
nixpkgs.overlays = [
|
||||||
config.allowUnfree = true;
|
self.inputs.agenix.overlays.default
|
||||||
overlays = [
|
(import ../overlays/default.nix)
|
||||||
inputs.agenix.overlays.default
|
(
|
||||||
(import ../overlays/default.nix)
|
final: prev: {
|
||||||
(final: prev: {
|
unstable = import self.inputs.nixpkgs-unstable { system = final.system; };
|
||||||
unstable = import inputs.nixpkgs-unstable {
|
}
|
||||||
config = {
|
)
|
||||||
allowUnfree = true;
|
];
|
||||||
};
|
|
||||||
system = final.system;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
time.timeZone = "Europe/London";
|
time.timeZone = "Europe/London";
|
||||||
|
|
||||||
@ -62,29 +51,21 @@
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
users.defaultUserShell = pkgs.zsh;
|
users.defaultUserShell = pkgs.zsh;
|
||||||
programs.zsh = {
|
programs.zsh.enable = true;
|
||||||
enable = true;
|
|
||||||
enableCompletion = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.pathsToLink = [ "/share/zsh" ];
|
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
package = pkgs.nixVersions.stable;
|
package = pkgs.nixFlakes;
|
||||||
extraOptions = ''
|
extraOptions = ''
|
||||||
experimental-features = nix-command flakes
|
experimental-features = nix-command flakes
|
||||||
'';
|
'';
|
||||||
buildMachines = [
|
buildMachines = [
|
||||||
{
|
{
|
||||||
hostName = "10.0.1.235";
|
hostName = "10.0.1.79";
|
||||||
sshUser = "root";
|
sshUser = "root";
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
maxJobs = 6;
|
maxJobs = 6;
|
||||||
speedFactor = 1;
|
speedFactor = 1;
|
||||||
supportedFeatures = [
|
supportedFeatures = [ "big-parallel" "benchmark" ];
|
||||||
"big-parallel"
|
|
||||||
"benchmark"
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
distributedBuilds = true;
|
distributedBuilds = true;
|
||||||
@ -111,20 +92,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager = {
|
|
||||||
useGlobalPkgs = true;
|
|
||||||
useUserPackages = true;
|
|
||||||
sharedModules = [
|
|
||||||
inputs.nixvim.homeManagerModules.nixvim
|
|
||||||
{
|
|
||||||
home.stateVersion = config.system.stateVersion;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit inputs;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
git
|
git
|
||||||
neovim
|
neovim
|
||||||
|
@ -1,18 +1,19 @@
|
|||||||
{
|
{ config, pkgs, ... }:
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./common.nix
|
./common.nix
|
||||||
../users/jordan
|
];
|
||||||
|
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(import ../overlays/gnome)
|
||||||
];
|
];
|
||||||
|
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
services.openssh.startWhenNeeded = true;
|
services.openssh.startWhenNeeded = true;
|
||||||
|
|
||||||
services.pulseaudio.enable = false;
|
sound.enable = true;
|
||||||
|
hardware.pulseaudio.enable = false;
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -46,9 +47,14 @@
|
|||||||
|
|
||||||
systemd.services.NetworkManager-wait-online.enable = false;
|
systemd.services.NetworkManager-wait-online.enable = false;
|
||||||
|
|
||||||
|
fonts.packages = with pkgs; [
|
||||||
|
noto-fonts
|
||||||
|
(nerdfonts.override { fonts = [ "BigBlueTerminal" "ComicShannsMono" "Terminus" "UbuntuMono" ]; })
|
||||||
|
];
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
system.desktop.gnome.enable = true;
|
desktop.gnome.enable = true;
|
||||||
services.tailscale.enable = true;
|
networking.tailscale.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -18,5 +18,34 @@
|
|||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dconf.settings = {
|
||||||
|
"org/gnome/desktop/interface" = {
|
||||||
|
show-battery-percentage = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
modules = {
|
||||||
|
desktop = {
|
||||||
|
apps.qbittorrent.enable = true;
|
||||||
|
browsers = {
|
||||||
|
firefox.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
dev = {
|
||||||
|
node.enable = true;
|
||||||
|
};
|
||||||
|
editors = {
|
||||||
|
neovim.enable = true;
|
||||||
|
};
|
||||||
|
security = {
|
||||||
|
gpg.enable = true;
|
||||||
|
pass.enable = true;
|
||||||
|
};
|
||||||
|
shell = {
|
||||||
|
git.enable = true;
|
||||||
|
zsh.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
system.stateVersion = "22.11";
|
system.stateVersion = "22.11";
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -11,19 +6,12 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd.availableKernelModules = [
|
initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||||
"ehci_pci"
|
initrd.kernelModules = [ ];
|
||||||
"ahci"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
"sdhci_pci"
|
|
||||||
];
|
|
||||||
initrd.supportedFilesystems = [ "zfs" ];
|
initrd.supportedFilesystems = [ "zfs" ];
|
||||||
kernel.sysctl = {
|
kernelModules = [ ];
|
||||||
"kernel.nmi_watchdog" = 0;
|
|
||||||
"vm.laptop_mode" = 5;
|
|
||||||
};
|
|
||||||
kernelParams = [ "elevator=none" ];
|
kernelParams = [ "elevator=none" ];
|
||||||
|
extraModulePackages = [ ];
|
||||||
supportedFilesystems = [ "zfs" ];
|
supportedFilesystems = [ "zfs" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
{
|
{ config, ... }:
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (lib) mkForce;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
@ -28,11 +21,23 @@ in
|
|||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [
|
|
||||||
pkgs.moonlight-qt
|
|
||||||
];
|
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
|
desktop = {
|
||||||
|
apps.qbittorrent.enable = true;
|
||||||
|
browsers = {
|
||||||
|
firefox.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
dev = {
|
||||||
|
node.enable = true;
|
||||||
|
};
|
||||||
|
editors = {
|
||||||
|
neovim.enable = true;
|
||||||
|
};
|
||||||
|
security = {
|
||||||
|
gpg.enable = true;
|
||||||
|
pass.enable = true;
|
||||||
|
};
|
||||||
services = {
|
services = {
|
||||||
borgmatic = {
|
borgmatic = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -42,9 +47,9 @@ in
|
|||||||
repoPath = "ssh://b9cjl9hq@b9cjl9hq.repo.borgbase.com/./repo";
|
repoPath = "ssh://b9cjl9hq@b9cjl9hq.repo.borgbase.com/./repo";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
system.desktop = {
|
shell = {
|
||||||
gnome.enable = mkForce false;
|
git.enable = true;
|
||||||
hyprland.enable = true;
|
zsh.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -11,15 +6,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd.availableKernelModules = [
|
initrd.availableKernelModules = [ "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" "zfs" ];
|
||||||
"ehci_pci"
|
|
||||||
"ahci"
|
|
||||||
"usbhid"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
"sr_mod"
|
|
||||||
"zfs"
|
|
||||||
];
|
|
||||||
initrd.kernelModules = [ ];
|
initrd.kernelModules = [ ];
|
||||||
initrd.supportedFilesystems = [ "zfs" ];
|
initrd.supportedFilesystems = [ "zfs" ];
|
||||||
kernelModules = [ "kvm-intel" ];
|
kernelModules = [ "kvm-intel" ];
|
||||||
@ -28,8 +15,6 @@
|
|||||||
supportedFilesystems = [ "zfs" ];
|
supportedFilesystems = [ "zfs" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = "schedutil";
|
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "rpool/system/root";
|
device = "rpool/system/root";
|
||||||
fsType = "zfs";
|
fsType = "zfs";
|
||||||
|
@ -15,7 +15,7 @@ index d5a8182cf..be722c43a 100644
|
|||||||
@@ -449,6 +449,63 @@ static void setup_graphics(struct boot_params *boot_params)
|
@@ -449,6 +449,63 @@ static void setup_graphics(struct boot_params *boot_params)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+typedef struct {
|
+typedef struct {
|
||||||
+ u64 version;
|
+ u64 version;
|
||||||
+ void (*set_os_version) (const char *os_version);
|
+ void (*set_os_version) (const char *os_version);
|
||||||
@ -73,13 +73,13 @@ index d5a8182cf..be722c43a 100644
|
|||||||
+
|
+
|
||||||
+ return status;
|
+ return status;
|
||||||
+}
|
+}
|
||||||
|
|
||||||
static void __noreturn efi_exit(efi_handle_t handle, efi_status_t status)
|
static void __noreturn efi_exit(efi_handle_t handle, efi_status_t status)
|
||||||
{
|
{
|
||||||
@@ -951,6 +1008,8 @@ void __noreturn efi_stub_entry(efi_handle_t handle,
|
@@ -951,6 +1008,8 @@ void __noreturn efi_stub_entry(efi_handle_t handle,
|
||||||
|
|
||||||
setup_unaccepted_memory();
|
setup_unaccepted_memory();
|
||||||
|
|
||||||
+ apple_set_os();
|
+ apple_set_os();
|
||||||
+
|
+
|
||||||
status = exit_boot(boot_params, handle);
|
status = exit_boot(boot_params, handle);
|
||||||
@ -97,5 +97,6 @@ index d59b0947f..81158014f 100644
|
|||||||
#define EFI_TCG2_PROTOCOL_GUID EFI_GUID(0x607f766c, 0x7455, 0x42be, 0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f)
|
#define EFI_TCG2_PROTOCOL_GUID EFI_GUID(0x607f766c, 0x7455, 0x42be, 0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f)
|
||||||
#define EFI_TCG2_FINAL_EVENTS_TABLE_GUID EFI_GUID(0x1e2ed096, 0x30e2, 0x4254, 0xbd, 0x89, 0x86, 0x3b, 0xbe, 0xf8, 0x23, 0x25)
|
#define EFI_TCG2_FINAL_EVENTS_TABLE_GUID EFI_GUID(0x1e2ed096, 0x30e2, 0x4254, 0xbd, 0x89, 0x86, 0x3b, 0xbe, 0xf8, 0x23, 0x25)
|
||||||
#define EFI_LOAD_FILE_PROTOCOL_GUID EFI_GUID(0x56ec3091, 0x954c, 0x11d2, 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
|
#define EFI_LOAD_FILE_PROTOCOL_GUID EFI_GUID(0x56ec3091, 0x954c, 0x11d2, 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
|
||||||
--
|
--
|
||||||
2.42.0
|
2.42.0
|
||||||
|
|
||||||
|
@ -1,13 +1,8 @@
|
|||||||
{
|
{ config, lib, self, ... }:
|
||||||
inputs,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.disko.nixosModules.disko
|
self.inputs.disko.nixosModules.disko
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./disko-config.nix
|
./disko-config.nix
|
||||||
../desktop.nix
|
../desktop.nix
|
||||||
@ -16,6 +11,7 @@
|
|||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
hostPlatform = "x86_64-linux";
|
hostPlatform = "x86_64-linux";
|
||||||
config = {
|
config = {
|
||||||
|
allowUnfree = true;
|
||||||
nvidia.acceptLicense = true;
|
nvidia.acceptLicense = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -34,16 +30,38 @@
|
|||||||
videoDrivers = [ "nvidia" ];
|
videoDrivers = [ "nvidia" ];
|
||||||
};
|
};
|
||||||
displayManager = {
|
displayManager = {
|
||||||
defaultSession = "gnome-xorg";
|
defaultSession = if config.modules.desktop.kde.enable then "plasmax11" else "gnome-xorg";
|
||||||
|
sddm.wayland.enable = lib.mkForce false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Workaround for label rendering bug in GTK4 with nvidia 470 driver
|
# Workaround for label rendering bug in GTK4 with nvidia 470 driver
|
||||||
environment.sessionVariables.GSK_RENDERER = "gl";
|
environment.sessionVariables.GSK_RENDERER = "gl";
|
||||||
|
|
||||||
environment.systemPackages = [
|
modules = {
|
||||||
pkgs.moonlight-qt
|
desktop = {
|
||||||
];
|
browsers = {
|
||||||
|
firefox.enable = true;
|
||||||
|
};
|
||||||
|
media.recording = {
|
||||||
|
audio.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
dev = {
|
||||||
|
node.enable = true;
|
||||||
|
};
|
||||||
|
editors = {
|
||||||
|
neovim.enable = true;
|
||||||
|
};
|
||||||
|
security = {
|
||||||
|
gpg.enable = true;
|
||||||
|
pass.enable = true;
|
||||||
|
};
|
||||||
|
shell = {
|
||||||
|
git.enable = true;
|
||||||
|
zsh.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
system.stateVersion = "22.11";
|
system.stateVersion = "22.11";
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
disko.devices = {
|
disko.devices = {
|
||||||
disk = {
|
disk = {
|
||||||
@ -123,3 +123,4 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -12,22 +6,8 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd.availableKernelModules = [
|
initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
"xhci_pci"
|
kernelModules = [ "applesmc" "kvm-intel" "wl" ];
|
||||||
"ahci"
|
|
||||||
"usbhid"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
];
|
|
||||||
kernel.sysctl = {
|
|
||||||
"kernel.nmi_watchdog" = 0;
|
|
||||||
"vm.laptop_mode" = 5;
|
|
||||||
};
|
|
||||||
kernelModules = [
|
|
||||||
"applesmc"
|
|
||||||
"kvm-intel"
|
|
||||||
"wl"
|
|
||||||
];
|
|
||||||
extraModulePackages = [
|
extraModulePackages = [
|
||||||
config.boot.kernelPackages.broadcom_sta
|
config.boot.kernelPackages.broadcom_sta
|
||||||
config.boot.kernelPackages.nvidiaPackages.legacy_470
|
config.boot.kernelPackages.nvidiaPackages.legacy_470
|
||||||
@ -45,12 +25,14 @@
|
|||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
powerManagement.enable = true;
|
powerManagement.enable = true;
|
||||||
};
|
};
|
||||||
graphics = {
|
opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
libvdpau-va-gl
|
libvdpau-va-gl
|
||||||
];
|
];
|
||||||
enable32Bit = true;
|
driSupport = true;
|
||||||
|
driSupport32Bit = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,12 +8,12 @@ Media and public file server.
|
|||||||
* Chipset - AMD B550
|
* Chipset - AMD B550
|
||||||
* Memory - 64 GB DDR4
|
* Memory - 64 GB DDR4
|
||||||
* Motherboard - ASRock B550M Pro4
|
* Motherboard - ASRock B550M Pro4
|
||||||
* Case - JMCD-12S4
|
* Case - Fractal Design Node 804
|
||||||
|
|
||||||
### Disks
|
### Disks
|
||||||
Device | Partitions _(filesystem, size, usage)_
|
Device | Partitions _(filesystem, size, usage)_
|
||||||
--- | ---
|
--- | ---
|
||||||
Samsung 970 Evo Plus | `/dev/nvme0n1p1` (EFI, 512 MiB, NixOS Boot) <br> `/dev/nvme0n1p2` (ZFS `rpool`, 200 GiB, NixOS Root)
|
Samsung 980 Evo | `/dev/nvme0n1p1` (EFI, 512 MiB, NixOS Boot) <br> `/dev/nvme0n1p2` (ZFS `rpool`, 200 GiB, NixOS Root)
|
||||||
|
|
||||||
#### ZFS datasets
|
#### ZFS datasets
|
||||||
```
|
```
|
||||||
@ -43,3 +43,4 @@ See [Graham Christensen's article](https://grahamc.com/blog/nixos-on-zfs/#datase
|
|||||||
### Networks
|
### Networks
|
||||||
- DHCP on `10.0.1.0/24` subnet.
|
- DHCP on `10.0.1.0/24` subnet.
|
||||||
- Tailscale on `100.64.0.0/10` subnet. FQDN: `library.mesh.vimium.net`.
|
- Tailscale on `100.64.0.0/10` subnet. FQDN: `library.mesh.vimium.net`.
|
||||||
|
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
age.secrets."files/services/open-webui/envfile" = {
|
|
||||||
file = "${inputs.secrets}/files/services/open-webui/envfile.age";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.open-webui = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.unstable.open-webui;
|
|
||||||
port = 8081;
|
|
||||||
environment =
|
|
||||||
let
|
|
||||||
clientId = "open-webui";
|
|
||||||
publicUrl = "https://chat.ai.vimium.com";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
WEBUI_URL = publicUrl;
|
|
||||||
ENABLE_LOGIN_FORM = "False";
|
|
||||||
ENABLE_OAUTH_SIGNUP = "True";
|
|
||||||
ENABLE_OAUTH_ROLE_MANAGEMENT = "True";
|
|
||||||
OAUTH_CLIENT_ID = clientId;
|
|
||||||
OAUTH_PROVIDER_NAME = "Vimium";
|
|
||||||
OPENID_PROVIDER_URL = "https://auth.vimium.com/oauth2/openid/${clientId}/.well-known/openid-configuration";
|
|
||||||
OPENID_REDIRECT_URI = "${publicUrl}/oauth/oidc/callback";
|
|
||||||
};
|
|
||||||
environmentFile = config.age.secrets."files/services/open-webui/envfile".path;
|
|
||||||
};
|
|
||||||
|
|
||||||
modules.services.borgmatic.directories = [
|
|
||||||
"/var/lib/private/open-webui"
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,17 +1,8 @@
|
|||||||
{
|
{ config, pkgs, ... }:
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./ai.nix
|
|
||||||
./grafana.nix
|
|
||||||
./jellyfin.nix
|
|
||||||
./jellysearch.nix
|
|
||||||
./nginx.nix
|
|
||||||
./prometheus.nix
|
|
||||||
./tunnel.nix
|
|
||||||
../server.nix
|
../server.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -20,21 +11,15 @@
|
|||||||
boot = {
|
boot = {
|
||||||
loader.systemd-boot.enable = true;
|
loader.systemd-boot.enable = true;
|
||||||
loader.efi.canTouchEfiVariables = true;
|
loader.efi.canTouchEfiVariables = true;
|
||||||
zfs.extraPools = [
|
zfs.extraPools = [ "library" ];
|
||||||
"downloads"
|
|
||||||
"library"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostId = "d24ae953";
|
hostId = "d24ae953";
|
||||||
hosts = {
|
|
||||||
"100.64.0.1" = [ "auth.vimium.com" ];
|
|
||||||
};
|
|
||||||
firewall = {
|
firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
22 # SSH
|
22 # SSH
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -58,12 +43,146 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.grafana = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
domain = "library.mesh.vimium.net";
|
||||||
|
http_addr = "0.0.0.0";
|
||||||
|
http_port = 3000;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.prometheus = {
|
||||||
|
enable = true;
|
||||||
|
port = 9001;
|
||||||
|
exporters = {
|
||||||
|
node = {
|
||||||
|
enable = true;
|
||||||
|
enabledCollectors = [ "systemd" ];
|
||||||
|
port = 9002;
|
||||||
|
};
|
||||||
|
zfs = {
|
||||||
|
enable = true;
|
||||||
|
port = 9003;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
scrapeConfigs = [
|
||||||
|
{
|
||||||
|
job_name = "node";
|
||||||
|
static_configs = [{
|
||||||
|
targets = [
|
||||||
|
"127.0.0.1:${toString config.services.prometheus.exporters.node.port}"
|
||||||
|
"127.0.0.1:${toString config.services.prometheus.exporters.zfs.port}"
|
||||||
|
];
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.vps1-tunnel = {
|
||||||
|
enable = true;
|
||||||
|
description = "vps1.mesh.vimium.net SSH tunnel";
|
||||||
|
after = [
|
||||||
|
"network-online.target"
|
||||||
|
"jellyfin.service"
|
||||||
|
];
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type="simple";
|
||||||
|
ExecStart=pkgs.lib.mkForce ''
|
||||||
|
${pkgs.openssh}/bin/ssh \
|
||||||
|
-NT \
|
||||||
|
-o ExitOnForwardFailure=yes \
|
||||||
|
-o ServerAliveInterval=60 \
|
||||||
|
-o TCPKeepAlive=no \
|
||||||
|
-i %h/.ssh/id_jellyfin \
|
||||||
|
-R localhost:8000:localhost:8000 \
|
||||||
|
jellyfin@vps1.mesh.vimium.net
|
||||||
|
'';
|
||||||
|
Restart="always";
|
||||||
|
RestartSec=20;
|
||||||
|
};
|
||||||
|
wantedBy = [ "default.target" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx = let
|
||||||
|
proxyConfig = ''
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
|
||||||
|
proxy_set_header Range $http_range;
|
||||||
|
proxy_set_header If-Range $http_if_range;
|
||||||
|
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
'';
|
||||||
|
in {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.openresty;
|
||||||
|
recommendedGzipSettings = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
recommendedTlsSettings = true;
|
||||||
|
clientMaxBodySize = "2G";
|
||||||
|
virtualHosts = {
|
||||||
|
"library.mesh.vimium.net" = {
|
||||||
|
locations."/" = {
|
||||||
|
root = "/mnt/library";
|
||||||
|
extraConfig = ''
|
||||||
|
autoindex on;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"jellyfin.vimium.com" = {
|
||||||
|
default = true;
|
||||||
|
listen = [
|
||||||
|
{
|
||||||
|
addr = "127.0.0.1";
|
||||||
|
port = 8000;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:8096";
|
||||||
|
extraConfig = proxyConfig;
|
||||||
|
};
|
||||||
|
locations."/metrics" = {
|
||||||
|
return = "404";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.opengl = {
|
||||||
|
enable = true;
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
vaapiVdpau
|
||||||
|
];
|
||||||
|
driSupport = true;
|
||||||
|
};
|
||||||
|
users.users.jellyfin.extraGroups = [ "video" "render" ];
|
||||||
|
services.jellyfin = {
|
||||||
|
enable = true;
|
||||||
|
cacheDir = "/var/cache/jellyfin";
|
||||||
|
dataDir = "/var/lib/jellyfin";
|
||||||
|
};
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
podman.enable = true;
|
podman.enable = true;
|
||||||
|
security = {
|
||||||
|
gpg.enable = true;
|
||||||
|
};
|
||||||
|
shell = {
|
||||||
|
zsh.enable = true;
|
||||||
|
};
|
||||||
services = {
|
services = {
|
||||||
borgmatic = {
|
borgmatic = {
|
||||||
enable = true;
|
enable = true;
|
||||||
directories = [
|
directories = [
|
||||||
|
config.services.jellyfin.dataDir
|
||||||
"/home/jordan"
|
"/home/jordan"
|
||||||
];
|
];
|
||||||
repoPath = "ssh://b61758r4@b61758r4.repo.borgbase.com/./repo";
|
repoPath = "ssh://b61758r4@b61758r4.repo.borgbase.com/./repo";
|
||||||
@ -73,3 +192,4 @@
|
|||||||
|
|
||||||
system.stateVersion = "22.11";
|
system.stateVersion = "22.11";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
services.grafana = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
server = {
|
|
||||||
domain = "library.mesh.vimium.net";
|
|
||||||
http_addr = "0.0.0.0";
|
|
||||||
http_port = 3000;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -11,13 +6,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd.availableKernelModules = [
|
initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
|
||||||
"xhci_pci"
|
|
||||||
"ahci"
|
|
||||||
"nvme"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
];
|
|
||||||
initrd.kernelModules = [ ];
|
initrd.kernelModules = [ ];
|
||||||
kernelModules = [ "kvm-amd" ];
|
kernelModules = [ "kvm-amd" ];
|
||||||
extraModulePackages = [ ];
|
extraModulePackages = [ ];
|
||||||
@ -76,3 +65,4 @@
|
|||||||
|
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
hardware.graphics = {
|
|
||||||
enable = true;
|
|
||||||
extraPackages = with pkgs; [
|
|
||||||
vaapiVdpau
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.jellyfin.extraGroups = [
|
|
||||||
"video"
|
|
||||||
"render"
|
|
||||||
];
|
|
||||||
|
|
||||||
services.jellyfin = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.unstable.jellyfin;
|
|
||||||
cacheDir = "/var/cache/jellyfin";
|
|
||||||
dataDir = "/var/lib/jellyfin";
|
|
||||||
};
|
|
||||||
|
|
||||||
modules.services.borgmatic.directories = [
|
|
||||||
config.services.jellyfin.dataDir
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,58 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
age.secrets."files/services/meilisearch/envfile" = {
|
|
||||||
file = "${inputs.secrets}/files/services/meilisearch/envfile.age";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.meilisearch = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.meilisearch;
|
|
||||||
masterKeyEnvironmentFile = config.age.secrets."files/services/meilisearch/envfile".path;
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.jellysearch = {
|
|
||||||
group = "jellysearch";
|
|
||||||
isSystemUser = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
users.groups.jellysearch = { };
|
|
||||||
|
|
||||||
systemd.services.jellysearch = {
|
|
||||||
enable = true;
|
|
||||||
description = "JellySearch";
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
after = [ "network-online.target" ];
|
|
||||||
wants = [ "network-online.target" ];
|
|
||||||
serviceConfig = {
|
|
||||||
Restart = "on-failure";
|
|
||||||
ExecStart = "${pkgs.jellysearch}/bin/jellysearch";
|
|
||||||
StateDirectory = "jellysearch";
|
|
||||||
StateDirectoryMode = "0750";
|
|
||||||
WorkingDirectory = "/var/lib/jellysearch";
|
|
||||||
EnvironmentFile = config.age.secrets."files/services/meilisearch/envfile".path;
|
|
||||||
|
|
||||||
NoNewPrivileges = true;
|
|
||||||
SystemCallArchitectures = "native";
|
|
||||||
RestrictRealtime = true;
|
|
||||||
RestrictSUIDSGID = true;
|
|
||||||
ProtectHostname = true;
|
|
||||||
LockPersonality = true;
|
|
||||||
PrivateDevices = true;
|
|
||||||
PrivateUsers = true;
|
|
||||||
RemoveIPC = true;
|
|
||||||
};
|
|
||||||
environment = {
|
|
||||||
DOTNET_ENVIRONMENT = "Production";
|
|
||||||
INDEX_CRON = "0 0 0/2 ? * * *";
|
|
||||||
JELLYFIN_URL = "http://localhost:8096";
|
|
||||||
JELLYFIN_CONFIG_DIR = "${toString config.services.jellyfin.dataDir}";
|
|
||||||
MEILI_URL = "http://localhost:${toString config.services.meilisearch.listenPort}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,88 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
services.nginx =
|
|
||||||
let
|
|
||||||
proxyConfig = ''
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
{
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.openresty;
|
|
||||||
recommendedGzipSettings = true;
|
|
||||||
recommendedOptimisation = true;
|
|
||||||
recommendedTlsSettings = true;
|
|
||||||
clientMaxBodySize = "2G";
|
|
||||||
virtualHosts = {
|
|
||||||
"library.mesh.vimium.net" = {
|
|
||||||
locations."/" = {
|
|
||||||
root = "/mnt/library";
|
|
||||||
extraConfig = ''
|
|
||||||
autoindex on;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"chat.ai.vimium.com" = {
|
|
||||||
listen = [
|
|
||||||
{
|
|
||||||
addr = "127.0.0.1";
|
|
||||||
port = 8001;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://localhost:8081";
|
|
||||||
extraConfig =
|
|
||||||
proxyConfig
|
|
||||||
+ ''
|
|
||||||
# Disable proxy buffering for better streaming response from models
|
|
||||||
proxy_buffering off;
|
|
||||||
|
|
||||||
# Increase max request size for large attachments and long audio messages
|
|
||||||
client_max_body_size 20M;
|
|
||||||
proxy_read_timeout 10m;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"jellyfin.vimium.com" = {
|
|
||||||
default = true;
|
|
||||||
listen = [
|
|
||||||
{
|
|
||||||
addr = "127.0.0.1";
|
|
||||||
port = 8000;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
locations."/" = {
|
|
||||||
extraConfig =
|
|
||||||
''
|
|
||||||
# Proxy JellySearch first
|
|
||||||
if ($arg_searchTerm) {
|
|
||||||
proxy_pass http://localhost:5000;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
proxy_pass http://localhost:8096;
|
|
||||||
''
|
|
||||||
+ proxyConfig
|
|
||||||
+ ''
|
|
||||||
proxy_set_header Range $http_range;
|
|
||||||
proxy_set_header If-Range $http_if_range;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
locations."/metrics" = {
|
|
||||||
return = "404";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
services.prometheus = {
|
|
||||||
enable = true;
|
|
||||||
port = 9001;
|
|
||||||
exporters = {
|
|
||||||
node = {
|
|
||||||
enable = true;
|
|
||||||
enabledCollectors = [ "systemd" ];
|
|
||||||
port = 9002;
|
|
||||||
};
|
|
||||||
zfs = {
|
|
||||||
enable = true;
|
|
||||||
port = 9003;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
scrapeConfigs = [
|
|
||||||
{
|
|
||||||
job_name = "node";
|
|
||||||
static_configs = [
|
|
||||||
{
|
|
||||||
targets = [
|
|
||||||
"127.0.0.1:${toString config.services.prometheus.exporters.node.port}"
|
|
||||||
"127.0.0.1:${toString config.services.prometheus.exporters.zfs.port}"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
systemd.services.vps1-tunnel = {
|
|
||||||
enable = true;
|
|
||||||
description = "vps1.mesh.vimium.net SSH tunnel";
|
|
||||||
after = [
|
|
||||||
"network-online.target"
|
|
||||||
"jellyfin.service"
|
|
||||||
];
|
|
||||||
wants = [ "network-online.target" ];
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "simple";
|
|
||||||
ExecStart = pkgs.lib.mkForce ''
|
|
||||||
${pkgs.openssh}/bin/ssh \
|
|
||||||
-NT \
|
|
||||||
-o ExitOnForwardFailure=yes \
|
|
||||||
-o ServerAliveInterval=60 \
|
|
||||||
-o TCPKeepAlive=no \
|
|
||||||
-i %h/.ssh/id_jellyfin \
|
|
||||||
-R localhost:8000:localhost:8000 \
|
|
||||||
-R localhost:8001:localhost:8001 \
|
|
||||||
jellyfin@vps1.mesh.vimium.net
|
|
||||||
'';
|
|
||||||
Restart = "always";
|
|
||||||
RestartSec = 20;
|
|
||||||
};
|
|
||||||
wantedBy = [ "default.target" ];
|
|
||||||
};
|
|
||||||
}
|
|
@ -15,3 +15,4 @@ NVMe | `/dev/sda1` (ext4, NixOS Root)
|
|||||||
### Networks
|
### Networks
|
||||||
- DHCP on `10.0.1.0/24` subnet.
|
- DHCP on `10.0.1.0/24` subnet.
|
||||||
- Tailscale on `100.64.0.0/10` subnet. FQDN: `mail.mesh.vimium.net`.
|
- Tailscale on `100.64.0.0/10` subnet. FQDN: `mail.mesh.vimium.net`.
|
||||||
|
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
{
|
{ config, lib, self, ... }:
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.disko.nixosModules.disko
|
self.inputs.disko.nixosModules.disko
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./disko-config.nix
|
./disko-config.nix
|
||||||
./mail.nix
|
|
||||||
../server.nix
|
../server.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -19,11 +15,23 @@
|
|||||||
firewall = {
|
firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
22 # SSH
|
22 # SSH
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users = {
|
||||||
|
users = {
|
||||||
|
root = {
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILVHTjsyMIV4THNw6yz0OxAxGnC+41gX72UrPqTzR+OS jordan@vimium.com"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password";
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
services = {
|
services = {
|
||||||
borgmatic = {
|
borgmatic = {
|
||||||
@ -35,6 +43,7 @@
|
|||||||
];
|
];
|
||||||
repoPath = "ssh://kg2mpt28@kg2mpt28.repo.borgbase.com/./repo";
|
repoPath = "ssh://kg2mpt28@kg2mpt28.repo.borgbase.com/./repo";
|
||||||
};
|
};
|
||||||
|
mail.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -10,12 +7,7 @@
|
|||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd = {
|
initrd = {
|
||||||
availableKernelModules = [
|
availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
|
||||||
"ata_piix"
|
|
||||||
"uhci_hcd"
|
|
||||||
"xen_blkfront"
|
|
||||||
"vmw_pvscsi"
|
|
||||||
];
|
|
||||||
kernelModules = [ "nvme" ];
|
kernelModules = [ "nvme" ];
|
||||||
};
|
};
|
||||||
loader.grub = {
|
loader.grub = {
|
||||||
@ -27,3 +19,4 @@
|
|||||||
|
|
||||||
zramSwap.enable = true;
|
zramSwap.enable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,88 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
sendingDomains = [
|
|
||||||
"jdholt.com"
|
|
||||||
"vimium.com"
|
|
||||||
];
|
|
||||||
receiveOnlyDomains = [
|
|
||||||
"h0lt.com"
|
|
||||||
"jordanholt.xyz"
|
|
||||||
"vimium.co"
|
|
||||||
"vimium.co.uk"
|
|
||||||
"vimium.info"
|
|
||||||
"vimium.net"
|
|
||||||
"vimium.org"
|
|
||||||
"vimium.xyz"
|
|
||||||
];
|
|
||||||
allDomains = sendingDomains ++ receiveOnlyDomains;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
inputs.nixos-mailserver.nixosModule
|
|
||||||
];
|
|
||||||
|
|
||||||
age.secrets = {
|
|
||||||
"files/services/postfix/sasl_passwd".file =
|
|
||||||
"${inputs.secrets}/files/services/postfix/sasl_passwd.age";
|
|
||||||
"passwords/users/jordan".file = "${inputs.secrets}/passwords/users/jordan.age";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.roundcube = {
|
|
||||||
enable = true;
|
|
||||||
hostName = config.mailserver.fqdn;
|
|
||||||
extraConfig = ''
|
|
||||||
$config['smtp_server'] = "tls://${config.mailserver.fqdn}";
|
|
||||||
$config['smtp_user'] = "%u";
|
|
||||||
$config['smtp_pass'] = "%p";
|
|
||||||
'';
|
|
||||||
plugins = [ "contextmenu" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.enable = true;
|
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
|
||||||
80
|
|
||||||
443
|
|
||||||
];
|
|
||||||
|
|
||||||
mailserver = {
|
|
||||||
enable = true;
|
|
||||||
fqdn = "mail.vimium.com";
|
|
||||||
domains = allDomains;
|
|
||||||
indexDir = "/var/lib/dovecot/indices";
|
|
||||||
|
|
||||||
certificateDomains = [
|
|
||||||
"imap.vimium.com"
|
|
||||||
"smtp.vimium.com"
|
|
||||||
];
|
|
||||||
certificateScheme = "acme-nginx";
|
|
||||||
|
|
||||||
fullTextSearch.enable = true;
|
|
||||||
|
|
||||||
loginAccounts = {
|
|
||||||
"jordan@vimium.com" = {
|
|
||||||
hashedPasswordFile = config.age.secrets."passwords/users/jordan".path;
|
|
||||||
aliases = map (domain: "@" + domain) sendingDomains;
|
|
||||||
catchAll = receiveOnlyDomains;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.postfix.config = {
|
|
||||||
relayhost = "[mail.smtp2go.com]:2525";
|
|
||||||
|
|
||||||
smtp_sasl_auth_enable = "yes";
|
|
||||||
smtp_sasl_password_maps = "texthash:${
|
|
||||||
config.age.secrets."files/services/postfix/sasl_passwd".path
|
|
||||||
}";
|
|
||||||
smtp_sasl_security_options = "noanonymous";
|
|
||||||
|
|
||||||
smtp_destination_concurrency_limit = "20";
|
|
||||||
header_size_limit = "4096000";
|
|
||||||
};
|
|
||||||
}
|
|
@ -4,10 +4,10 @@
|
|||||||
Primary workstation.
|
Primary workstation.
|
||||||
|
|
||||||
## Specs
|
## Specs
|
||||||
* CPU - AMD Ryzen 9 9950X3D @ 4.30GHz
|
* CPU - Intel Core i7-5930K @ 4.10GHz
|
||||||
* Chipset - AMD X870E
|
* Chipset - Intel X99
|
||||||
* Memory - 96 GB DDR5
|
* Memory - 64 GB DDR4
|
||||||
* Motherboard - ASUS ProArt X870E-Creator WiFi
|
* Motherboard - ASUS X99-A
|
||||||
* GPU - NVIDIA RTX 3090
|
* GPU - NVIDIA RTX 3090
|
||||||
* Case - Thermaltake A500
|
* Case - Thermaltake A500
|
||||||
|
|
||||||
|
@ -1,20 +1,15 @@
|
|||||||
{
|
{ config, ... }:
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./gitea-runner.nix
|
|
||||||
./nix-serve.nix
|
|
||||||
../desktop.nix
|
../desktop.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
hostPlatform = "x86_64-linux";
|
hostPlatform = "x86_64-linux";
|
||||||
config = {
|
config = {
|
||||||
|
allowUnfree = true;
|
||||||
nvidia.acceptLicense = true;
|
nvidia.acceptLicense = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -31,10 +26,7 @@
|
|||||||
networking = {
|
networking = {
|
||||||
hostId = "c5e68d78";
|
hostId = "c5e68d78";
|
||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
firewall.trustedInterfaces = [
|
firewall.trustedInterfaces = [ "lxdbr0" "virbr0" ]; # Work around https://github.com/NixOS/nixpkgs/issues/263359
|
||||||
"lxdbr0"
|
|
||||||
"virbr0"
|
|
||||||
]; # Work around https://github.com/NixOS/nixpkgs/issues/263359
|
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
@ -42,14 +34,60 @@
|
|||||||
lxd.enable = true;
|
lxd.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.sunshine = {
|
services.nix-serve = {
|
||||||
enable = false;
|
enable = true;
|
||||||
package = pkgs.unstable.sunshine;
|
secretKeyFile = "/var/cache-priv-key.pem";
|
||||||
capSysAdmin = true;
|
};
|
||||||
|
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
virtualHosts = {
|
||||||
|
"odyssey.mesh.vimium.net" = {
|
||||||
|
locations."/".proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
|
desktop = {
|
||||||
|
apps.qbittorrent.enable = true;
|
||||||
|
browsers = {
|
||||||
|
firefox.enable = true;
|
||||||
|
};
|
||||||
|
gaming = {
|
||||||
|
emulators = {
|
||||||
|
gamecube.enable = true;
|
||||||
|
ps2.enable = true;
|
||||||
|
ps3.enable = true;
|
||||||
|
psp.enable = true;
|
||||||
|
wii.enable = true;
|
||||||
|
xbox.enable = true;
|
||||||
|
};
|
||||||
|
lutris.enable = true;
|
||||||
|
};
|
||||||
|
media.graphics = {
|
||||||
|
modeling.enable = true;
|
||||||
|
raster.enable = true;
|
||||||
|
vector.enable = true;
|
||||||
|
};
|
||||||
|
media.recording = {
|
||||||
|
audio.enable = true;
|
||||||
|
video.enable = true;
|
||||||
|
};
|
||||||
|
office.libreoffice.enable = true;
|
||||||
|
};
|
||||||
|
dev = {
|
||||||
|
node.enable = true;
|
||||||
|
};
|
||||||
|
editors = {
|
||||||
|
neovim.enable = true;
|
||||||
|
};
|
||||||
hardware.presonus-studio.enable = true;
|
hardware.presonus-studio.enable = true;
|
||||||
|
security = {
|
||||||
|
gpg.enable = true;
|
||||||
|
pass.enable = true;
|
||||||
|
};
|
||||||
services = {
|
services = {
|
||||||
borgmatic = {
|
borgmatic = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -64,10 +102,11 @@
|
|||||||
];
|
];
|
||||||
repoPath = "ssh://iqwu22oq@iqwu22oq.repo.borgbase.com/./repo";
|
repoPath = "ssh://iqwu22oq@iqwu22oq.repo.borgbase.com/./repo";
|
||||||
};
|
};
|
||||||
|
gitea-runner.enable = true;
|
||||||
};
|
};
|
||||||
system.desktop = {
|
shell = {
|
||||||
gnome.enable = lib.mkForce false;
|
git.enable = true;
|
||||||
hyprland.enable = true;
|
zsh.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,228 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
# Based on: https://git.clan.lol/clan/clan-infra/src/branch/main/modules/web01/gitea/actions-runner.nix
|
|
||||||
|
|
||||||
let
|
|
||||||
hostname = config.networking.hostName;
|
|
||||||
giteaUrl = "https://git.vimium.com";
|
|
||||||
|
|
||||||
storeDepsBins = with pkgs; [
|
|
||||||
coreutils
|
|
||||||
findutils
|
|
||||||
gnugrep
|
|
||||||
gawk
|
|
||||||
git
|
|
||||||
nix
|
|
||||||
nix-update
|
|
||||||
bash
|
|
||||||
jq
|
|
||||||
nodejs
|
|
||||||
];
|
|
||||||
|
|
||||||
storeDeps = pkgs.runCommand "store-deps" { } ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
for dir in ${toString storeDepsBins}; do
|
|
||||||
for bin in "$dir"/bin/*; do
|
|
||||||
ln -s "$bin" "$out/bin/$(basename "$bin")"
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
# Add SSL CA certs
|
|
||||||
mkdir -p $out/etc/ssl/certs
|
|
||||||
cp -a "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" $out/etc/ssl/certs/ca-bundle.crt
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
{
|
|
||||||
modules.podman.enable = true;
|
|
||||||
|
|
||||||
systemd.services = {
|
|
||||||
gitea-runner-nix-image = {
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
after = [ "podman.service" ];
|
|
||||||
requires = [ "podman.service" ];
|
|
||||||
path = [
|
|
||||||
config.virtualisation.podman.package
|
|
||||||
pkgs.gnutar
|
|
||||||
pkgs.shadow
|
|
||||||
pkgs.getent
|
|
||||||
];
|
|
||||||
script = ''
|
|
||||||
set -eux -o pipefail
|
|
||||||
mkdir -p etc/nix
|
|
||||||
|
|
||||||
# Create an unpriveleged user that we can use also without the run-as-user.sh script
|
|
||||||
touch etc/passwd etc/group
|
|
||||||
groupid=$(cut -d: -f3 < <(getent group nix-ci-user))
|
|
||||||
userid=$(cut -d: -f3 < <(getent passwd nix-ci-user))
|
|
||||||
groupadd --prefix $(pwd) --gid "$groupid" nix-ci-user
|
|
||||||
emptypassword='$6$1ero.LwbisiU.h3D$GGmnmECbPotJoPQ5eoSTD6tTjKnSWZcjHoVTkxFLZP17W9hRi/XkmCiAMOfWruUwy8gMjINrBMNODc7cYEo4K.'
|
|
||||||
useradd --prefix $(pwd) -p "$emptypassword" -m -d /tmp -u "$userid" -g "$groupid" -G nix-ci-user nix-ci-user
|
|
||||||
|
|
||||||
cat <<NIX_CONFIG > etc/nix/nix.conf
|
|
||||||
accept-flake-config = true
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
NIX_CONFIG
|
|
||||||
|
|
||||||
cat <<NSSWITCH > etc/nsswitch.conf
|
|
||||||
passwd: files mymachines systemd
|
|
||||||
group: files mymachines systemd
|
|
||||||
shadow: files
|
|
||||||
|
|
||||||
hosts: files mymachines dns myhostname
|
|
||||||
networks: files
|
|
||||||
|
|
||||||
ethers: files
|
|
||||||
services: files
|
|
||||||
protocols: files
|
|
||||||
rpc: files
|
|
||||||
NSSWITCH
|
|
||||||
|
|
||||||
# list the content as it will be imported into the container
|
|
||||||
tar -cv . | tar -tvf -
|
|
||||||
tar -cv . | podman import - gitea-runner-nix
|
|
||||||
'';
|
|
||||||
serviceConfig = {
|
|
||||||
RuntimeDirectory = "gitea-runner-nix-image";
|
|
||||||
WorkingDirectory = "/run/gitea-runner-nix-image";
|
|
||||||
Type = "oneshot";
|
|
||||||
RemainAfterExit = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
gitea-runner-nix = {
|
|
||||||
after = [ "gitea-runner-nix-image.service" ];
|
|
||||||
requires = [ "gitea-runner-nix-image.service" ];
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
# Hardening (may overlap with DynamicUser=)
|
|
||||||
# The following options are only for optimizing output of systemd-analyze
|
|
||||||
AmbientCapabilities = "";
|
|
||||||
CapabilityBoundingSet = "";
|
|
||||||
# ProtectClock= adds DeviceAllow=char-rtc r
|
|
||||||
DeviceAllow = "";
|
|
||||||
NoNewPrivileges = true;
|
|
||||||
PrivateDevices = true;
|
|
||||||
PrivateMounts = true;
|
|
||||||
PrivateTmp = true;
|
|
||||||
PrivateUsers = true;
|
|
||||||
ProtectClock = true;
|
|
||||||
ProtectControlGroups = true;
|
|
||||||
ProtectHome = true;
|
|
||||||
ProtectHostname = true;
|
|
||||||
ProtectKernelLogs = true;
|
|
||||||
ProtectKernelModules = true;
|
|
||||||
ProtectKernelTunables = true;
|
|
||||||
ProtectSystem = "strict";
|
|
||||||
RemoveIPC = true;
|
|
||||||
RestrictNamespaces = true;
|
|
||||||
RestrictRealtime = true;
|
|
||||||
RestrictSUIDSGID = true;
|
|
||||||
UMask = "0066";
|
|
||||||
ProtectProc = "invisible";
|
|
||||||
SystemCallFilter = [
|
|
||||||
"~@clock"
|
|
||||||
"~@cpu-emulation"
|
|
||||||
"~@module"
|
|
||||||
"~@mount"
|
|
||||||
"~@obsolete"
|
|
||||||
"~@raw-io"
|
|
||||||
"~@reboot"
|
|
||||||
"~@swap"
|
|
||||||
# needed by go?
|
|
||||||
#"~@resources"
|
|
||||||
"~@privileged"
|
|
||||||
"~capset"
|
|
||||||
"~setdomainname"
|
|
||||||
"~sethostname"
|
|
||||||
];
|
|
||||||
RestrictAddressFamilies = [
|
|
||||||
"AF_INET"
|
|
||||||
"AF_INET6"
|
|
||||||
"AF_UNIX"
|
|
||||||
"AF_NETLINK"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Needs network access
|
|
||||||
PrivateNetwork = false;
|
|
||||||
# Cannot be true due to Node
|
|
||||||
MemoryDenyWriteExecute = false;
|
|
||||||
|
|
||||||
# The more restrictive "pid" option makes `nix` commands in CI emit
|
|
||||||
# "GC Warning: Couldn't read /proc/stat"
|
|
||||||
# You may want to set this to "pid" if not using `nix` commands
|
|
||||||
ProcSubset = "all";
|
|
||||||
# Coverage programs for compiled code such as `cargo-tarpaulin` disable
|
|
||||||
# ASLR (address space layout randomization) which requires the
|
|
||||||
# `personality` syscall
|
|
||||||
# You may want to set this to `true` if not using coverage tooling on
|
|
||||||
# compiled code
|
|
||||||
LockPersonality = false;
|
|
||||||
|
|
||||||
# Note that this has some interactions with the User setting; so you may
|
|
||||||
# want to consult the systemd docs if using both.
|
|
||||||
DynamicUser = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.nix-ci-user = {
|
|
||||||
group = "nix-ci-user";
|
|
||||||
description = "Used for running nix-based CI jobs";
|
|
||||||
home = "/var/empty";
|
|
||||||
isSystemUser = true;
|
|
||||||
};
|
|
||||||
users.groups.nix-ci-user = { };
|
|
||||||
|
|
||||||
age.secrets."files/services/gitea-runner/${hostname}-token" = {
|
|
||||||
file = "${inputs.secrets}/files/services/gitea-runner/${hostname}-token.age";
|
|
||||||
group = "podman";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.gitea-actions-runner.instances = {
|
|
||||||
act = {
|
|
||||||
enable = true;
|
|
||||||
url = giteaUrl;
|
|
||||||
name = "act-runner-${hostname}";
|
|
||||||
|
|
||||||
tokenFile = config.age.secrets."files/services/gitea-runner/${hostname}-token".path;
|
|
||||||
settings = {
|
|
||||||
cache.enabled = true;
|
|
||||||
runner.capacity = 4;
|
|
||||||
};
|
|
||||||
|
|
||||||
labels = [
|
|
||||||
"debian-latest:docker://ghcr.io/catthehacker/ubuntu:act-latest"
|
|
||||||
"ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-latest"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
nix = {
|
|
||||||
enable = true;
|
|
||||||
url = giteaUrl;
|
|
||||||
name = "nix-runner-${hostname}";
|
|
||||||
|
|
||||||
tokenFile = config.age.secrets."files/services/gitea-runner/${hostname}-token".path;
|
|
||||||
settings = {
|
|
||||||
cache.enabled = true;
|
|
||||||
container = {
|
|
||||||
options = "-e NIX_BUILD_SHELL=/bin/bash -e PAGER=cat -e PATH=/bin -e SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt --device /dev/kvm -v /nix:/nix -v ${storeDeps}/bin:/bin -v ${storeDeps}/etc/ssl:/etc/ssl --user nix-ci-user";
|
|
||||||
network = "host";
|
|
||||||
valid_volumes = [
|
|
||||||
"/nix"
|
|
||||||
"${storeDeps}/bin"
|
|
||||||
"${storeDeps}/etc/ssl"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
runner.capacity = 4;
|
|
||||||
};
|
|
||||||
|
|
||||||
labels = [
|
|
||||||
"nix:docker://gitea-runner-nix"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -12,39 +6,24 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd.availableKernelModules = [
|
initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
"xhci_pci"
|
|
||||||
"ehci_pci"
|
|
||||||
"nvme"
|
|
||||||
"usbhid"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
];
|
|
||||||
initrd.kernelModules = [ ];
|
initrd.kernelModules = [ ];
|
||||||
initrd.supportedFilesystems = [ "zfs" ];
|
initrd.supportedFilesystems = [ "zfs" ];
|
||||||
kernelModules = [ "kvm-amd" ];
|
kernelModules = [ "kvm-intel" ];
|
||||||
kernelPackages = pkgs.linuxPackages_6_12;
|
kernelPackages = pkgs.linuxPackages;
|
||||||
supportedFilesystems = [ "ntfs" ];
|
supportedFilesystems = [ "ntfs" ];
|
||||||
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
bluetooth = {
|
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
enable = true;
|
|
||||||
powerOnBoot = true;
|
|
||||||
};
|
|
||||||
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
nvidia = {
|
nvidia = {
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
open = true;
|
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||||
powerManagement.enable = true;
|
powerManagement.enable = true;
|
||||||
nvidiaSettings = false;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = "schedutil";
|
|
||||||
|
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
services.nix-serve = {
|
|
||||||
enable = true;
|
|
||||||
secretKeyFile = "/var/cache-priv-key.pem";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx = {
|
|
||||||
enable = true;
|
|
||||||
recommendedProxySettings = true;
|
|
||||||
virtualHosts = {
|
|
||||||
"odyssey.mesh.vimium.net" = {
|
|
||||||
locations."/".proxyPass =
|
|
||||||
"http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,15 +1,9 @@
|
|||||||
{
|
{ config, lib, pkgs, self, ... }:
|
||||||
inputs,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.nixos-hardware.nixosModules.raspberry-pi-4
|
self.inputs.nixos-hardware.nixosModules.raspberry-pi-4
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./home-assistant
|
|
||||||
./snapcast.nix
|
|
||||||
../server.nix
|
../server.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -106,6 +100,8 @@
|
|||||||
|
|
||||||
networking.hostId = "731d1660";
|
networking.hostId = "731d1660";
|
||||||
|
|
||||||
|
sound.enable = true;
|
||||||
|
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -114,8 +110,113 @@
|
|||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
age.secrets."files/services/home-assistant/secrets.yaml" = {
|
||||||
|
file = "${self.inputs.secrets}/files/services/home-assistant/secrets.yaml.age";
|
||||||
|
path = "${config.services.home-assistant.configDir}/secrets.yaml";
|
||||||
|
owner = "hass";
|
||||||
|
group = "hass";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.home-assistant = {
|
||||||
|
enable = true;
|
||||||
|
extraComponents = [
|
||||||
|
"api"
|
||||||
|
"alert"
|
||||||
|
"auth"
|
||||||
|
"backup"
|
||||||
|
"command_line"
|
||||||
|
"default_config"
|
||||||
|
"homekit_controller"
|
||||||
|
"homekit"
|
||||||
|
"http"
|
||||||
|
"icloud"
|
||||||
|
"jellyfin"
|
||||||
|
"metoffice"
|
||||||
|
"mqtt"
|
||||||
|
"onkyo"
|
||||||
|
"ping"
|
||||||
|
"proximity"
|
||||||
|
"radio_browser"
|
||||||
|
"scrape"
|
||||||
|
"sensor"
|
||||||
|
"system_health"
|
||||||
|
];
|
||||||
|
config = {
|
||||||
|
default_config = {};
|
||||||
|
backup = {};
|
||||||
|
homeassistant = {
|
||||||
|
name = "Home";
|
||||||
|
latitude = "!secret latitude";
|
||||||
|
longitude = "!secret longitude";
|
||||||
|
country = "GB";
|
||||||
|
temperature_unit = "C";
|
||||||
|
time_zone = config.time.timeZone;
|
||||||
|
unit_system = "metric";
|
||||||
|
};
|
||||||
|
mqtt = { };
|
||||||
|
scene = "!include scenes.yaml";
|
||||||
|
automation = "!include automations.yaml";
|
||||||
|
system_health = { };
|
||||||
|
recorder = {
|
||||||
|
purge_keep_days = 365;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.mosquitto = {
|
||||||
|
enable = true;
|
||||||
|
listeners = [{
|
||||||
|
acl = [ "pattern readwrite #" ];
|
||||||
|
omitPasswordAuth = true;
|
||||||
|
port = 1883;
|
||||||
|
settings = {
|
||||||
|
allow_anonymous = true;
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
|
||||||
|
age.secrets."files/services/zigbee2mqtt/secret.yaml" = {
|
||||||
|
file = "${self.inputs.secrets}/files/services/zigbee2mqtt/secret.yaml.age";
|
||||||
|
path = "${config.services.zigbee2mqtt.dataDir}/secret.yaml";
|
||||||
|
owner = "zigbee2mqtt";
|
||||||
|
group = "zigbee2mqtt";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.zigbee2mqtt = {
|
||||||
|
package = pkgs.unstable.zigbee2mqtt;
|
||||||
|
enable = true;
|
||||||
|
dataDir = "/var/lib/zigbee2mqtt";
|
||||||
|
settings = {
|
||||||
|
homeassistant = lib.optionalAttrs config.services.home-assistant.enable {
|
||||||
|
discovery_topic = "homeassistant";
|
||||||
|
status_topic = "hass/status";
|
||||||
|
legacy_entity_attributes = true;
|
||||||
|
legacy_triggers = true;
|
||||||
|
};
|
||||||
|
availability = true;
|
||||||
|
frontend = true;
|
||||||
|
device_options = {
|
||||||
|
retain = true;
|
||||||
|
};
|
||||||
|
serial = {
|
||||||
|
port = "/dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0";
|
||||||
|
};
|
||||||
|
advanced = {
|
||||||
|
channel = 20;
|
||||||
|
network_key = "!secret.yaml network_key";
|
||||||
|
pan_id = 13001;
|
||||||
|
ext_pan_id = [ 79 1 73 47 250 136 124 222 ];
|
||||||
|
transmit_power = 20;
|
||||||
|
};
|
||||||
|
mqtt = {
|
||||||
|
version = 5;
|
||||||
|
server = "mqtt://localhost:1883";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
system = {
|
networking = {
|
||||||
wireless = {
|
wireless = {
|
||||||
enable = true;
|
enable = true;
|
||||||
interfaces = [ "wlan0" ];
|
interfaces = [ "wlan0" ];
|
||||||
@ -124,6 +225,10 @@
|
|||||||
services = {
|
services = {
|
||||||
borgmatic = {
|
borgmatic = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
directories = [
|
||||||
|
"/var/lib/mosquitto"
|
||||||
|
"/var/lib/zigbee2mqtt"
|
||||||
|
];
|
||||||
repoPath = "ssh://qcw86s11@qcw86s11.repo.borgbase.com/./repo";
|
repoPath = "ssh://qcw86s11@qcw86s11.repo.borgbase.com/./repo";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -131,12 +236,10 @@
|
|||||||
|
|
||||||
# Connection to ONKYO HT-R990
|
# Connection to ONKYO HT-R990
|
||||||
networking.interfaces.end0 = {
|
networking.interfaces.end0 = {
|
||||||
ipv4.addresses = [
|
ipv4.addresses = [{
|
||||||
{
|
address = "172.16.0.1";
|
||||||
address = "172.16.0.1";
|
prefixLength = 30;
|
||||||
prefixLength = 30;
|
}];
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
@ -147,3 +250,4 @@
|
|||||||
|
|
||||||
system.stateVersion = "22.11";
|
system.stateVersion = "22.11";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
lib,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -11,24 +7,16 @@
|
|||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
# Stop ZFS kernel being built
|
# Stop ZFS kernel being built
|
||||||
supportedFilesystems = lib.mkForce [
|
supportedFilesystems = lib.mkForce [ "btrfs" "cifs" "f2fs" "jfs" "ntfs" "reiserfs" "vfat" "xfs" ];
|
||||||
"btrfs"
|
|
||||||
"cifs"
|
|
||||||
"f2fs"
|
|
||||||
"jfs"
|
|
||||||
"ntfs"
|
|
||||||
"reiserfs"
|
|
||||||
"vfat"
|
|
||||||
"xfs"
|
|
||||||
];
|
|
||||||
tmp.cleanOnBoot = true;
|
tmp.cleanOnBoot = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Fix missing modules
|
# Fix missing modules
|
||||||
# https://github.com/NixOS/nixpkgs/issues/154163
|
# https://github.com/NixOS/nixpkgs/issues/154163
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(final: prev: {
|
(final: super: {
|
||||||
makeModulesClosure = x: prev.makeModulesClosure (x // { allowMissing = true; });
|
makeModulesClosure = x:
|
||||||
|
super.makeModulesClosure (x // { allowMissing = true; });
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -40,3 +28,4 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,296 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./floorplan/default.nix
|
|
||||||
./mqtt.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
age.secrets."files/services/home-assistant/secrets.yaml" = {
|
|
||||||
file = "${inputs.secrets}/files/services/home-assistant/secrets.yaml.age";
|
|
||||||
path = "${config.services.home-assistant.configDir}/secrets.yaml";
|
|
||||||
owner = "hass";
|
|
||||||
group = "hass";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.home-assistant = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
config = {
|
|
||||||
automation = "!include automations.yaml";
|
|
||||||
backup = { };
|
|
||||||
binary_sensor = [ ];
|
|
||||||
default_config = { };
|
|
||||||
http = {
|
|
||||||
server_host = "::1";
|
|
||||||
trusted_proxies = [ "::1" ];
|
|
||||||
use_x_forwarded_for = true;
|
|
||||||
};
|
|
||||||
ffmpeg = { };
|
|
||||||
homeassistant = {
|
|
||||||
name = "Home";
|
|
||||||
latitude = "!secret latitude";
|
|
||||||
longitude = "!secret longitude";
|
|
||||||
country = "GB";
|
|
||||||
temperature_unit = "C";
|
|
||||||
time_zone = config.time.timeZone;
|
|
||||||
unit_system = "metric";
|
|
||||||
auth_providers = [
|
|
||||||
{
|
|
||||||
type = "trusted_networks";
|
|
||||||
trusted_networks = [
|
|
||||||
"100.64.0.0/10"
|
|
||||||
"127.0.0.1"
|
|
||||||
];
|
|
||||||
allow_bypass_login = true;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "homeassistant";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
logger = {
|
|
||||||
default = "info";
|
|
||||||
logs = { };
|
|
||||||
};
|
|
||||||
lovelace = {
|
|
||||||
mode = "yaml";
|
|
||||||
};
|
|
||||||
media_player = [ ];
|
|
||||||
mobile_app = { };
|
|
||||||
open_meteo = { };
|
|
||||||
recorder = {
|
|
||||||
purge_keep_days = 365;
|
|
||||||
};
|
|
||||||
scene = "!include scenes.yaml";
|
|
||||||
script = "!include scripts.yaml";
|
|
||||||
sensor = [ ];
|
|
||||||
system_health = { };
|
|
||||||
zeroconf = { };
|
|
||||||
};
|
|
||||||
|
|
||||||
extraComponents = [
|
|
||||||
"air_quality"
|
|
||||||
"airly"
|
|
||||||
"alert"
|
|
||||||
"api"
|
|
||||||
"application_credentials"
|
|
||||||
"asuswrt"
|
|
||||||
"auth"
|
|
||||||
"automation"
|
|
||||||
"bayesian"
|
|
||||||
"binary_sensor"
|
|
||||||
# "blackbird"
|
|
||||||
"blueprint"
|
|
||||||
"bluetooth_adapters"
|
|
||||||
"bluetooth_le_tracker"
|
|
||||||
"button"
|
|
||||||
"calendar"
|
|
||||||
"camera"
|
|
||||||
"cast"
|
|
||||||
"cert_expiry"
|
|
||||||
"climate"
|
|
||||||
"co2signal"
|
|
||||||
"color_extractor"
|
|
||||||
"command_line"
|
|
||||||
"compensation"
|
|
||||||
"configurator"
|
|
||||||
"counter"
|
|
||||||
"cover"
|
|
||||||
"cpuspeed"
|
|
||||||
"default_config"
|
|
||||||
"demo"
|
|
||||||
"derivative"
|
|
||||||
"device_automation"
|
|
||||||
"device_sun_light_trigger"
|
|
||||||
"device_tracker"
|
|
||||||
"dlna_dmr"
|
|
||||||
"dlna_dms"
|
|
||||||
"dnsip"
|
|
||||||
"esphome"
|
|
||||||
"fail2ban"
|
|
||||||
"fan"
|
|
||||||
"feedreader"
|
|
||||||
"ffmpeg"
|
|
||||||
"file"
|
|
||||||
"file_upload"
|
|
||||||
"filesize"
|
|
||||||
"folder"
|
|
||||||
"folder_watcher"
|
|
||||||
"forecast_solar"
|
|
||||||
"frontend"
|
|
||||||
"gdacs"
|
|
||||||
"generic"
|
|
||||||
"generic_hygrostat"
|
|
||||||
"generic_thermostat"
|
|
||||||
"geo_json_events"
|
|
||||||
"geo_location"
|
|
||||||
"geo_rss_events"
|
|
||||||
"github"
|
|
||||||
"group"
|
|
||||||
"hardware"
|
|
||||||
"hdmi_cec"
|
|
||||||
"history_stats"
|
|
||||||
"homeassistant"
|
|
||||||
"homekit"
|
|
||||||
"homekit_controller"
|
|
||||||
"html5"
|
|
||||||
"http"
|
|
||||||
"humidifier"
|
|
||||||
"icloud"
|
|
||||||
"image_processing"
|
|
||||||
"input_boolean"
|
|
||||||
"input_button"
|
|
||||||
"input_datetime"
|
|
||||||
"input_number"
|
|
||||||
"input_select"
|
|
||||||
"input_text"
|
|
||||||
"integration"
|
|
||||||
"ios"
|
|
||||||
"jellyfin"
|
|
||||||
"light"
|
|
||||||
"local_calendar"
|
|
||||||
"local_file"
|
|
||||||
"local_ip"
|
|
||||||
"local_todo"
|
|
||||||
"lock"
|
|
||||||
"logentries"
|
|
||||||
"logger"
|
|
||||||
"lovelace"
|
|
||||||
"manual"
|
|
||||||
"manual_mqtt"
|
|
||||||
"matter"
|
|
||||||
"media_player"
|
|
||||||
"min_max"
|
|
||||||
"mjpeg"
|
|
||||||
"modern_forms"
|
|
||||||
"mold_indicator"
|
|
||||||
"moon"
|
|
||||||
"mysensors"
|
|
||||||
"network"
|
|
||||||
"nmap_tracker"
|
|
||||||
"notify"
|
|
||||||
"number"
|
|
||||||
"onboarding"
|
|
||||||
"onkyo"
|
|
||||||
"panel_custom"
|
|
||||||
"persistent_notification"
|
|
||||||
"person"
|
|
||||||
"ping"
|
|
||||||
"plant"
|
|
||||||
"prometheus"
|
|
||||||
"proximity"
|
|
||||||
"push"
|
|
||||||
"proximity"
|
|
||||||
"python_script"
|
|
||||||
"radio_browser"
|
|
||||||
"random"
|
|
||||||
"recorder"
|
|
||||||
"remote"
|
|
||||||
"repairs"
|
|
||||||
"rest"
|
|
||||||
"rest_command"
|
|
||||||
"rss_feed_template"
|
|
||||||
"scene"
|
|
||||||
"schedule"
|
|
||||||
"scrape"
|
|
||||||
"script"
|
|
||||||
"search"
|
|
||||||
"season"
|
|
||||||
"select"
|
|
||||||
"sense"
|
|
||||||
"sensor"
|
|
||||||
"sensorpush"
|
|
||||||
"shell_command"
|
|
||||||
"shopping_list"
|
|
||||||
"siren"
|
|
||||||
"smtp"
|
|
||||||
"snmp"
|
|
||||||
"sql"
|
|
||||||
"statistics"
|
|
||||||
"sun"
|
|
||||||
"switch"
|
|
||||||
"switch_as_x"
|
|
||||||
"system_health"
|
|
||||||
"system_log"
|
|
||||||
"systemmonitor"
|
|
||||||
"tag"
|
|
||||||
"tailscale"
|
|
||||||
"tcp"
|
|
||||||
"template"
|
|
||||||
"text"
|
|
||||||
"thread"
|
|
||||||
"threshold"
|
|
||||||
"time_date"
|
|
||||||
"timer"
|
|
||||||
"tod"
|
|
||||||
"todo"
|
|
||||||
"tomorrowio"
|
|
||||||
"trend"
|
|
||||||
"universal"
|
|
||||||
"upb"
|
|
||||||
"update"
|
|
||||||
"upnp"
|
|
||||||
"uptime"
|
|
||||||
"utility_meter"
|
|
||||||
"vacuum"
|
|
||||||
"vlc"
|
|
||||||
"vlc_telnet"
|
|
||||||
"wake_on_lan"
|
|
||||||
"water_heater"
|
|
||||||
"weather"
|
|
||||||
"websocket_api"
|
|
||||||
"wled"
|
|
||||||
"workday"
|
|
||||||
"worldclock"
|
|
||||||
"zone"
|
|
||||||
];
|
|
||||||
|
|
||||||
extraPackages =
|
|
||||||
python3Packages: with python3Packages; [
|
|
||||||
onkyo-eiscp
|
|
||||||
zeroconf
|
|
||||||
];
|
|
||||||
|
|
||||||
customComponents = with pkgs; [
|
|
||||||
home-assistant-browser-mod
|
|
||||||
];
|
|
||||||
|
|
||||||
customLovelaceModules = with pkgs.home-assistant-custom-lovelace-modules; [
|
|
||||||
bubble-card
|
|
||||||
button-card
|
|
||||||
card-mod
|
|
||||||
light-entity-card
|
|
||||||
mini-graph-card
|
|
||||||
mini-media-player
|
|
||||||
mushroom
|
|
||||||
sankey-chart
|
|
||||||
universal-remote-card
|
|
||||||
];
|
|
||||||
|
|
||||||
lovelaceConfigWritable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
modules.services.borgmatic.directories = [
|
|
||||||
config.services.home-assistant.configDir
|
|
||||||
];
|
|
||||||
|
|
||||||
services.nginx = {
|
|
||||||
enable = true;
|
|
||||||
virtualHosts."home.mesh.vimium.net" = {
|
|
||||||
forceSSL = false;
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_buffering off;
|
|
||||||
'';
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://[::1]:8123";
|
|
||||||
proxyWebsockets = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,87 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
services.home-assistant = {
|
|
||||||
customLovelaceModules = [
|
|
||||||
pkgs.lovelace-floorplan
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.etc."home-assistant/www/floorplan/style.css".source = ./style.css;
|
|
||||||
environment.etc."home-assistant/www/floorplan/config.yaml".text = builtins.toJSON {
|
|
||||||
image = {
|
|
||||||
location = "/local/floorplan/beetham.svg";
|
|
||||||
cache = false;
|
|
||||||
};
|
|
||||||
stylesheet = {
|
|
||||||
location = "/local/floorplan/style.css";
|
|
||||||
cache = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
defaults = {
|
|
||||||
hover_action = "hover-info";
|
|
||||||
hold_action = "toggle";
|
|
||||||
tap_action = "more-info";
|
|
||||||
};
|
|
||||||
|
|
||||||
rules = [
|
|
||||||
{
|
|
||||||
name = "Rooms";
|
|
||||||
entities = [
|
|
||||||
{
|
|
||||||
entity = "light.bedroom_lamps";
|
|
||||||
element = "area.bedroom";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
entity = "light.hallway_spots";
|
|
||||||
element = "area.hallway";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
entity = "light.living_room_lamps";
|
|
||||||
element = "area.livingroom";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
entity = "light.office_lamps";
|
|
||||||
element = "area.office";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
tap_action = "light.toggle";
|
|
||||||
state_action = {
|
|
||||||
service = "floorplan.class_set";
|
|
||||||
service_data = ''
|
|
||||||
if (entity.state === "on") {
|
|
||||||
return "light-on";
|
|
||||||
}
|
|
||||||
return "light-off";
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "Temperature";
|
|
||||||
entities = [
|
|
||||||
"sensor.motion_sensor_temperature"
|
|
||||||
];
|
|
||||||
state_action = [
|
|
||||||
{
|
|
||||||
service = "floorplan.text_set";
|
|
||||||
service_data = ''
|
|
||||||
if (!isNaN(entity.state)) {
|
|
||||||
return Math.round(entity.state * 10) / 10 + "°";
|
|
||||||
}
|
|
||||||
return "Unknown";
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
{
|
|
||||||
service = "floorplan.class_set";
|
|
||||||
service_data = {
|
|
||||||
class = "static-temp";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
#floorplan {
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
svg, svg * {
|
|
||||||
vector-effect: non-scaling-stroke !important;
|
|
||||||
pointer-events: all !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
path[id*="area."].light-on {
|
|
||||||
opacity: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
path[id*="area."] {
|
|
||||||
opacity: 0.5 !important;
|
|
||||||
transition: opacity .25s;
|
|
||||||
-moz-transition: opacity .25s;
|
|
||||||
-webkit-transition: opacity .25s;
|
|
||||||
}
|
|
||||||
|
|
||||||
svg tspan {
|
|
||||||
fill: var(--primary-text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.static-temp, .static-temp tspan {
|
|
||||||
fill: #ffffff;
|
|
||||||
}
|
|
@ -1,87 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
services.mosquitto = {
|
|
||||||
enable = true;
|
|
||||||
listeners = [
|
|
||||||
{
|
|
||||||
acl = [ "pattern readwrite #" ];
|
|
||||||
omitPasswordAuth = true;
|
|
||||||
port = 1883;
|
|
||||||
settings = {
|
|
||||||
allow_anonymous = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
age.secrets."files/services/zigbee2mqtt/secret.yaml" = {
|
|
||||||
file = "${inputs.secrets}/files/services/zigbee2mqtt/secret.yaml.age";
|
|
||||||
path = "${config.services.zigbee2mqtt.dataDir}/secret.yaml";
|
|
||||||
owner = "zigbee2mqtt";
|
|
||||||
group = "zigbee2mqtt";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.zigbee2mqtt = {
|
|
||||||
package = pkgs.unstable.zigbee2mqtt;
|
|
||||||
enable = true;
|
|
||||||
dataDir = "/var/lib/zigbee2mqtt";
|
|
||||||
settings = {
|
|
||||||
homeassistant = lib.optionalAttrs config.services.home-assistant.enable {
|
|
||||||
discovery_topic = "homeassistant";
|
|
||||||
status_topic = "hass/status";
|
|
||||||
};
|
|
||||||
availability = true;
|
|
||||||
frontend = true;
|
|
||||||
device_options = {
|
|
||||||
retain = true;
|
|
||||||
};
|
|
||||||
serial = {
|
|
||||||
port = "/dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0";
|
|
||||||
adapter = "zstack";
|
|
||||||
};
|
|
||||||
advanced = {
|
|
||||||
channel = 20;
|
|
||||||
network_key = "!secret.yaml network_key";
|
|
||||||
pan_id = 13001;
|
|
||||||
ext_pan_id = [
|
|
||||||
79
|
|
||||||
1
|
|
||||||
73
|
|
||||||
47
|
|
||||||
250
|
|
||||||
136
|
|
||||||
124
|
|
||||||
222
|
|
||||||
];
|
|
||||||
transmit_power = 20;
|
|
||||||
};
|
|
||||||
mqtt = {
|
|
||||||
version = 5;
|
|
||||||
server = "mqtt://localhost:1883";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
modules.services.borgmatic.directories = [
|
|
||||||
config.services.mosquitto.dataDir
|
|
||||||
config.services.zigbee2mqtt.dataDir
|
|
||||||
];
|
|
||||||
|
|
||||||
services.home-assistant = {
|
|
||||||
config.mqtt = { };
|
|
||||||
extraComponents = [
|
|
||||||
"mqtt"
|
|
||||||
"mqtt_eventstream"
|
|
||||||
"mqtt_json"
|
|
||||||
"mqtt_room"
|
|
||||||
"mqtt_statestream"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
services = {
|
|
||||||
nginx.virtualHosts."music-assistant.${config.networking.hostName}" = {
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_buffering off;
|
|
||||||
'';
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://[::1]:8095";
|
|
||||||
proxyWebsockets = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
music-assistant = {
|
|
||||||
enable = true;
|
|
||||||
providers = [
|
|
||||||
"hass"
|
|
||||||
"jellyfin"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
# Put all sinks in pipewire group
|
|
||||||
services.pipewire.systemWide = true;
|
|
||||||
|
|
||||||
services.avahi = {
|
|
||||||
enable = true;
|
|
||||||
nssmdns4 = true;
|
|
||||||
publish = {
|
|
||||||
enable = true;
|
|
||||||
domain = true;
|
|
||||||
addresses = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.snapserver = {
|
|
||||||
enable = true;
|
|
||||||
streams = {
|
|
||||||
default = {
|
|
||||||
type = "file";
|
|
||||||
location = "/var/lib/snapserver/test.wav";
|
|
||||||
sampleFormat = "44100:16:2";
|
|
||||||
codec = "flac";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.snapclient = {
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
after = [ "pipewire.service" ];
|
|
||||||
requires = [ "pipewire.service" ];
|
|
||||||
description = "Snapcast client";
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = "${pkgs.snapcast}/bin/snapclient -h 127.0.0.1 --player pulse --mixer hardware";
|
|
||||||
DynamicUser = true;
|
|
||||||
SupplementaryGroups = [ "pipewire" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,11 +1,5 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (lib) mkForce;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./common.nix
|
./common.nix
|
||||||
@ -33,16 +27,6 @@ in
|
|||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
users = {
|
|
||||||
users = {
|
|
||||||
root = {
|
|
||||||
openssh.authorizedKeys.keys = [
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILVHTjsyMIV4THNw6yz0OxAxGnC+41gX72UrPqTzR+OS jordan@vimium.com"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd = {
|
systemd = {
|
||||||
enableEmergencyMode = false;
|
enableEmergencyMode = false;
|
||||||
|
|
||||||
@ -50,6 +34,11 @@ in
|
|||||||
AllowSuspend=no
|
AllowSuspend=no
|
||||||
AllowHibernation=no
|
AllowHibernation=no
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
watchdog = {
|
||||||
|
runtimeTime = "20s";
|
||||||
|
rebootTime = "30s";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.fail2ban = {
|
services.fail2ban = {
|
||||||
@ -65,9 +54,7 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.openssh.settings.PermitRootLogin = mkForce "prohibit-password";
|
modules.networking.tailscale = {
|
||||||
|
|
||||||
modules.services.tailscale = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
restrictSSH = false;
|
restrictSSH = false;
|
||||||
};
|
};
|
||||||
|
@ -26,3 +26,4 @@ To generate a compressed SD card image for Skycam, run:
|
|||||||
|
|
||||||
Once a card is imaged, the existing SSH host keys should be copied to
|
Once a card is imaged, the existing SSH host keys should be copied to
|
||||||
`/etc/ssh` manually to enable secret decryption.
|
`/etc/ssh` manually to enable secret decryption.
|
||||||
|
|
||||||
|
@ -1,16 +1,63 @@
|
|||||||
{
|
{ config, lib, pkgs, self, ... }:
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
self.inputs.nixos-hardware.nixosModules.raspberry-pi-4
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../server.nix
|
../server.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "aarch64-linux";
|
nixpkgs.hostPlatform = "aarch64-linux";
|
||||||
|
|
||||||
|
hardware = {
|
||||||
|
raspberry-pi."4" = {
|
||||||
|
apply-overlays-dtmerge.enable = true;
|
||||||
|
audio.enable = false;
|
||||||
|
xhci.enable = false;
|
||||||
|
};
|
||||||
|
deviceTree = {
|
||||||
|
enable = true;
|
||||||
|
filter = "*rpi-4-*.dtb";
|
||||||
|
# From https://github.com/Electrostasy/dots/blob/3b81723feece67610a252ce754912f6769f0cd34/hosts/phobos/klipper.nix#L43-L65
|
||||||
|
overlays =
|
||||||
|
let
|
||||||
|
mkCompatibleDtsFile = dtbo:
|
||||||
|
let
|
||||||
|
drv = pkgs.runCommand "fix-dts" { nativeBuildInputs = with pkgs; [ dtc gnused ]; } ''
|
||||||
|
mkdir "$out"
|
||||||
|
dtc -I dtb -O dts ${dtbo} | sed -e 's/bcm2835/bcm2711/' > $out/overlay.dts
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
"${drv}/overlay.dts";
|
||||||
|
|
||||||
|
inherit (config.boot.kernelPackages) kernel;
|
||||||
|
in
|
||||||
|
[
|
||||||
|
{
|
||||||
|
name = "imx708.dtbo";
|
||||||
|
dtsFile = mkCompatibleDtsFile "${kernel}/dtbs/overlays/imx708.dtbo";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "vc4-kms-v3d-pi4.dtbo";
|
||||||
|
dtsFile = mkCompatibleDtsFile "${kernel}/dtbs/overlays/vc4-kms-v3d-pi4.dtbo";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
firmware = with pkgs; [
|
||||||
|
firmwareLinuxNonfree
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.udev.extraRules = ''
|
||||||
|
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)
|
||||||
|
];
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostId = "731d1660";
|
hostId = "731d1660";
|
||||||
firewall = {
|
firewall = {
|
||||||
@ -20,59 +67,44 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.go2rtc =
|
users.users.root = {
|
||||||
let
|
openssh.authorizedKeys.keys = [
|
||||||
rpicam-vid = "${pkgs.rpicam-apps}/bin/rpicam-vid";
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILVHTjsyMIV4THNw6yz0OxAxGnC+41gX72UrPqTzR+OS jordan@vimium.com"
|
||||||
in
|
];
|
||||||
{
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
streams.rpicam = "exec:${rpicam-vid} -v1 -t0 -o- --inline --width=4608 --height=2592 --framerate=14 --codec mjpeg --quality 90 --denoise=cdn_off --sharpness 1.25 --exposure long --gain 3";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.skycam-archiver =
|
|
||||||
let
|
|
||||||
snapshotScript = pkgs.writeShellScript "skycam-archiver" ''
|
|
||||||
${pkgs.lib.getExe pkgs.curl} -s -o "/var/lib/skycam-archiver/snapshot-$(date +%Y%m%d-%H%M%S).jpg" "http://skycam.mesh.vimium.net:1984/api/frame.jpeg?src=rpicam"
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
{
|
|
||||||
description = "Capture skycam snapshot and save with timestamp";
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
StateDirectory = "skycam-archiver";
|
|
||||||
ExecStart = "${snapshotScript}";
|
|
||||||
};
|
|
||||||
requires = [ "go2rtc.service" ];
|
|
||||||
after = [ "go2rtc.service" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.timers.skycam-archiver = {
|
|
||||||
description = "Timer for capturing skycam snapshots every 30 minutes";
|
|
||||||
wantedBy = [ "timers.target" ];
|
|
||||||
timerConfig = {
|
|
||||||
OnBootSec = "5min";
|
|
||||||
OnUnitActiveSec = "30min";
|
|
||||||
Unit = "skycam-archiver.service";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
modules.services.borgmatic = {
|
services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password";
|
||||||
|
|
||||||
|
systemd.services.ustreamer = {
|
||||||
enable = true;
|
enable = true;
|
||||||
directories = [
|
description = "uStreamer service";
|
||||||
"/var/lib/skycam-archiver"
|
unitConfig = {
|
||||||
];
|
Type = "simple";
|
||||||
repoPath = "ssh://m94ekv2i@m94ekv2i.repo.borgbase.com/./repo";
|
ConditionPathExists = "/sys/bus/i2c/drivers/imx708/10-001a/video4linux";
|
||||||
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = ''${pkgs.libcamera}/bin/libcamerify ${pkgs.unstable.ustreamer}/bin/ustreamer \
|
||||||
|
--host=0.0.0.0 \
|
||||||
|
--resolution=4608x2592
|
||||||
|
'';
|
||||||
|
DynamicUser = "yes";
|
||||||
|
SupplementaryGroups = [ "video" ];
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = 10;
|
||||||
|
};
|
||||||
|
wantedBy = [ "network-online.target" ];
|
||||||
|
confinement.mode = "chroot-only";
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
camera-streamer
|
||||||
git
|
git
|
||||||
neovim
|
neovim
|
||||||
libcamera
|
libcamera
|
||||||
libraspberrypi
|
libraspberrypi
|
||||||
raspberrypi-eeprom
|
raspberrypi-eeprom
|
||||||
rpicam-apps
|
v4l-utils
|
||||||
|
unstable.ustreamer
|
||||||
];
|
];
|
||||||
|
|
||||||
system.stateVersion = "24.05";
|
system.stateVersion = "24.05";
|
||||||
|
@ -1,88 +1,24 @@
|
|||||||
{
|
{ config, lib, modulesPath, ... }:
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.nixos-hardware.nixosModules.raspberry-pi-4
|
|
||||||
(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
|
(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
|
kernelModules = [ "bcm2835-v4l2" ];
|
||||||
kernelParams = [
|
kernelParams = [
|
||||||
|
"cma=512M"
|
||||||
"panic=0"
|
"panic=0"
|
||||||
];
|
];
|
||||||
supportedFilesystems = lib.mkForce [
|
supportedFilesystems = lib.mkForce [ "f2fs" "vfat" "xfs" ];
|
||||||
"f2fs"
|
|
||||||
"vfat"
|
|
||||||
"xfs"
|
|
||||||
];
|
|
||||||
tmp.cleanOnBoot = false;
|
tmp.cleanOnBoot = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware = {
|
|
||||||
raspberry-pi."4" = {
|
|
||||||
apply-overlays-dtmerge.enable = true;
|
|
||||||
audio.enable = false;
|
|
||||||
xhci.enable = false;
|
|
||||||
};
|
|
||||||
deviceTree = {
|
|
||||||
enable = true;
|
|
||||||
filter = "*rpi-4-*.dtb";
|
|
||||||
# From https://github.com/Electrostasy/dots/blob/3b81723feece67610a252ce754912f6769f0cd34/hosts/phobos/klipper.nix#L43-L65
|
|
||||||
overlays =
|
|
||||||
let
|
|
||||||
mkCompatibleDtsFile =
|
|
||||||
dtbo:
|
|
||||||
let
|
|
||||||
drv =
|
|
||||||
pkgs.runCommand "fix-dts"
|
|
||||||
{
|
|
||||||
nativeBuildInputs = with pkgs; [
|
|
||||||
dtc
|
|
||||||
gnused
|
|
||||||
];
|
|
||||||
}
|
|
||||||
''
|
|
||||||
mkdir "$out"
|
|
||||||
dtc -I dtb -O dts ${dtbo} | sed -e 's/bcm2835/bcm2711/' > $out/overlay.dts
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
"${drv}/overlay.dts";
|
|
||||||
|
|
||||||
inherit (config.boot.kernelPackages) kernel;
|
|
||||||
in
|
|
||||||
[
|
|
||||||
{
|
|
||||||
name = "imx708.dtbo";
|
|
||||||
dtsFile = mkCompatibleDtsFile "${kernel}/dtbs/overlays/imx708.dtbo";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "vc4-kms-v3d-pi4.dtbo";
|
|
||||||
dtsFile = mkCompatibleDtsFile "${kernel}/dtbs/overlays/vc4-kms-v3d-pi4.dtbo";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
firmware = with pkgs; [
|
|
||||||
firmwareLinuxNonfree
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.udev.extraRules = ''
|
|
||||||
SUBSYSTEM=="rpivid-*", GROUP="video", MODE="0660"
|
|
||||||
KERNEL=="vcsm-cma", GROUP="video", MODE="0660"
|
|
||||||
SUBSYSTEM=="dma_heap", GROUP="video", MODE="0660"
|
|
||||||
SUBSYSTEM=="dma_heap", KERNEL=="linux,cma", SYMLINK+="dma_heap/vidbuf_cached", OPTIONS+="link_priority=-50"
|
|
||||||
'';
|
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(final: super: {
|
(final: super: {
|
||||||
makeModulesClosure = x: super.makeModulesClosure (x // { allowMissing = true; });
|
makeModulesClosure = x:
|
||||||
|
super.makeModulesClosure (x // { allowMissing = true; });
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -94,3 +30,4 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,3 +15,4 @@ NVMe | `/dev/sda1` (ext4, NixOS Root)
|
|||||||
### Networks
|
### Networks
|
||||||
- DHCP on `10.0.1.0/24` subnet.
|
- DHCP on `10.0.1.0/24` subnet.
|
||||||
- Tailscale on `100.64.0.0/10` subnet. FQDN: `vps1.mesh.vimium.net`.
|
- Tailscale on `100.64.0.0/10` subnet. FQDN: `vps1.mesh.vimium.net`.
|
||||||
|
|
||||||
|
@ -1,117 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
realm = "turn.vimium.com";
|
|
||||||
matrixIntegration = true;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
networking.firewall =
|
|
||||||
let
|
|
||||||
range =
|
|
||||||
with config.services.coturn;
|
|
||||||
lib.singleton {
|
|
||||||
from = min-port;
|
|
||||||
to = max-port;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
allowedTCPPorts = [
|
|
||||||
3478 # TURN listener
|
|
||||||
5349 # STUN TLS
|
|
||||||
5350 # STUN TLS alt
|
|
||||||
];
|
|
||||||
allowedUDPPorts = [
|
|
||||||
3478 # TURN listener
|
|
||||||
5349 # TLS
|
|
||||||
5350 # TLS alt
|
|
||||||
];
|
|
||||||
allowedUDPPortRanges = range; # TURN peer relays
|
|
||||||
};
|
|
||||||
|
|
||||||
security.acme.certs = {
|
|
||||||
"${config.services.coturn.realm}" = {
|
|
||||||
group = "turnserver";
|
|
||||||
reloadServices = [ "coturn" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
age.secrets =
|
|
||||||
{
|
|
||||||
"passwords/services/coturn/static-auth-secret" = {
|
|
||||||
file = "${inputs.secrets}/passwords/services/coturn/static-auth-secret.age";
|
|
||||||
owner = "turnserver";
|
|
||||||
group = "turnserver";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// (
|
|
||||||
if matrixIntegration then
|
|
||||||
{
|
|
||||||
"passwords/services/coturn/matrix-turn-config.yml" = {
|
|
||||||
file = "${inputs.secrets}/passwords/services/coturn/matrix-turn-config.yml.age";
|
|
||||||
owner = "matrix-synapse";
|
|
||||||
group = "matrix-synapse";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ }
|
|
||||||
);
|
|
||||||
|
|
||||||
services.coturn = {
|
|
||||||
enable = true;
|
|
||||||
realm = realm;
|
|
||||||
use-auth-secret = true;
|
|
||||||
static-auth-secret-file = config.age.secrets."passwords/services/coturn/static-auth-secret".path;
|
|
||||||
cert = "${config.security.acme.certs.${realm}.directory}/full.pem";
|
|
||||||
pkey = "${config.security.acme.certs.${realm}.directory}/key.pem";
|
|
||||||
min-port = 49000;
|
|
||||||
max-port = 50000;
|
|
||||||
no-cli = true;
|
|
||||||
no-tcp-relay = true;
|
|
||||||
extraConfig = ''
|
|
||||||
cipher-list="HIGH"
|
|
||||||
no-multicast-peers
|
|
||||||
|
|
||||||
# Ban private CIDR blocks
|
|
||||||
denied-peer-ip=0.0.0.0-0.255.255.255
|
|
||||||
denied-peer-ip=10.0.0.0-10.255.255.255
|
|
||||||
denied-peer-ip=100.64.0.0-100.127.255.255
|
|
||||||
denied-peer-ip=127.0.0.0-127.255.255.255
|
|
||||||
denied-peer-ip=169.254.0.0-169.254.255.255
|
|
||||||
denied-peer-ip=172.16.0.0-172.31.255.255
|
|
||||||
denied-peer-ip=192.0.0.0-192.0.0.255
|
|
||||||
denied-peer-ip=192.0.2.0-192.0.2.255
|
|
||||||
denied-peer-ip=192.88.99.0-192.88.99.255
|
|
||||||
denied-peer-ip=192.168.0.0-192.168.255.255
|
|
||||||
denied-peer-ip=198.18.0.0-198.19.255.255
|
|
||||||
denied-peer-ip=198.51.100.0-198.51.100.255
|
|
||||||
denied-peer-ip=203.0.113.0-203.0.113.255
|
|
||||||
denied-peer-ip=240.0.0.0-255.255.255.255
|
|
||||||
denied-peer-ip=::1
|
|
||||||
denied-peer-ip=64:ff9b::-64:ff9b::ffff:ffff
|
|
||||||
denied-peer-ip=::ffff:0.0.0.0-::ffff:255.255.255.255
|
|
||||||
denied-peer-ip=100::-100::ffff:ffff:ffff:ffff
|
|
||||||
denied-peer-ip=2001::-2001:1ff:ffff:ffff:ffff:ffff:ffff:ffff
|
|
||||||
denied-peer-ip=2002::-2002:ffff:ffff:ffff:ffff:ffff:ffff:ffff
|
|
||||||
denied-peer-ip=fc00::-fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
|
|
||||||
denied-peer-ip=fe80::-febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
services.matrix-synapse = lib.mkIf matrixIntegration {
|
|
||||||
settings = with config.services.coturn; {
|
|
||||||
turn_uris = [
|
|
||||||
"turn:${realm}:3478?transport=udp"
|
|
||||||
"turn:${realm}:3478?transport=tcp"
|
|
||||||
];
|
|
||||||
turn_user_lifetime = "1h";
|
|
||||||
};
|
|
||||||
extraConfigFiles = [
|
|
||||||
config.age.secrets."passwords/services/coturn/matrix-turn-config.yml".path
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,31 +1,19 @@
|
|||||||
{
|
{ config, lib, self, ... }:
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./coturn.nix
|
|
||||||
./gitea.nix
|
|
||||||
./headscale.nix
|
|
||||||
./kanidm.nix
|
|
||||||
./matrix.nix
|
|
||||||
./nginx.nix
|
|
||||||
./outline.nix
|
|
||||||
./photoprism.nix
|
|
||||||
../server.nix
|
../server.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs = {
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
hostPlatform = "x86_64-linux";
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostId = "08bf6db3";
|
hostId = "08bf6db3";
|
||||||
firewall = {
|
firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
22 # SSH
|
22 # SSH
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -40,13 +28,105 @@
|
|||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOaaS+KMAEAymZhIJGC4LK8aMhUzhpmloUgvP2cxeBH4 jellyfin"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOaaS+KMAEAymZhIJGC4LK8aMhUzhpmloUgvP2cxeBH4 jellyfin"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
root = {
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILVHTjsyMIV4THNw6yz0OxAxGnC+41gX72UrPqTzR+OS jordan@vimium.com"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
groups = {
|
groups = {
|
||||||
jellyfin = { };
|
jellyfin = { };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
modules = {
|
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 = {
|
services = {
|
||||||
borgmatic = {
|
borgmatic = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -57,7 +137,23 @@
|
|||||||
];
|
];
|
||||||
repoPath = "ssh://p91y8oh7@p91y8oh7.repo.borgbase.com/./repo";
|
repoPath = "ssh://p91y8oh7@p91y8oh7.repo.borgbase.com/./repo";
|
||||||
};
|
};
|
||||||
postgresql.enable = true;
|
coturn = {
|
||||||
|
enable = true;
|
||||||
|
realm = "turn.vimium.com";
|
||||||
|
matrixIntegration = true;
|
||||||
|
};
|
||||||
|
gitea.enable = true;
|
||||||
|
headscale.enable = true;
|
||||||
|
matrix = {
|
||||||
|
enable = true;
|
||||||
|
bridges = {
|
||||||
|
signal = true;
|
||||||
|
whatsapp = true;
|
||||||
|
};
|
||||||
|
usePostgresql = databases.postgresql.enable;
|
||||||
|
};
|
||||||
|
nginx.enable = true;
|
||||||
|
photoprism.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,89 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
domain = "git.vimium.com";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
users = {
|
|
||||||
users.git = {
|
|
||||||
isSystemUser = true;
|
|
||||||
useDefaultShell = true;
|
|
||||||
group = "git";
|
|
||||||
extraGroups = [ "gitea" ];
|
|
||||||
home = config.services.gitea.stateDir;
|
|
||||||
};
|
|
||||||
groups.git = { };
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx = {
|
|
||||||
upstreams.gitea = {
|
|
||||||
servers = {
|
|
||||||
"unix:${config.services.gitea.settings.server.HTTP_ADDR}" = { };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
virtualHosts = {
|
|
||||||
"${domain}" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/".proxyPass = "http://gitea";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
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"
|
|
||||||
];
|
|
||||||
|
|
||||||
services.gitea = rec {
|
|
||||||
package = pkgs.unstable.gitea;
|
|
||||||
enable = true;
|
|
||||||
user = "git";
|
|
||||||
appName = "Vimium Git";
|
|
||||||
stateDir = "/var/lib/gitea";
|
|
||||||
repositoryRoot = "${stateDir}/repositories";
|
|
||||||
database = {
|
|
||||||
type = "sqlite3";
|
|
||||||
inherit user;
|
|
||||||
path = "${stateDir}/gitea.db";
|
|
||||||
};
|
|
||||||
lfs = {
|
|
||||||
enable = true;
|
|
||||||
contentDir = "${stateDir}/lfs";
|
|
||||||
};
|
|
||||||
settings = {
|
|
||||||
server = {
|
|
||||||
DOMAIN = config.networking.domain;
|
|
||||||
LANDING_PAGE = "explore";
|
|
||||||
OFFLINE_MODE = true;
|
|
||||||
PROTOCOL = "http+unix";
|
|
||||||
SSH_USER = "git";
|
|
||||||
SSH_DOMAIN = "${domain}";
|
|
||||||
SSH_PORT = lib.head config.services.openssh.ports;
|
|
||||||
ROOT_URL = "https://${domain}/";
|
|
||||||
};
|
|
||||||
service.DISABLE_REGISTRATION = true;
|
|
||||||
session.COOKIE_SECURE = true;
|
|
||||||
log = {
|
|
||||||
ROOT_PATH = "${stateDir}/log";
|
|
||||||
"logger.router.MODE" = "";
|
|
||||||
};
|
|
||||||
ui = {
|
|
||||||
THEMES = "gitea,arc-green,github,github-auto,github-dark";
|
|
||||||
DEFAULT_THEME = "github-dark";
|
|
||||||
};
|
|
||||||
actions.ENABLED = true;
|
|
||||||
indexer = {
|
|
||||||
REPO_INDEXER_ENABLED = true;
|
|
||||||
};
|
|
||||||
packages.CHUNKED_UPLOAD_PATH = lib.mkForce "${stateDir}/data/tmp/package-upload";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,7 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -10,12 +7,7 @@
|
|||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd = {
|
initrd = {
|
||||||
availableKernelModules = [
|
availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
|
||||||
"ata_piix"
|
|
||||||
"uhci_hcd"
|
|
||||||
"xen_blkfront"
|
|
||||||
"vmw_pvscsi"
|
|
||||||
];
|
|
||||||
kernelModules = [ "nvme" ];
|
kernelModules = [ "nvme" ];
|
||||||
};
|
};
|
||||||
loader.grub.device = "/dev/sda";
|
loader.grub.device = "/dev/sda";
|
||||||
@ -31,3 +23,4 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,61 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
domain = "headscale.vimium.net";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
environment.systemPackages = [ pkgs.headscale ];
|
|
||||||
|
|
||||||
services.headscale = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
port = 8080;
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
policy.path = null;
|
|
||||||
ip_prefixes = [
|
|
||||||
"100.64.0.0/10"
|
|
||||||
];
|
|
||||||
server_url = "https://${domain}";
|
|
||||||
derp = {
|
|
||||||
auto_update_enable = false;
|
|
||||||
update_frequency = "24h";
|
|
||||||
};
|
|
||||||
dns = {
|
|
||||||
base_domain = "mesh.vimium.net";
|
|
||||||
extra_records = [
|
|
||||||
{
|
|
||||||
name = "grafana.mesh.vimium.net";
|
|
||||||
type = "A";
|
|
||||||
value = "100.64.0.6";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "home.mesh.vimium.net";
|
|
||||||
type = "A";
|
|
||||||
value = "100.64.0.7";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
magic_dns = true;
|
|
||||||
nameservers.global = [
|
|
||||||
"9.9.9.9"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
logtail.enabled = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts = {
|
|
||||||
"${domain}" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://localhost:${toString config.services.headscale.port}";
|
|
||||||
proxyWebsockets = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,52 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
baseDomain = "vimium.com";
|
|
||||||
domain = "auth.${baseDomain}";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
services.kanidm =
|
|
||||||
let
|
|
||||||
uri = "https://${domain}";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
package = pkgs.unstable.kanidm;
|
|
||||||
enableClient = true;
|
|
||||||
enableServer = true;
|
|
||||||
clientSettings = {
|
|
||||||
inherit uri;
|
|
||||||
};
|
|
||||||
serverSettings = {
|
|
||||||
bindaddress = "127.0.0.1:3013";
|
|
||||||
ldapbindaddress = "100.64.0.1:636";
|
|
||||||
domain = baseDomain;
|
|
||||||
origin = uri;
|
|
||||||
tls_chain = "${config.security.acme.certs.${domain}.directory}/full.pem";
|
|
||||||
tls_key = "${config.security.acme.certs.${domain}.directory}/key.pem";
|
|
||||||
version = "2";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts = {
|
|
||||||
"${domain}" = {
|
|
||||||
useACMEHost = "${domain}";
|
|
||||||
forceSSL = true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "https://127.0.0.1:3013";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
users.extraGroups.acme.members = [
|
|
||||||
"kanidm"
|
|
||||||
"nginx"
|
|
||||||
];
|
|
||||||
|
|
||||||
security.acme.certs."${domain}" = {
|
|
||||||
postRun = "systemctl restart kanidm.service";
|
|
||||||
group = "acme";
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,221 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
serverName = "vimium.com";
|
|
||||||
useElement = true;
|
|
||||||
usePostgresql = true;
|
|
||||||
bridges = {
|
|
||||||
signal = true;
|
|
||||||
whatsapp = true;
|
|
||||||
};
|
|
||||||
matrixSubdomain = "matrix.${serverName}";
|
|
||||||
elementSubdomain = "chat.${serverName}";
|
|
||||||
matrixClientConfig = {
|
|
||||||
"m.homeserver" = {
|
|
||||||
base_url = "https://${matrixSubdomain}";
|
|
||||||
server_name = serverName;
|
|
||||||
};
|
|
||||||
"m.identity_server" = {
|
|
||||||
"base_url" = "https://vector.im";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
matrixServerConfig."m.server" = "${matrixSubdomain}:443";
|
|
||||||
commonBridgeSettings = bridge: {
|
|
||||||
appservice = {
|
|
||||||
database = lib.mkIf usePostgresql {
|
|
||||||
type = "postgres";
|
|
||||||
uri = "postgresql:///${bridge}?host=/run/postgresql";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
bridge = {
|
|
||||||
encryption = {
|
|
||||||
allow = true;
|
|
||||||
default = true;
|
|
||||||
require = true;
|
|
||||||
};
|
|
||||||
permissions = {
|
|
||||||
"${serverName}" = "user";
|
|
||||||
"@jordan:${serverName}" = "admin";
|
|
||||||
};
|
|
||||||
provisioning = {
|
|
||||||
shared_secret = "disable";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
homeserver = {
|
|
||||||
address = "https://${matrixSubdomain}";
|
|
||||||
domain = serverName;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
|
||||||
8448 # Matrix federation
|
|
||||||
];
|
|
||||||
|
|
||||||
security.acme.certs = {
|
|
||||||
"${matrixSubdomain}" = {
|
|
||||||
reloadServices = [ "matrix-synapse" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts =
|
|
||||||
{
|
|
||||||
"${matrixSubdomain}" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
listen = [
|
|
||||||
{
|
|
||||||
addr = "0.0.0.0";
|
|
||||||
port = 443;
|
|
||||||
ssl = true;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
addr = "0.0.0.0";
|
|
||||||
port = 80;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
addr = "0.0.0.0";
|
|
||||||
port = 8448;
|
|
||||||
ssl = true;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
addr = "[::1]";
|
|
||||||
port = 443;
|
|
||||||
ssl = true;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
addr = "[::1]";
|
|
||||||
port = 80;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
addr = "[::1]";
|
|
||||||
port = 8448;
|
|
||||||
ssl = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
locations = {
|
|
||||||
"/" = {
|
|
||||||
proxyPass = "http://localhost:8008";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
"/_matrix" = {
|
|
||||||
proxyPass = "http://localhost:8008";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
client_max_body_size 50M;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
"/_synapse/client".proxyPass = "http://localhost:8008";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"${serverName}" =
|
|
||||||
let
|
|
||||||
mkWellKnown = data: ''
|
|
||||||
more_set_headers 'Content-Type: application/json';
|
|
||||||
return 200 '${builtins.toJSON data}';
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
{
|
|
||||||
locations."= /.well-known/matrix/server".extraConfig = (mkWellKnown matrixServerConfig);
|
|
||||||
locations."= /.well-known/matrix/client".extraConfig = (mkWellKnown matrixClientConfig);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// (
|
|
||||||
if useElement then
|
|
||||||
{
|
|
||||||
"${elementSubdomain}" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
root = pkgs.unstable.element-web.override {
|
|
||||||
conf = {
|
|
||||||
default_server_config = matrixClientConfig;
|
|
||||||
brand = "Vimium Chat";
|
|
||||||
branding = {
|
|
||||||
auth_header_logo_url = "https://vimium.com/images/logo.svg";
|
|
||||||
auth_footer_links = [
|
|
||||||
{
|
|
||||||
"text" = "Vimium.com";
|
|
||||||
"url" = "https://vimium.com";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ }
|
|
||||||
);
|
|
||||||
|
|
||||||
nixpkgs.config.permittedInsecurePackages = [
|
|
||||||
"jitsi-meet-1.0.8043"
|
|
||||||
"olm-3.2.16"
|
|
||||||
];
|
|
||||||
|
|
||||||
services.matrix-synapse = {
|
|
||||||
enable = true;
|
|
||||||
enableRegistrationScript = true;
|
|
||||||
settings = {
|
|
||||||
database.name = (if usePostgresql then "psycopg2" else "sqlite3");
|
|
||||||
enable_metrics = false;
|
|
||||||
enable_registration = false;
|
|
||||||
max_upload_size = "100M";
|
|
||||||
report_stats = false;
|
|
||||||
server_name = serverName;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
systemd.services.matrix-synapse.serviceConfig.SupplementaryGroups = (
|
|
||||||
lib.optional bridges.whatsapp config.systemd.services.mautrix-whatsapp.serviceConfig.Group
|
|
||||||
);
|
|
||||||
|
|
||||||
services.postgresql = lib.mkIf usePostgresql {
|
|
||||||
ensureUsers =
|
|
||||||
[
|
|
||||||
{
|
|
||||||
name = "matrix-synapse";
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
}
|
|
||||||
]
|
|
||||||
++ (lib.optional bridges.signal {
|
|
||||||
name = "mautrix-signal";
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
})
|
|
||||||
++ (lib.optional bridges.whatsapp {
|
|
||||||
name = "mautrix-whatsapp";
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
});
|
|
||||||
ensureDatabases =
|
|
||||||
[
|
|
||||||
"matrix-synapse"
|
|
||||||
]
|
|
||||||
++ (lib.optional bridges.signal "mautrix-signal")
|
|
||||||
++ (lib.optional bridges.whatsapp "mautrix-whatsapp");
|
|
||||||
};
|
|
||||||
|
|
||||||
services.mautrix-signal = lib.mkIf bridges.signal {
|
|
||||||
enable = true;
|
|
||||||
settings = commonBridgeSettings "mautrix-signal";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.mautrix-whatsapp = lib.mkIf bridges.whatsapp {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
bridge = {
|
|
||||||
history_sync = {
|
|
||||||
backfill = true;
|
|
||||||
max_initial_conversations = -1;
|
|
||||||
message_count = 50;
|
|
||||||
request_full_sync = true;
|
|
||||||
};
|
|
||||||
mute_bridging = true;
|
|
||||||
};
|
|
||||||
} // commonBridgeSettings "mautrix-whatsapp";
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
domain = "outline.vimium.com";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
services.nginx.virtualHosts = {
|
|
||||||
"${domain}" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://127.0.0.1:3000";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "Upgrade";
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Scheme $scheme;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_redirect off;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
age.secrets."passwords/services/outline/oidc-client-secret" = {
|
|
||||||
file = "${inputs.secrets}/passwords/services/outline/oidc-client-secret.age";
|
|
||||||
owner = "outline";
|
|
||||||
group = "outline";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.outline = {
|
|
||||||
enable = true;
|
|
||||||
forceHttps = false;
|
|
||||||
oidcAuthentication = {
|
|
||||||
clientId = "outline";
|
|
||||||
clientSecretFile = config.age.secrets."passwords/services/outline/oidc-client-secret".path;
|
|
||||||
displayName = "Vimium";
|
|
||||||
authUrl = "https://auth.vimium.com/ui/oauth2";
|
|
||||||
tokenUrl = "https://auth.vimium.com/oauth2/token";
|
|
||||||
userinfoUrl = "https://auth.vimium.com/oauth2/openid/outline/userinfo";
|
|
||||||
};
|
|
||||||
publicUrl = "https://${domain}";
|
|
||||||
storage.storageType = "local";
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
domain = "gallery.vimium.com";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
services.nginx.virtualHosts = {
|
|
||||||
"${domain}" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://localhost:${toString config.services.photoprism.port}";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
|
|
||||||
proxy_buffering off;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
age.secrets."passwords/services/photoprism/admin" = {
|
|
||||||
file = "${inputs.secrets}/passwords/services/photoprism/admin.age";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.photoprism = {
|
|
||||||
enable = true;
|
|
||||||
address = "localhost";
|
|
||||||
passwordFile = config.age.secrets."passwords/services/photoprism/admin".path;
|
|
||||||
originalsPath = "${config.services.photoprism.storagePath}/originals";
|
|
||||||
settings = {
|
|
||||||
PHOTOPRISM_APP_NAME = "Vimium Gallery";
|
|
||||||
PHOTOPRISM_SITE_AUTHOR = "Vimium";
|
|
||||||
PHOTOPRISM_SITE_TITLE = "Vimium Gallery";
|
|
||||||
PHOTOPRISM_SITE_CAPTION = "Vimium Gallery";
|
|
||||||
PHOTOPRISM_DISABLE_TLS = "true";
|
|
||||||
PHOTOPRISM_SPONSOR = "true";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -5,10 +5,9 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.services.postgresql;
|
cfg = config.modules.databases.postgresql;
|
||||||
in
|
in {
|
||||||
{
|
options.modules.databases.postgresql = {
|
||||||
options.modules.services.postgresql = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
@ -18,6 +17,7 @@ in
|
|||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
enableJIT = true;
|
||||||
initdbArgs = [
|
initdbArgs = [
|
||||||
"--allow-group-access"
|
"--allow-group-access"
|
||||||
"--encoding=UTF8"
|
"--encoding=UTF8"
|
52
modules/default.nix
Normal file
52
modules/default.nix
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./options.nix
|
||||||
|
./podman.nix
|
||||||
|
./databases/postgresql.nix
|
||||||
|
./desktop/gnome.nix
|
||||||
|
./desktop/forensics.nix
|
||||||
|
./desktop/hyprland.nix
|
||||||
|
./desktop/kde.nix
|
||||||
|
./desktop/mimeapps.nix
|
||||||
|
./desktop/apps/qbittorrent.nix
|
||||||
|
./desktop/apps/slack.nix
|
||||||
|
./desktop/apps/thunderbird.nix
|
||||||
|
./desktop/apps/zoom.nix
|
||||||
|
./desktop/browsers/brave.nix
|
||||||
|
./desktop/browsers/firefox.nix
|
||||||
|
./desktop/gaming/emulators.nix
|
||||||
|
./desktop/gaming/lutris.nix
|
||||||
|
./desktop/gaming/steam.nix
|
||||||
|
./desktop/media/graphics.nix
|
||||||
|
./desktop/media/recording.nix
|
||||||
|
./desktop/office/libreoffice.nix
|
||||||
|
./dev/cc.nix
|
||||||
|
./dev/java.nix
|
||||||
|
./dev/lua.nix
|
||||||
|
./dev/node.nix
|
||||||
|
./dev/python.nix
|
||||||
|
./dev/rust.nix
|
||||||
|
./dev/scala.nix
|
||||||
|
./dev/shell.nix
|
||||||
|
./dev/zig.nix
|
||||||
|
./editors/neovim
|
||||||
|
./editors/vscode.nix
|
||||||
|
./hardware/presonus-studio.nix
|
||||||
|
./networking/tailscale.nix
|
||||||
|
./networking/wireless.nix
|
||||||
|
./security/gpg.nix
|
||||||
|
./security/pass.nix
|
||||||
|
./services/borgmatic
|
||||||
|
./services/chrony
|
||||||
|
./services/coturn
|
||||||
|
./services/gitea
|
||||||
|
./services/gitea-runner
|
||||||
|
./services/headscale
|
||||||
|
./services/mail
|
||||||
|
./services/matrix
|
||||||
|
./services/nginx
|
||||||
|
./services/photoprism
|
||||||
|
./shell/git
|
||||||
|
./shell/zsh
|
||||||
|
];
|
||||||
|
}
|
17
modules/desktop/apps/qbittorrent.nix
Normal file
17
modules/desktop/apps/qbittorrent.nix
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.apps.qbittorrent;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.apps.qbittorrent = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
qbittorrent
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
17
modules/desktop/apps/slack.nix
Normal file
17
modules/desktop/apps/slack.nix
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.apps.slack;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.apps.slack = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
slack
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
33
modules/desktop/apps/thunderbird.nix
Normal file
33
modules/desktop/apps/thunderbird.nix
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{ config, lib, self, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.apps.thunderbird;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.apps.thunderbird = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.file.".thunderbird/Default/chrome/thunderbird-gnome-theme".source = self.inputs.thunderbird-gnome-theme;
|
||||||
|
|
||||||
|
home.programs.thunderbird = {
|
||||||
|
enable = true;
|
||||||
|
profiles.Default = {
|
||||||
|
isDefault = true;
|
||||||
|
userChrome = ''
|
||||||
|
@import "thunderbird-gnome-theme/userChrome.css";
|
||||||
|
'';
|
||||||
|
userContent = ''
|
||||||
|
@import "thunderbird-gnome-theme/userContent.css";
|
||||||
|
'';
|
||||||
|
settings = {
|
||||||
|
## GNOME theme
|
||||||
|
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||||
|
"svg.context-properties.content.enabled" = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
17
modules/desktop/apps/zoom.nix
Normal file
17
modules/desktop/apps/zoom.nix
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.apps.zoom;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.apps.zoom = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
zoom-us
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
17
modules/desktop/browsers/brave.nix
Normal file
17
modules/desktop/browsers/brave.nix
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.browsers.brave;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.browsers.brave = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
brave
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
216
modules/desktop/browsers/firefox.nix
Normal file
216
modules/desktop/browsers/firefox.nix
Normal file
@ -0,0 +1,216 @@
|
|||||||
|
{ config, lib, self, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.browsers.firefox;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.browsers.firefox = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.file.".mozilla/firefox/Default/chrome/firefox-gnome-theme".source = self.inputs.firefox-gnome-theme;
|
||||||
|
|
||||||
|
home.programs.firefox = {
|
||||||
|
enable = true;
|
||||||
|
profiles.Default = {
|
||||||
|
search = {
|
||||||
|
default = "DuckDuckGo";
|
||||||
|
force = true;
|
||||||
|
};
|
||||||
|
userChrome = ''
|
||||||
|
@import "firefox-gnome-theme/userChrome.css";
|
||||||
|
'';
|
||||||
|
userContent = ''
|
||||||
|
@import "firefox-gnome-theme/userContent.css";
|
||||||
|
'';
|
||||||
|
settings = {
|
||||||
|
## GNOME theme
|
||||||
|
"toolkit.legacyUserProfileCustomizations.stylesheets" = true; # Enable customChrome.css
|
||||||
|
"browser.uidensity" = 0; # Set UI density to normal
|
||||||
|
"svg.context-properties.content.enabled" = true; # Enable SVG context-propertes
|
||||||
|
"browser.theme.dark-private-windows" = false; # Disable private window dark theme
|
||||||
|
"widget.gtk.rounded-bottom-corners.enabled" = true; # Enable rounded bottom window corners
|
||||||
|
|
||||||
|
## Preferences
|
||||||
|
"browser.ctrlTab.sortByRecentlyUsed" = true;
|
||||||
|
"browser.discovery.enabled" = false;
|
||||||
|
"browser.download.open_pdf_attachments_inline" = true;
|
||||||
|
"browser.menu.showViewImageInfo" = true;
|
||||||
|
"browser.newtabpage.enabled" = false;
|
||||||
|
"browser.newtabpage.activity-stream.showSponsored" = false;
|
||||||
|
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
|
||||||
|
"browser.newtabpage.activity-stream.default.sites" = "";
|
||||||
|
"browser.privatebrowsing.forceMediaMemoryCache" = true;
|
||||||
|
"browser.search.widget.inNavBar" = true;
|
||||||
|
"browser.startup.page" = 3;
|
||||||
|
"browser.startup.homepage" = "https://www.vimium.com";
|
||||||
|
"browser.toolbars.bookmarks.visibility" = "never";
|
||||||
|
"browser.uitour.enabled" = false;
|
||||||
|
"browser.urlbar.suggest.engines" = false;
|
||||||
|
"browser.urlbar.suggest.calculator" = true;
|
||||||
|
"browser.urlbar.trending.featureGate" = false;
|
||||||
|
"browser.urlbar.unitConversion.enabled" = true;
|
||||||
|
"cookiebanners.service.mode" = 1;
|
||||||
|
"cookiebanners.service.mode.privateBrowsing" = 1;
|
||||||
|
"network.IDN_show_punycode" = true;
|
||||||
|
|
||||||
|
## Performance
|
||||||
|
"browser.cache.jsbc_compression_level" = 3;
|
||||||
|
"content.notify.interval" = 100000;
|
||||||
|
"dom.enable_web_task_scheduling" = true;
|
||||||
|
"dom.security.sanitizer.enabled" = true;
|
||||||
|
"gfx.canvas.accelerated.cache-items" = 4096;
|
||||||
|
"gfx.canvas.accelerated.cache-size" = 512;
|
||||||
|
"gfx.content.skia-font-cache-size" = 20;
|
||||||
|
"gfx.webrender.all" = true;
|
||||||
|
"gfx.webrender.compositor" = true;
|
||||||
|
"gfx.webrender.enable" = true;
|
||||||
|
"image.mem.decode_bytes_at_a_time" = 32768;
|
||||||
|
"layers.acceleration.force-enabled" = true;
|
||||||
|
"layout.css.grid-template-masonry-value.enabled" = true;
|
||||||
|
"media.ffmpeg.vaapi.enabled" = true;
|
||||||
|
"media.memory_cache_max_size" = 65536;
|
||||||
|
"media.cache_readahead_limit" = 7200;
|
||||||
|
"media.cache_resume_threshold" = 3600;
|
||||||
|
"network.dns.disablePrefetch" = true;
|
||||||
|
"network.dns.disablePrefetchFromHTTPS" = true;
|
||||||
|
"network.dnsCacheExpiration" = 3600;
|
||||||
|
"network.http.max-connections" = 1800;
|
||||||
|
"network.http.max-persistent-connections-per-server" = 10;
|
||||||
|
"network.http.max-urgent-start-excessive-connections-per-host" = 5;
|
||||||
|
"network.http.pacing.requests.enabled" = false;
|
||||||
|
"network.predictor.enabled" = false;
|
||||||
|
"network.prefetch-next" = false;
|
||||||
|
"network.ssl_tokens_cache_capacity" = 10240;
|
||||||
|
"pdfjs.enableScripting" = false;
|
||||||
|
"security.mixed_content.block_display_content" = true;
|
||||||
|
|
||||||
|
## Experiments
|
||||||
|
"app.normandy.enabled" = false;
|
||||||
|
"app.normandy.api_url" = "";
|
||||||
|
"app.normandy.user_id" = "";
|
||||||
|
"app.shield.optoutstudies.enabled" = false;
|
||||||
|
"browser.shopping.experience2023.active" = false;
|
||||||
|
"browser.shopping.experience2023.enabled" = false;
|
||||||
|
"extensions.screenshots.disabled" = true;
|
||||||
|
"extensions.screenshots.upload-disabled" = true;
|
||||||
|
"experiments.supported" = false;
|
||||||
|
"experiments.enabled" = false;
|
||||||
|
"experiments.manifest.uri" = "";
|
||||||
|
"network.allow-experiments" = false;
|
||||||
|
|
||||||
|
## Privacy
|
||||||
|
"dom.private-attribution.submission.enabled" = false;
|
||||||
|
# "privacy.resistFingerprinting" = true;
|
||||||
|
"privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts" = false;
|
||||||
|
"privacy.trackingprotection.enabled" = true;
|
||||||
|
"privacy.trackingprotection.pbmode.enabled" = true;
|
||||||
|
"privacy.userContext.enabled" = true;
|
||||||
|
|
||||||
|
## Geo
|
||||||
|
"geo.enabled" = false;
|
||||||
|
"geo.provider.use_gpsd" = false;
|
||||||
|
"geo.wifi.uri" = "";
|
||||||
|
"browser.search.geoip.url" = "";
|
||||||
|
"browser.search.geoSpecificDefaults" = false;
|
||||||
|
"browser.search.geoSpecificDefaults.url" = "";
|
||||||
|
|
||||||
|
## Window meddling / popups
|
||||||
|
"dom.disable_window_open_feature.close" = true;
|
||||||
|
"dom.disable_window_open_feature.location" = true;
|
||||||
|
"dom.disable_window_open_feature.menubar" = true;
|
||||||
|
"dom.disable_window_open_feature.minimizable" = true;
|
||||||
|
"dom.disable_window_open_feature.personalbar" = true;
|
||||||
|
"dom.disable_window_open_feature.resizable" = true;
|
||||||
|
"dom.disable_window_open_feature.status" = true;
|
||||||
|
"dom.disable_window_open_feature.titlebar" = true;
|
||||||
|
"dom.disable_window_open_feature.toolbar" = true;
|
||||||
|
"dom.disable_window_move_resize" = true;
|
||||||
|
"browser.link.open_newwindow" = 3;
|
||||||
|
"browser.link.open_newwindow.restriction" = 0;
|
||||||
|
"dom.disable_open_during_load" = true;
|
||||||
|
"dom.popup_allowed_events" = "click dblclick";
|
||||||
|
|
||||||
|
## Workers
|
||||||
|
# "dom.serviceWorkers.enabled" = false;
|
||||||
|
"dom.push.enabled" = false;
|
||||||
|
"dom.webnotifications.enabled" = false;
|
||||||
|
"dom.webnotifications.serviceworker.enabled" = false;
|
||||||
|
"permissions.default.desktop-notification" = 2;
|
||||||
|
|
||||||
|
## DOM / JavaScript
|
||||||
|
# "dom.event.clipboardevents.enabled" = false;
|
||||||
|
"middlemouse.paste" = false;
|
||||||
|
# "dom.allow_cut_copy" = false;
|
||||||
|
"dom.disable_beforeunload" = true;
|
||||||
|
"dom.vibrator.enabled" = false;
|
||||||
|
# "javascript.options.asmjs" = false;
|
||||||
|
# "javascript.options.wasm" = false;
|
||||||
|
"dom.targetBlankNoOpener.enabled" = true;
|
||||||
|
|
||||||
|
## Hardware fingerprinting
|
||||||
|
"dom.battery.enabled" = false;
|
||||||
|
"dom.vr.enabled" = false;
|
||||||
|
"media.navigator.enabled" = false;
|
||||||
|
# "dom.webaudio.enabled" = false;
|
||||||
|
|
||||||
|
## Isolation
|
||||||
|
"privacy.firstparty.isolate" = true;
|
||||||
|
"privacy.firstparty.isolate.restrict_opener_access" = true;
|
||||||
|
|
||||||
|
## Telemetry
|
||||||
|
"beacon.enabled" = false;
|
||||||
|
"browser.newtabpage.activity-stream.feeds.telemetry" = false;
|
||||||
|
"browser.newtabpage.activity-stream.telemetry" = false;
|
||||||
|
"browser.send_pings" = false;
|
||||||
|
"datareporting.policy.dataSubmissionEnabled" = false;
|
||||||
|
"datareporting.healthReport.uploadEnabled" = false;
|
||||||
|
"toolkit.coverage.opt-out" = true;
|
||||||
|
"toolkit.coverage.endpoint.base" = "";
|
||||||
|
"toolkit.telemetry.archive.enabled" = false;
|
||||||
|
"toolkit.telemetry.bhrPing.enabled" = false;
|
||||||
|
"toolkit.telemetry.coverage.opt-out" = true;
|
||||||
|
"toolkit.telemetry.enabled" = false;
|
||||||
|
"toolkit.telemetry.firstShutdownPing.enabled" = false;
|
||||||
|
"toolkit.telemetry.hybridContent.enabled" = false;
|
||||||
|
"toolkit.telemetry.newProfilePing.enabled" = false;
|
||||||
|
"toolkit.telemetry.reportingPolicy.firstRun" = false;
|
||||||
|
"toolkit.telemetry.server" = "data:,";
|
||||||
|
"toolkit.telemetry.shutdownPingSender.enabled" = false;
|
||||||
|
"toolkit.telemetry.unified" = false;
|
||||||
|
"toolkit.telemetry.updatePing.enabled" = false;
|
||||||
|
|
||||||
|
## Pocket/Hello
|
||||||
|
"loop.enabled" = false;
|
||||||
|
"loop.feedback.baseUrl" = "";
|
||||||
|
"loop.gettingStarted.url" = "";
|
||||||
|
"loop.learnMoreUrl" = "";
|
||||||
|
"loop.legal.ToS_url" = "";
|
||||||
|
"loop.legal.privacy_url" = "";
|
||||||
|
"loop.oauth.google.redirect_uri" = "";
|
||||||
|
"loop.oauth.google.scope" = "";
|
||||||
|
"loop.server" = "";
|
||||||
|
"loop.soft_start_hostname" = "";
|
||||||
|
"loop.support_url" = "";
|
||||||
|
"loop.throttled2" = false;
|
||||||
|
"loop.logDomains" = false;
|
||||||
|
"browser.pocket.enabled" = false;
|
||||||
|
"browser.pocket.api" = "";
|
||||||
|
"browser.pocket.site" = "";
|
||||||
|
"browser.pocket.oAuthConsumerKey" = "";
|
||||||
|
"browser.pocket.useLocaleList" = false;
|
||||||
|
"brwoser.pocket.enabledLocales" = "";
|
||||||
|
|
||||||
|
## Plugins
|
||||||
|
"plugin.state.flash" = 0;
|
||||||
|
"plugin.state.java" = 0;
|
||||||
|
|
||||||
|
## Misc
|
||||||
|
"browser.selfsupport.url" = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
26
modules/desktop/forensics.nix
Normal file
26
modules/desktop/forensics.nix
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.forensics;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.forensics = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
acquire
|
||||||
|
afflib
|
||||||
|
autopsy
|
||||||
|
fatcat
|
||||||
|
foremost
|
||||||
|
hstsparser
|
||||||
|
networkminer
|
||||||
|
sleuthkit
|
||||||
|
testdisk-qt
|
||||||
|
tracee
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
74
modules/desktop/gaming/emulators.nix
Normal file
74
modules/desktop/gaming/emulators.nix
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.gaming.emulators;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.gaming.emulators = {
|
||||||
|
ds.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
gb.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
gba.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
gamecube.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
ps1.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
ps2.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
ps3.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
psp.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
snes.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
switch.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
wii.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
xbox.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
(lib.mkIf cfg.ps1.enable duckstation)
|
||||||
|
(lib.mkIf cfg.ps2.enable unstable.pcsx2)
|
||||||
|
(lib.mkIf cfg.ps3.enable rpcs3)
|
||||||
|
(lib.mkIf cfg.psp.enable unstable.ppsspp)
|
||||||
|
(lib.mkIf cfg.ds.enable desmume)
|
||||||
|
(lib.mkIf (cfg.gba.enable ||
|
||||||
|
cfg.gb.enable ||
|
||||||
|
cfg.snes.enable)
|
||||||
|
higan)
|
||||||
|
(lib.mkIf cfg.switch.enable yuzuPackages.mainline)
|
||||||
|
(lib.mkIf (cfg.wii.enable ||
|
||||||
|
cfg.gamecube.enable)
|
||||||
|
dolphin-emu)
|
||||||
|
(lib.mkIf cfg.xbox.enable unstable.xemu)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
30
modules/desktop/gaming/lutris.nix
Normal file
30
modules/desktop/gaming/lutris.nix
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.gaming.lutris;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.gaming.lutris = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
(lutris.override {
|
||||||
|
extraPkgs = pkgs: [
|
||||||
|
winePackages.staging
|
||||||
|
wine64Packages.staging
|
||||||
|
];
|
||||||
|
})
|
||||||
|
vulkan-loader
|
||||||
|
vulkan-tools
|
||||||
|
];
|
||||||
|
|
||||||
|
hardware.opengl = {
|
||||||
|
enable = true;
|
||||||
|
driSupport = true;
|
||||||
|
driSupport32Bit = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
17
modules/desktop/gaming/steam.nix
Normal file
17
modules/desktop/gaming/steam.nix
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.gaming.steam;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.gaming.steam = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
programs.steam.enable = true;
|
||||||
|
|
||||||
|
systemd.extraConfig = "DefaultLimitNOFILE=1048576";
|
||||||
|
};
|
||||||
|
}
|
287
modules/desktop/gnome.nix
Normal file
287
modules/desktop/gnome.nix
Normal file
@ -0,0 +1,287 @@
|
|||||||
|
{ config, lib, pkgs, self, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.gnome;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.gnome = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.xserver = {
|
||||||
|
enable = true;
|
||||||
|
displayManager.gdm.enable = true;
|
||||||
|
desktopManager.gnome.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.flatpak.enable = true;
|
||||||
|
services.fwupd.enable = true;
|
||||||
|
|
||||||
|
programs.dconf.enable = true;
|
||||||
|
dconf.settings = {
|
||||||
|
"io/github/celluloid-player/celluloid" = {
|
||||||
|
draggable-video-area-enable = true;
|
||||||
|
};
|
||||||
|
"org/gnome/desktop/interface" = {
|
||||||
|
color-scheme = "prefer-dark";
|
||||||
|
cursor-theme = "Adwaita";
|
||||||
|
enable-hot-corners = false;
|
||||||
|
font-name = "Cantarell 11";
|
||||||
|
gtk-theme = "adw-gtk3-dark";
|
||||||
|
icon-theme = "MoreWaita";
|
||||||
|
monospace-font-name = "UbuntuMono Nerd Font 11";
|
||||||
|
toolbar-style = "both-horiz";
|
||||||
|
};
|
||||||
|
"org/gnome/desktop/peripherals/touchpad" = {
|
||||||
|
tap-to-click = true;
|
||||||
|
};
|
||||||
|
"org/gnome/desktop/sound" = {
|
||||||
|
theme-name = "freedesktop";
|
||||||
|
};
|
||||||
|
"org/gnome/desktop/search-providers" = {
|
||||||
|
disabled = [ "org.gnome.Epiphany.desktop" ];
|
||||||
|
};
|
||||||
|
"org/gnome/desktop/wm/keybindings" = {
|
||||||
|
switch-group = [ "<Super>grave" ];
|
||||||
|
switch-group-backward = [ "<Shift><Super>grave" ];
|
||||||
|
};
|
||||||
|
"org/gnome/desktop/wm/preferences" = {
|
||||||
|
button-layout = "appmenu:close";
|
||||||
|
};
|
||||||
|
"org/gnome/gnome-session" = {
|
||||||
|
auto-save-session = true;
|
||||||
|
};
|
||||||
|
"org/gnome/gnome-system-monitor" = {
|
||||||
|
show-dependencies = true;
|
||||||
|
};
|
||||||
|
"org/gnome/mutter" = {
|
||||||
|
center-new-windows = true;
|
||||||
|
edge-tiling = true;
|
||||||
|
experimental-features = [ "scale-monitor-framebuffer" ];
|
||||||
|
};
|
||||||
|
"org/gnome/settings-daemon/plugins/media-keys" = {
|
||||||
|
volume-up = [
|
||||||
|
"<Shift>F12"
|
||||||
|
"XF86AudioRaiseVolume"
|
||||||
|
];
|
||||||
|
volume-down = [
|
||||||
|
"<Shift>F11"
|
||||||
|
"XF86AudioLowerVolume"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"org/gnome/shell" = {
|
||||||
|
disable-user-extensions = false;
|
||||||
|
enabled-extensions = [
|
||||||
|
"appindicatorsupport@rgcjonas.gmail.com"
|
||||||
|
# "arcmenu@arcmenu.com"
|
||||||
|
"blur-my-shell@aunetx"
|
||||||
|
# "browser-tabs@com.github.harshadgavali"
|
||||||
|
"burn-my-windows@schneegans.github.com"
|
||||||
|
"clipboard-indicator@tudmotu.com"
|
||||||
|
"CoverflowAltTab@palatis.blogspot.com"
|
||||||
|
# "dash-to-panel@jderose9.github.com"
|
||||||
|
# "desktop-cube@schneegans.github.com"
|
||||||
|
# "EasyScreenCast@iacopodeenosee.gmail.com"
|
||||||
|
"espresso@coadmunkee.github.com"
|
||||||
|
"flypie@schneegans.github.com"
|
||||||
|
# "forge@jmmaranan.com"
|
||||||
|
"gsconnect@andyholmes.github.io"
|
||||||
|
# "gSnap@micahosborne"
|
||||||
|
# "hidetopbar@mathieu.bidon.ca"
|
||||||
|
"just-perfection-desktop@just-perfection"
|
||||||
|
# "mediacontrols@cliffniff.github.com"
|
||||||
|
# "mousefollowsfocus@matthes.biz"
|
||||||
|
# "pano@elhan.io"
|
||||||
|
# "paperwm@hedning:matrix.org"
|
||||||
|
"pip-on-top@rafostar.github.com"
|
||||||
|
# "rounded-window-corners@yilozt"
|
||||||
|
# "search-light@icedman.github.com"
|
||||||
|
# "smart-auto-move@khimaros.com"
|
||||||
|
"space-bar@luchrioh"
|
||||||
|
# "tiling-assistant@leleat-on-github"
|
||||||
|
"tilingshell@ferrarodomenico.com"
|
||||||
|
"Vitals@CoreCoding.com"
|
||||||
|
"windowIsReady_Remover@nunofarruca@gmail.com"
|
||||||
|
# "worksets@blipk.xyz"
|
||||||
|
# "wsmatrix@martin.zurowietz.de"
|
||||||
|
];
|
||||||
|
favorite-apps = [
|
||||||
|
"firefox.desktop"
|
||||||
|
"org.gnome.Nautilus.desktop"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/blur-my-shell/panel" = {
|
||||||
|
static-blur = true;
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/blur-my-shell/applications" = {
|
||||||
|
blur = false;
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/burn-my-windows" = {
|
||||||
|
fire-close-effect = false;
|
||||||
|
glide-open-effect = true;
|
||||||
|
glide-close-effect = true;
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/dash-to-panel" = {
|
||||||
|
intellihide = true;
|
||||||
|
panel-positions = ''
|
||||||
|
{"0":"TOP"}
|
||||||
|
'';
|
||||||
|
trans-panel-opacity = 0.3;
|
||||||
|
trans-use-custom-opacity = true;
|
||||||
|
trans-use-dynamic-opacity = true;
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/espresso" = {
|
||||||
|
enable-fullscreen = true;
|
||||||
|
show-indicator = true;
|
||||||
|
show-notifications = false;
|
||||||
|
inhibit-apps = [
|
||||||
|
"com.obsproject.Studio.desktop"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/flypie" = {
|
||||||
|
preview-on-right-side = true;
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/forge" = {
|
||||||
|
window-gap-size = 8;
|
||||||
|
window-gap-hidden-on-single = false;
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/hidetopbar" = {
|
||||||
|
mouse-sensitive = true;
|
||||||
|
mouse-sensitive-fullscreen-window = true;
|
||||||
|
enable-active-window = false;
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/just-perfection" = {
|
||||||
|
activities-button = false;
|
||||||
|
window-demands-attention-focus = true;
|
||||||
|
workspace-wrap-around = true;
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/paperwm" = {
|
||||||
|
use-default-background = true;
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/pip-on-top" = {
|
||||||
|
stick = true;
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/search-light" = {
|
||||||
|
popup-at-cursor-monitor = true;
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/space-bar/behavior" = {
|
||||||
|
enable-activate-workspace-shortcuts = true;
|
||||||
|
show-empty-workspaces = true;
|
||||||
|
smart-workspace-names = false;
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/tiling-assistant" = {
|
||||||
|
screen-top-gap = 8;
|
||||||
|
screen-right-gap = 8;
|
||||||
|
screen-bottom-gap = 8;
|
||||||
|
screen-left-gap = 8;
|
||||||
|
window-gap = 8;
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/tilingshell" = {
|
||||||
|
inner-gaps = 16;
|
||||||
|
outer-gaps = 8;
|
||||||
|
enable-blur-snap-assistant = true;
|
||||||
|
};
|
||||||
|
"org/gnome/Console" = {
|
||||||
|
font-scale = 1.4;
|
||||||
|
use-system-font = false;
|
||||||
|
custom-font = "ComicShannsMono Nerd Font 10";
|
||||||
|
};
|
||||||
|
"org/gtk/settings/file-chooser" = {
|
||||||
|
show-hidden = true;
|
||||||
|
sort-directories-first = true;
|
||||||
|
};
|
||||||
|
"org/gtk/gtk4/settings/file-chooser" = {
|
||||||
|
show-hidden = true;
|
||||||
|
sort-directories-first = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.sessionVariables = {
|
||||||
|
QT_STYLE_OVERRIDE = lib.mkForce "kvantum";
|
||||||
|
QT_WAYLAND_DECORATION = lib.mkForce "adwaita";
|
||||||
|
};
|
||||||
|
|
||||||
|
home.configFile = {
|
||||||
|
"Kvantum/kvantum.kvconfig".text = lib.generators.toINI {} {
|
||||||
|
General.theme = "KvLibadwaitaDark";
|
||||||
|
};
|
||||||
|
"Kvantum/KvLibadwaita".source = "${self.inputs.kvlibadwaita}/src/KvLibadwaita";
|
||||||
|
};
|
||||||
|
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
authenticator
|
||||||
|
# bottles
|
||||||
|
# bustle
|
||||||
|
celluloid
|
||||||
|
# d-spy
|
||||||
|
# drawing
|
||||||
|
# fragments
|
||||||
|
gnome.dconf-editor
|
||||||
|
gnome.ghex
|
||||||
|
# gnome-builder
|
||||||
|
gnome-decoder
|
||||||
|
gnome-firmware
|
||||||
|
gnome-frog
|
||||||
|
# gnome-obfuscate
|
||||||
|
gnome-podcasts
|
||||||
|
identity
|
||||||
|
mission-center
|
||||||
|
mousam
|
||||||
|
newsflash
|
||||||
|
# schemes
|
||||||
|
shortwave
|
||||||
|
sysprof
|
||||||
|
] ++ (if config.virtualisation.podman.enable then [
|
||||||
|
pods
|
||||||
|
] else []);
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs.unstable; [
|
||||||
|
adw-gtk3
|
||||||
|
kdePackages.qtstyleplugin-kvantum
|
||||||
|
libsForQt5.qtstyleplugin-kvantum
|
||||||
|
morewaita-icon-theme
|
||||||
|
nautilus-python
|
||||||
|
qadwaitadecorations
|
||||||
|
qadwaitadecorations-qt6
|
||||||
|
|
||||||
|
## Shell extensions
|
||||||
|
gnomeExtensions.appindicator
|
||||||
|
gnomeExtensions.arcmenu
|
||||||
|
gnomeExtensions.blur-my-shell
|
||||||
|
gnomeExtensions.browser-tabs
|
||||||
|
gnomeExtensions.burn-my-windows
|
||||||
|
gnomeExtensions.clipboard-indicator
|
||||||
|
gnomeExtensions.coverflow-alt-tab
|
||||||
|
gnomeExtensions.dash-to-panel
|
||||||
|
gnomeExtensions.desktop-cube
|
||||||
|
gnomeExtensions.easyScreenCast
|
||||||
|
gnomeExtensions.espresso
|
||||||
|
gnomeExtensions.fly-pie
|
||||||
|
gnomeExtensions.forge
|
||||||
|
gnomeExtensions.gsconnect
|
||||||
|
gnomeExtensions.gsnap
|
||||||
|
gnomeExtensions.hide-top-bar
|
||||||
|
gnomeExtensions.just-perfection
|
||||||
|
gnomeExtensions.media-controls
|
||||||
|
gnomeExtensions.mouse-follows-focus
|
||||||
|
gnomeExtensions.pano
|
||||||
|
gnomeExtensions.paperwm
|
||||||
|
gnomeExtensions.pip-on-top
|
||||||
|
gnomeExtensions.rounded-window-corners
|
||||||
|
gnomeExtensions.search-light
|
||||||
|
gnomeExtensions.smart-auto-move
|
||||||
|
gnomeExtensions.space-bar
|
||||||
|
gnomeExtensions.tiling-assistant
|
||||||
|
gnomeExtensions.tiling-shell
|
||||||
|
gnomeExtensions.todotxt
|
||||||
|
gnomeExtensions.vitals
|
||||||
|
gnomeExtensions.window-is-ready-remover
|
||||||
|
gnomeExtensions.worksets
|
||||||
|
gnomeExtensions.workspace-matrix
|
||||||
|
];
|
||||||
|
|
||||||
|
home.services.gpg-agent.pinentryPackage = pkgs.pinentry-gnome3;
|
||||||
|
};
|
||||||
|
}
|
27
modules/desktop/hyprland.nix
Normal file
27
modules/desktop/hyprland.nix
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.hyprland;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.hyprland = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
programs.hyprland.enable = true;
|
||||||
|
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
mpv
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
adw-gtk3
|
||||||
|
];
|
||||||
|
|
||||||
|
home.services.gpg-agent.pinentryPackage = pkgs.pinentry-gnome3;
|
||||||
|
};
|
||||||
|
}
|
37
modules/desktop/kde.nix
Normal file
37
modules/desktop/kde.nix
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.kde;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.kde = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services = {
|
||||||
|
xserver = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
desktopManager.plasma6.enable = true;
|
||||||
|
displayManager.sddm = {
|
||||||
|
enable = true;
|
||||||
|
wayland.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
kmail
|
||||||
|
mpv
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
adw-gtk3
|
||||||
|
];
|
||||||
|
|
||||||
|
home.services.gpg-agent.pinentryPackage = pkgs.pinentry-qt;
|
||||||
|
};
|
||||||
|
}
|
28
modules/desktop/media/graphics.nix
Normal file
28
modules/desktop/media/graphics.nix
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.media.graphics;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.media.graphics = {
|
||||||
|
modeling.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
raster.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
vector.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
(lib.mkIf cfg.modeling.enable blender)
|
||||||
|
(lib.mkIf cfg.raster.enable gimp)
|
||||||
|
(lib.mkIf cfg.raster.enable krita)
|
||||||
|
(lib.mkIf cfg.vector.enable inkscape)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
28
modules/desktop/media/recording.nix
Normal file
28
modules/desktop/media/recording.nix
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.desktop.media.recording;
|
||||||
|
in {
|
||||||
|
options.modules.desktop.media.recording = {
|
||||||
|
audio.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
video.enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
user.packages = with pkgs;
|
||||||
|
(if cfg.audio.enable then [
|
||||||
|
ardour
|
||||||
|
audacity
|
||||||
|
] else []) ++
|
||||||
|
(if cfg.video.enable then [
|
||||||
|
handbrake
|
||||||
|
mkvtoolnix
|
||||||
|
obs-studio
|
||||||
|
] else []);
|
||||||
|
};
|
||||||
|
}
|
@ -1,15 +1,19 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
avApp = "mpv.desktop";
|
cfg = config.modules.desktop.mimeapps;
|
||||||
imageApp = "org.gnome.Loupe.desktop";
|
avApp = "io.github.celluloid_player.Celluloid.desktop";
|
||||||
in
|
imageApp = "org.gnome.eog.desktop";
|
||||||
{
|
in {
|
||||||
xdg.mimeApps = {
|
options.modules.desktop.mimeapps = {
|
||||||
enable = true;
|
enable = lib.mkOption {
|
||||||
defaultApplications = {
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
xdg.mime.defaultApplications = {
|
||||||
# Audio/video
|
# Audio/video
|
||||||
"audio/x-vorbis+ogg" = avApp;
|
"audio/x-vorbis+ogg" = avApp;
|
||||||
"audio/3gpp" = avApp;
|
"audio/3gpp" = avApp;
|
38
modules/desktop/office/libreoffice.nix
Normal file
38
modules/desktop/office/libreoffice.nix
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.modules.desktop.office.libreoffice;
|
||||||
|
# libreoffice-gtk4 = pkgs.libreoffice.override {
|
||||||
|
# extraMakeWrapperArgs = [
|
||||||
|
# "--set SAL_USE_VCLPLUGIN gtk4"
|
||||||
|
# ];
|
||||||
|
# unwrapped = pkgs.libreoffice-unwrapped.overrideAttrs (oldAttrs: {
|
||||||
|
# buildInputs = oldAttrs.buildInputs ++ [
|
||||||
|
# pkgs.gtk4
|
||||||
|
# ];
|
||||||
|
# configureFlags = oldAttrs.configureFlags ++ [
|
||||||
|
# "--disable-werror"
|
||||||
|
# "--enable-gtk4"
|
||||||
|
# ];
|
||||||
|
# passthru = oldAttrs.passthru // {
|
||||||
|
# inherit (pkgs) gtk4;
|
||||||
|
# };
|
||||||
|
# });
|
||||||
|
# };
|
||||||
|
in {
|
||||||
|
options.modules.desktop.office.libreoffice = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
(if config.modules.desktop.kde.enable == true then libreoffice-qt else libreoffice)
|
||||||
|
hunspell
|
||||||
|
hunspellDicts.en-gb-large
|
||||||
|
hunspellDicts.en-us-large
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
21
modules/dev/cc.nix
Normal file
21
modules/dev/cc.nix
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.dev.cc;
|
||||||
|
in {
|
||||||
|
options.modules.dev.cc = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
clang
|
||||||
|
gcc
|
||||||
|
gdb
|
||||||
|
cmake
|
||||||
|
llvmPackages.libcxx
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
17
modules/dev/java.nix
Normal file
17
modules/dev/java.nix
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.dev.java;
|
||||||
|
in {
|
||||||
|
options.modules.dev.java = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
jdk
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
17
modules/dev/lua.nix
Normal file
17
modules/dev/lua.nix
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.dev.lua;
|
||||||
|
in {
|
||||||
|
options.modules.dev.lua = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
lua
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
17
modules/dev/node.nix
Normal file
17
modules/dev/node.nix
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.dev.node;
|
||||||
|
in {
|
||||||
|
options.modules.dev.node = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
nodejs_latest
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
17
modules/dev/python.nix
Normal file
17
modules/dev/python.nix
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.dev.python;
|
||||||
|
in {
|
||||||
|
options.modules.dev.python = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
python310
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
20
modules/dev/rust.nix
Normal file
20
modules/dev/rust.nix
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.dev.rust;
|
||||||
|
in {
|
||||||
|
options.modules.dev.rust = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
rustc
|
||||||
|
rustup
|
||||||
|
rustfmt
|
||||||
|
rust-bindgen
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
19
modules/dev/scala.nix
Normal file
19
modules/dev/scala.nix
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.dev.scala;
|
||||||
|
in {
|
||||||
|
options.modules.dev.scala = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
jdk
|
||||||
|
sbt
|
||||||
|
scala
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
17
modules/dev/shell.nix
Normal file
17
modules/dev/shell.nix
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.dev.shell;
|
||||||
|
in {
|
||||||
|
options.modules.dev.shell = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
shellcheck
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
17
modules/dev/zig.nix
Normal file
17
modules/dev/zig.nix
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.dev.zig;
|
||||||
|
in {
|
||||||
|
options.modules.dev.zig = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
user.packages = with pkgs; [
|
||||||
|
zig
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
139
modules/editors/neovim/default.nix
Normal file
139
modules/editors/neovim/default.nix
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.modules.editors.neovim;
|
||||||
|
in {
|
||||||
|
options.modules.editors.neovim = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.programs.nixvim = {
|
||||||
|
enable = true;
|
||||||
|
defaultEditor = true;
|
||||||
|
|
||||||
|
viAlias = true;
|
||||||
|
vimAlias = true;
|
||||||
|
|
||||||
|
options = {
|
||||||
|
number = true;
|
||||||
|
tabstop = 2;
|
||||||
|
shiftwidth = 2;
|
||||||
|
expandtab = true;
|
||||||
|
foldlevel = 99;
|
||||||
|
splitbelow = true;
|
||||||
|
splitright = true;
|
||||||
|
undofile = true;
|
||||||
|
updatetime = 100;
|
||||||
|
list = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
globals = {
|
||||||
|
mapleader = ",";
|
||||||
|
maplocalleader = ",";
|
||||||
|
};
|
||||||
|
|
||||||
|
clipboard = {
|
||||||
|
register = "unnamedplus";
|
||||||
|
|
||||||
|
providers.wl-copy.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
plugins.comment.enable = true;
|
||||||
|
|
||||||
|
plugins.hmts.enable = true;
|
||||||
|
|
||||||
|
plugins.lightline.enable = true;
|
||||||
|
|
||||||
|
plugins.luasnip.enable = true;
|
||||||
|
|
||||||
|
plugins.lsp = {
|
||||||
|
enable = true;
|
||||||
|
servers = {
|
||||||
|
bashls.enable = true;
|
||||||
|
ccls.enable = true;
|
||||||
|
cssls.enable = true;
|
||||||
|
eslint.enable = true;
|
||||||
|
gopls.enable = true;
|
||||||
|
html.enable = true;
|
||||||
|
lua-ls.enable = true;
|
||||||
|
pylsp.enable = true;
|
||||||
|
nixd.enable = true;
|
||||||
|
rust-analyzer = {
|
||||||
|
enable = true;
|
||||||
|
installCargo = true;
|
||||||
|
installRustc = true;
|
||||||
|
};
|
||||||
|
tsserver.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
plugins.nvim-autopairs.enable = true;
|
||||||
|
|
||||||
|
plugins.cmp = {
|
||||||
|
enable = true;
|
||||||
|
autoEnableSources = true;
|
||||||
|
settings = {
|
||||||
|
sources = [
|
||||||
|
{ name = "nvim_lsp"; }
|
||||||
|
{ name = "path"; }
|
||||||
|
{ name = "buffer"; }
|
||||||
|
];
|
||||||
|
mapping = {
|
||||||
|
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
|
||||||
|
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
|
||||||
|
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
plugins.telescope = {
|
||||||
|
enable = true;
|
||||||
|
keymaps = {
|
||||||
|
"<leader>ff" = "find_files";
|
||||||
|
"<leader>fg" = "live_grep";
|
||||||
|
"<leader>b" = "buffers";
|
||||||
|
"<leader>fh" = "help_tags";
|
||||||
|
"<C-p>" = "git_files";
|
||||||
|
"<C-f>" = "live_grep";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
plugins.treesitter = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
nixvimInjections = true;
|
||||||
|
|
||||||
|
folding = true;
|
||||||
|
indent = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
plugins.treesitter-refactor = {
|
||||||
|
enable = true;
|
||||||
|
highlightDefinitions = {
|
||||||
|
enable = true;
|
||||||
|
clearOnCursorMove = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
plugins.undotree.enable = true;
|
||||||
|
|
||||||
|
# plugins.gitsigns.enable = true;
|
||||||
|
# plugins.gitgutter.enable = true;
|
||||||
|
# plugins.goyo.enable = true;
|
||||||
|
# plugins.fugitive.enable = true;
|
||||||
|
# plugins.fzf-lua.enable = true;
|
||||||
|
# plugins.neo-tree.enable = true;
|
||||||
|
# plugins.none-ls.enable = true;
|
||||||
|
# plugins.nvim-tree.enable = true;
|
||||||
|
# plugins.oil.enable = true;
|
||||||
|
# plugins.project-nvim.enable = true;
|
||||||
|
# plugins.surround.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
env.EDITOR = "nvim";
|
||||||
|
};
|
||||||
|
}
|
49
modules/editors/vscode.nix
Normal file
49
modules/editors/vscode.nix
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.editors.vscode;
|
||||||
|
in {
|
||||||
|
options.modules.editors.vscode = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||||
|
|
||||||
|
home.programs.vscode = {
|
||||||
|
enable = true;
|
||||||
|
extensions = with pkgs.vscode-extensions; [
|
||||||
|
asvetliakov.vscode-neovim
|
||||||
|
brettm12345.nixfmt-vscode
|
||||||
|
coolbear.systemd-unit-file
|
||||||
|
editorconfig.editorconfig
|
||||||
|
golang.go
|
||||||
|
graphql.vscode-graphql-syntax
|
||||||
|
mattn.lisp
|
||||||
|
# mkhl.direnv
|
||||||
|
ms-python.vscode-pylance
|
||||||
|
ms-vscode.cpptools
|
||||||
|
ms-vscode.hexeditor
|
||||||
|
piousdeer.adwaita-theme
|
||||||
|
# redhat.java
|
||||||
|
# sumneko.lua
|
||||||
|
];
|
||||||
|
userSettings = {
|
||||||
|
"editor.renderLineHighlight" = "none";
|
||||||
|
"extensions.experimental.affinity" = {
|
||||||
|
"asvetliakov.vscode-neovim" = 1;
|
||||||
|
};
|
||||||
|
"files.autoSave" = "off";
|
||||||
|
"window.autoDetectColorScheme" = true;
|
||||||
|
"window.commandCenter" = true;
|
||||||
|
"window.titleBarStyle" = "custom";
|
||||||
|
"workbench.iconTheme" = null;
|
||||||
|
"workbench.preferredDarkColorTheme" = "Adwaita Dark";
|
||||||
|
"workbench.preferredLightColorTheme" = "Adwaita Light";
|
||||||
|
"workbench.tree.indent" = 12;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -15,16 +15,16 @@ index ab5fed9f55b6..da50a4782414 100644
|
|||||||
--- a/sound/usb/format.c
|
--- a/sound/usb/format.c
|
||||||
+++ b/sound/usb/format.c
|
+++ b/sound/usb/format.c
|
||||||
@@ -378,8 +378,8 @@ static int parse_uac2_sample_rate_range(struct snd_usb_audio *chip,
|
@@ -378,8 +378,8 @@ static int parse_uac2_sample_rate_range(struct snd_usb_audio *chip,
|
||||||
|
|
||||||
for (rate = min; rate <= max; rate += res) {
|
for (rate = min; rate <= max; rate += res) {
|
||||||
|
|
||||||
- /* Filter out invalid rates on Presonus Studio 1810c */
|
- /* Filter out invalid rates on Presonus Studio 1810c */
|
||||||
- if (chip->usb_id == USB_ID(0x194f, 0x010c) &&
|
- if (chip->usb_id == USB_ID(0x194f, 0x010c) &&
|
||||||
+ /* Filter out invalid rates on Presonus Studio 1824c */
|
+ /* Filter out invalid rates on Presonus Studio 1824c */
|
||||||
+ if (chip->usb_id == USB_ID(0x194f, 0x010d) &&
|
+ if (chip->usb_id == USB_ID(0x194f, 0x010d) &&
|
||||||
!s1810c_valid_sample_rate(fp, rate))
|
!s1810c_valid_sample_rate(fp, rate))
|
||||||
goto skip_rate;
|
goto skip_rate;
|
||||||
|
|
||||||
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
|
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
|
||||||
index 898bc3baca7b..c3135459c38c 100644
|
index 898bc3baca7b..c3135459c38c 100644
|
||||||
--- a/sound/usb/mixer_quirks.c
|
--- a/sound/usb/mixer_quirks.c
|
||||||
@ -32,7 +32,7 @@ index 898bc3baca7b..c3135459c38c 100644
|
|||||||
@@ -3445,7 +3445,7 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
|
@@ -3445,7 +3445,7 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
|
||||||
err = snd_rme_controls_create(mixer);
|
err = snd_rme_controls_create(mixer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
- case USB_ID(0x194f, 0x010c): /* Presonus Studio 1810c */
|
- case USB_ID(0x194f, 0x010c): /* Presonus Studio 1810c */
|
||||||
+ case USB_ID(0x194f, 0x010d): /* Presonus Studio 1824c */
|
+ case USB_ID(0x194f, 0x010d): /* Presonus Studio 1824c */
|
||||||
err = snd_sc1810_init_mixer(mixer);
|
err = snd_sc1810_init_mixer(mixer);
|
||||||
@ -44,7 +44,7 @@ index fac4bbc6b275..5bc2e66d452c 100644
|
|||||||
+++ b/sound/usb/mixer_s1810c.c
|
+++ b/sound/usb/mixer_s1810c.c
|
||||||
@@ -552,7 +552,7 @@ int snd_sc1810_init_mixer(struct usb_mixer_interface *mixer)
|
@@ -552,7 +552,7 @@ int snd_sc1810_init_mixer(struct usb_mixer_interface *mixer)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
dev_info(&dev->dev,
|
dev_info(&dev->dev,
|
||||||
- "Presonus Studio 1810c, device_setup: %u\n", chip->setup);
|
- "Presonus Studio 1810c, device_setup: %u\n", chip->setup);
|
||||||
+ "Presonus Studio 1824c, device_setup: %u\n", chip->setup);
|
+ "Presonus Studio 1824c, device_setup: %u\n", chip->setup);
|
||||||
@ -64,7 +64,8 @@ index ab2b938502eb..b86832edaaa0 100644
|
|||||||
+ /* presonus studio 1824c: skip altsets incompatible with device_setup */
|
+ /* presonus studio 1824c: skip altsets incompatible with device_setup */
|
||||||
+ if (chip->usb_id == USB_ID(0x194f, 0x010d))
|
+ if (chip->usb_id == USB_ID(0x194f, 0x010d))
|
||||||
return s1810c_skip_setting_quirk(chip, iface, altno);
|
return s1810c_skip_setting_quirk(chip, iface, altno);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
2.42.0
|
2.42.0
|
||||||
|
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.hardware.presonus-studio;
|
cfg = config.modules.hardware.presonus-studio;
|
||||||
snd-usb-audio-module = pkgs.callPackage ./snd-usb-audio.nix {
|
snd-usb-audio-module = pkgs.callPackage ./snd-usb-audio.nix {
|
||||||
@ -18,8 +13,7 @@ let
|
|||||||
"channelmix.upmix-method" = "psd";
|
"channelmix.upmix-method" = "psd";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.modules.hardware.presonus-studio = {
|
options.modules.hardware.presonus-studio = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
@ -73,23 +67,11 @@ in
|
|||||||
"capture.props" = {
|
"capture.props" = {
|
||||||
"node.name" = "Genelec_Speakers";
|
"node.name" = "Genelec_Speakers";
|
||||||
"media.class" = "Audio/Sink";
|
"media.class" = "Audio/Sink";
|
||||||
"audio.position" = [
|
"audio.position" = [ "FL" "FR" "SL" "SR" "LFE" ];
|
||||||
"FL"
|
|
||||||
"FR"
|
|
||||||
"SL"
|
|
||||||
"SR"
|
|
||||||
"LFE"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
"playback.props" = {
|
"playback.props" = {
|
||||||
"node.name" = "playback.Genelec_Speakers";
|
"node.name" = "playback.Genelec_Speakers";
|
||||||
"audio.position" = [
|
"audio.position" = [ "AUX0" "AUX1" "AUX3" "AUX4" "AUX5" ];
|
||||||
"AUX0"
|
|
||||||
"AUX1"
|
|
||||||
"AUX3"
|
|
||||||
"AUX4"
|
|
||||||
"AUX5"
|
|
||||||
];
|
|
||||||
"target.object" = "alsa_output.usb-PreSonus_Studio_1824c_SC4E21110775-00.multichannel-output";
|
"target.object" = "alsa_output.usb-PreSonus_Studio_1824c_SC4E21110775-00.multichannel-output";
|
||||||
"stream.dont-remix" = true;
|
"stream.dont-remix" = true;
|
||||||
"node.passive" = true;
|
"node.passive" = true;
|
||||||
@ -100,7 +82,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
pipewire-pulse."40-upmix" = upmixConfig;
|
pipewire-pulse."40-upmix" = upmixConfig;
|
||||||
client."40-upmix" = upmixConfig;
|
client-rt."40-upmix" = upmixConfig;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -1,17 +1,8 @@
|
|||||||
{
|
{ pkgs, lib, kernel ? pkgs.linuxPackages_latest.kernel }:
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
kernel ? pkgs.linuxPackages_latest.kernel,
|
|
||||||
}:
|
|
||||||
|
|
||||||
pkgs.stdenv.mkDerivation {
|
pkgs.stdenv.mkDerivation {
|
||||||
pname = "snd-usb-audio";
|
pname = "snd-usb-audio";
|
||||||
inherit (kernel)
|
inherit (kernel) src version postPatch nativeBuildInputs;
|
||||||
src
|
|
||||||
version
|
|
||||||
postPatch
|
|
||||||
nativeBuildInputs
|
|
||||||
;
|
|
||||||
|
|
||||||
kernel_dev = kernel.dev;
|
kernel_dev = kernel.dev;
|
||||||
kernelVersion = kernel.modDirVersion;
|
kernelVersion = kernel.modDirVersion;
|
||||||
@ -42,3 +33,4 @@ pkgs.stdenv.mkDerivation {
|
|||||||
license = lib.licenses.gpl2;
|
license = lib.licenses.gpl2;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -1,18 +1,11 @@
|
|||||||
{
|
{ config, lib, pkgs, self, ... }:
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.services.tailscale;
|
cfg = config.modules.networking.tailscale;
|
||||||
headscale = "https://headscale.vimium.net";
|
headscale = "https://headscale.vimium.net";
|
||||||
hostname = config.networking.hostName;
|
hostname = config.networking.hostName;
|
||||||
in
|
in {
|
||||||
{
|
options.modules.networking.tailscale = {
|
||||||
options.modules.services.tailscale = {
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
@ -25,7 +18,7 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
age.secrets."passwords/services/tailscale/${hostname}-authkey" = {
|
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 ];
|
environment.systemPackages = [ pkgs.tailscale ];
|
@ -1,24 +1,17 @@
|
|||||||
{
|
{ config, lib, pkgs, self, ... }:
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let cfg = config.modules.networking.wireless;
|
||||||
cfg = config.modules.system.wireless;
|
in {
|
||||||
in
|
options.modules.networking.wireless = {
|
||||||
{
|
|
||||||
options.modules.system.wireless = {
|
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
description = mdDoc "Automatically connect to known networks";
|
description = mdDoc "Automatically connect to known networks";
|
||||||
};
|
};
|
||||||
interfaces = mkOption {
|
interfaces = mkOption {
|
||||||
default = [ ]; # All interfaces
|
default = [ ]; # All interfaces
|
||||||
example = [ "wlan0" ];
|
example = [ "wlan0" ];
|
||||||
description = mdDoc "Interfaces for `wpa_supplicant` to bind to";
|
description = mdDoc "Interfaces for `wpa_supplicant` to bind to";
|
||||||
};
|
};
|
||||||
@ -26,16 +19,16 @@ in
|
|||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
age.secrets."passwords/networks" = {
|
age.secrets."passwords/networks" = {
|
||||||
file = "${inputs.secrets}/passwords/networks.age";
|
file = "${self.inputs.secrets}/passwords/networks.age";
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
wireless = {
|
wireless = {
|
||||||
enable = true;
|
enable = true;
|
||||||
interfaces = cfg.interfaces;
|
interfaces = cfg.interfaces;
|
||||||
secretsFile = config.age.secrets."passwords/networks".path;
|
environmentFile = config.age.secrets."passwords/networks".path;
|
||||||
networks = {
|
networks = {
|
||||||
"Apollo 600 Mbps".pskRaw = "ext:PSK_APOLLO";
|
"Apollo 600 Mbps".psk = "@PSK_APOLLO@";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networkmanager.ensureProfiles.profiles = {
|
networkmanager.ensureProfiles.profiles = {
|
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
imports = [
|
|
||||||
./hardware/presonus-studio
|
|
||||||
./podman.nix
|
|
||||||
./services/borgmatic.nix
|
|
||||||
./services/postgresql.nix
|
|
||||||
./services/tailscale.nix
|
|
||||||
./system/desktop/gnome.nix
|
|
||||||
./system/desktop/hyprland.nix
|
|
||||||
./system/wireless.nix
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,74 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.system.desktop.gnome;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.system.desktop.gnome = {
|
|
||||||
enable = lib.mkOption {
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
services.xserver = {
|
|
||||||
enable = true;
|
|
||||||
displayManager.gdm.enable = true;
|
|
||||||
desktopManager.gnome.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.flatpak.enable = true;
|
|
||||||
services.fwupd.enable = true;
|
|
||||||
|
|
||||||
programs.dconf.enable = true;
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs.unstable; [
|
|
||||||
adw-gtk3
|
|
||||||
adwaita-fonts
|
|
||||||
libsForQt5.qtstyleplugin-kvantum
|
|
||||||
morewaita-icon-theme
|
|
||||||
nautilus-python
|
|
||||||
qadwaitadecorations
|
|
||||||
qadwaitadecorations-qt6
|
|
||||||
|
|
||||||
## Shell extensions
|
|
||||||
gnomeExtensions.appindicator
|
|
||||||
gnomeExtensions.arcmenu
|
|
||||||
gnomeExtensions.blur-my-shell
|
|
||||||
gnomeExtensions.burn-my-windows
|
|
||||||
gnomeExtensions.clipboard-indicator
|
|
||||||
gnomeExtensions.coverflow-alt-tab
|
|
||||||
gnomeExtensions.dash-to-panel
|
|
||||||
gnomeExtensions.desktop-cube
|
|
||||||
gnomeExtensions.easyScreenCast
|
|
||||||
gnomeExtensions.espresso
|
|
||||||
gnomeExtensions.fly-pie
|
|
||||||
gnomeExtensions.forge
|
|
||||||
gnomeExtensions.gsconnect
|
|
||||||
gnomeExtensions.gsnap
|
|
||||||
gnomeExtensions.hide-top-bar
|
|
||||||
gnomeExtensions.just-perfection
|
|
||||||
gnomeExtensions.media-controls
|
|
||||||
gnomeExtensions.mouse-follows-focus
|
|
||||||
# gnomeExtensions.pano (disabled due to: https://github.com/NixOS/nixpkgs/issues/369438)
|
|
||||||
gnomeExtensions.paperwm
|
|
||||||
gnomeExtensions.pip-on-top
|
|
||||||
gnomeExtensions.search-light
|
|
||||||
gnomeExtensions.smart-auto-move
|
|
||||||
gnomeExtensions.space-bar
|
|
||||||
gnomeExtensions.tiling-assistant
|
|
||||||
gnomeExtensions.tiling-shell
|
|
||||||
gnomeExtensions.todotxt
|
|
||||||
gnomeExtensions.vitals
|
|
||||||
gnomeExtensions.window-is-ready-remover
|
|
||||||
gnomeExtensions.worksets
|
|
||||||
gnomeExtensions.workspace-matrix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (lib)
|
|
||||||
mkEnableOption
|
|
||||||
mkIf
|
|
||||||
;
|
|
||||||
cfg = config.modules.system.desktop.hyprland;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.system.desktop.hyprland.enable = mkEnableOption "hyprland";
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
networking.networkmanager.enable = true;
|
|
||||||
|
|
||||||
programs.hyprland = {
|
|
||||||
enable = true;
|
|
||||||
withUWSM = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
82
modules/options.nix
Normal file
82
modules/options.nix
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
{ config, options, lib, self, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
{
|
||||||
|
options = with types; {
|
||||||
|
user = mkOption { type = attrs; default = { }; };
|
||||||
|
|
||||||
|
home = {
|
||||||
|
configFile = mkOption { type = attrs; default = { }; description = "Files to place in $XDG_CONFIG_HOME"; };
|
||||||
|
dataFile = mkOption { type = attrs; default = { }; description = "Files to place in $XDG_DATA_HOME"; };
|
||||||
|
file = mkOption { type = attrs; default = { }; description = "Files to place directly in $HOME"; };
|
||||||
|
packages = mkOption { type = attrs; default = { }; description = "User-level installed packages"; };
|
||||||
|
programs = mkOption { type = attrs; default = { }; description = "Programs managed directly from home-manager"; };
|
||||||
|
services = mkOption { type = attrs; default = { }; description = "Services managed directly from home-manager"; };
|
||||||
|
};
|
||||||
|
|
||||||
|
dconf.settings = mkOption { type = attrs; default = { }; description = "dconf settings to enable"; };
|
||||||
|
|
||||||
|
env = mkOption {
|
||||||
|
type = attrsOf (oneOf [ str path (listOf (either str path)) ]);
|
||||||
|
apply = mapAttrs (n: v:
|
||||||
|
if isList v then
|
||||||
|
concatMapStringsSep ":" (x: toString x) v
|
||||||
|
else
|
||||||
|
(toString v));
|
||||||
|
default = { };
|
||||||
|
description = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
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;
|
||||||
|
in {
|
||||||
|
inherit name;
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [ "networkmanager" "wheel" "lxd" ];
|
||||||
|
description = "Jordan Holt";
|
||||||
|
useDefaultShell = true;
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILVHTjsyMIV4THNw6yz0OxAxGnC+41gX72UrPqTzR+OS jordan@vimium.com"
|
||||||
|
];
|
||||||
|
hashedPasswordFile = config.age.secrets."passwords/users/jordan".path;
|
||||||
|
home = "/home/${name}";
|
||||||
|
group = "users";
|
||||||
|
uid = 1000;
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
|
||||||
|
users.${config.user.name} = {
|
||||||
|
home = {
|
||||||
|
file = mkAliasDefinitions options.home.file;
|
||||||
|
stateVersion = config.system.stateVersion;
|
||||||
|
};
|
||||||
|
programs = mkAliasDefinitions options.home.programs;
|
||||||
|
services = mkAliasDefinitions options.home.services;
|
||||||
|
xdg = {
|
||||||
|
enable = true;
|
||||||
|
configFile = mkAliasDefinitions options.home.configFile;
|
||||||
|
dataFile = mkAliasDefinitions options.home.dataFile;
|
||||||
|
};
|
||||||
|
dconf.settings = mkAliasDefinitions options.dconf.settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
sharedModules = [
|
||||||
|
self.inputs.nixvim.homeManagerModules.nixvim
|
||||||
|
self.inputs.plasma-manager.homeManagerModules.plasma-manager
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.${config.user.name} = mkAliasDefinitions options.user;
|
||||||
|
|
||||||
|
environment.extraInit =
|
||||||
|
concatStringsSep "\n"
|
||||||
|
(mapAttrsToList (n: v: "export ${n}=\"${v}\"") config.env);
|
||||||
|
};
|
||||||
|
}
|
@ -1,16 +1,10 @@
|
|||||||
{
|
{ pkgs, lib, config, ... }:
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.podman;
|
cfg = config.modules.podman;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.modules.podman = {
|
options.modules.podman = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
@ -21,6 +15,8 @@ in
|
|||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
|
docker.enable = false;
|
||||||
|
|
||||||
podman = {
|
podman = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultNetwork.settings.dns_enabled = true;
|
defaultNetwork.settings.dns_enabled = true;
|
||||||
@ -38,6 +34,7 @@ in
|
|||||||
runroot = "/run/containers/storage";
|
runroot = "/run/containers/storage";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
oci-containers.backend = "podman";
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.interfaces."podman+" = {
|
networking.firewall.interfaces."podman+" = {
|
22
modules/security/gpg.nix
Normal file
22
modules/security/gpg.nix
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.security.gpg;
|
||||||
|
in {
|
||||||
|
options.modules.security.gpg = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.programs.gpg = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.services.gpg-agent = {
|
||||||
|
enable = true;
|
||||||
|
enableSshSupport = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
18
modules/security/pass.nix
Normal file
18
modules/security/pass.nix
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.security.pass;
|
||||||
|
in {
|
||||||
|
options.modules.security.pass = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.programs.password-store = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -1,15 +1,9 @@
|
|||||||
{
|
{ config, lib, self, ... }:
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.services.borgmatic;
|
cfg = config.modules.services.borgmatic;
|
||||||
hostname = config.networking.hostName;
|
hostname = config.networking.hostName;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.modules.services.borgmatic = {
|
options.modules.services.borgmatic = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
@ -18,7 +12,7 @@ in
|
|||||||
};
|
};
|
||||||
directories = lib.mkOption {
|
directories = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
default = [ ];
|
default = [];
|
||||||
example = [
|
example = [
|
||||||
"/home/jordan/Documents"
|
"/home/jordan/Documents"
|
||||||
];
|
];
|
||||||
@ -33,7 +27,7 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
age.secrets."passwords/services/borg/${hostname}-passphrase" = {
|
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 = {
|
services.borgmatic = {
|
||||||
@ -41,14 +35,9 @@ in
|
|||||||
settings = {
|
settings = {
|
||||||
source_directories = cfg.directories;
|
source_directories = cfg.directories;
|
||||||
repositories = [
|
repositories = [
|
||||||
{
|
{ label = "borgbase"; path = cfg.repoPath; }
|
||||||
label = "borgbase";
|
|
||||||
path = cfg.repoPath;
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
encryption_passcommand = "cat ${
|
encryption_passcommand = "cat ${config.age.secrets."passwords/services/borg/${hostname}-passphrase".path}";
|
||||||
config.age.secrets."passwords/services/borg/${hostname}-passphrase".path
|
|
||||||
}";
|
|
||||||
ssh_command = "ssh -i /etc/ssh/ssh_host_ed25519_key";
|
ssh_command = "ssh -i /etc/ssh/ssh_host_ed25519_key";
|
||||||
keep_daily = 7;
|
keep_daily = 7;
|
||||||
keep_weekly = 4;
|
keep_weekly = 4;
|
||||||
@ -64,8 +53,7 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
# Add `pg_dumpall` to unit environment
|
# Add `pg_dumpall` to unit environment
|
||||||
systemd.services.borgmatic.path =
|
systemd.services.borgmatic.path = [ config.services.postgresql.package ];
|
||||||
if config.services.postgresql.enable then [ config.services.postgresql.package ] else [ ];
|
|
||||||
|
|
||||||
# Without this override, `cat` is unavailable for `encryption_passcommand`
|
# Without this override, `cat` is unavailable for `encryption_passcommand`
|
||||||
systemd.services.borgmatic.confinement.fullUnit = true;
|
systemd.services.borgmatic.confinement.fullUnit = true;
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user