feat: a lot of stuff

This commit is contained in:
Jacob Bachmann 2024-04-16 20:37:08 +02:00
parent 9806ee2a4e
commit bc60f155aa
Signed by: bchmnn
GPG key ID: 732A612DAD28067D
19 changed files with 250 additions and 20 deletions

View file

@ -1,4 +1,4 @@
{ config, lib, ... }: lib.mkIf config.bchmnn.audio.enable {
{ pkgs, config, lib, ... }: lib.mkIf config.bchmnn.audio.enable {
# Enable pipewire - audio
services.pipewire = {
enable = true;
@ -7,5 +7,12 @@
alsa.support32Bit = true;
jack.enable = true;
pulse.enable = true;
wireplumber.enable = true;
};
environment.systemPackages = with pkgs; [
alsa-utils
pulseaudio
];
}

View file

@ -50,6 +50,14 @@
enable = mkEnableOption "games";
};
ai = {
enable = mkEnableOption "ai";
};
ratbag = {
enable = mkEnableOption "ratbag";
};
};
imports = [
@ -69,19 +77,21 @@
./nix-ld.nix
./nix.nix
./nvidia.nix
./ollama.nix
./opengl.nix
./openssh.nix
./openvpn.nix
./power.nix
./packages.nix
./printing.nix
./ratbag.nix
./rr.nix
./security.nix
./shell.nix
./steam.nix
./syncthing.nix
./tts.nix
./udisks2.nix
./unfree.nix
./virtualisation.nix
./xdg-portal.nix
];

View file

@ -34,7 +34,12 @@ in
services.keyd = {
enable = true;
keyboards.default = {
ids = [ "*" "-04fe:0020" ];
ids = [
"*"
"-04fe:0020" # HHKB
"-046d:102a" # Logitech G700s
"-046d:c07c" # Logitech G700s Rechargeable Gaming Mouse
];
settings = {
main = {
leftalt = "layer(meta)";

View file

@ -8,19 +8,25 @@
};
};
nixpkgs.overlays = [
(self: super: {
bun-baseline = (super.callPackage ../overlays/bun-baseline.nix { });
mfcl3750cdwlpr = (super.callPackage ../overlays/mfcl3750cdw.nix { }).driver;
mfcl3750cdwcupswrapper = (super.callPackage ../overlays/mfcl3750cdw.nix { }).cupswrapper;
})
];
# allow EOL version electron for obsidian
# TODO: remove
nixpkgs.config.permittedInsecurePackages = [
"electron-25.9.0"
];
nixpkgs = {
overlays = [
(self: super: {
bun-baseline = (super.callPackage ../overlays/bun-baseline.nix { });
mfcl3750cdwlpr = (super.callPackage ../overlays/mfcl3750cdw.nix { }).driver;
mfcl3750cdwcupswrapper = (super.callPackage ../overlays/mfcl3750cdw.nix { }).cupswrapper;
pppdf = (super.python3Packages.callPackage ../overlays/pppdf { });
})
];
config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
# allow EOL version electron for obsidian
# TODO: remove
permittedInsecurePackages = [
"electron-25.9.0"
];
};
};
system.stateVersion = "23.05";
}

6
modules/ollama.nix Normal file
View file

@ -0,0 +1,6 @@
{ lib, config, ... }: lib.mkIf config.bchmnn.ai.enable {
services.ollama = {
enable = true;
acceleration = if config.bchmnn.nvidia.enable then "cuda" else null;
};
}

View file

@ -2,6 +2,7 @@
environment.systemPackages = with pkgs; with config.bchmnn; [
pciutils # a collection of programs for inspecting and manipulating configuration of pci devices
usbutils # tools for working with usb devices, such as lsusb
lshw # provide detailed information on the hardware configuration of the machine
git # distributed version control system
gnumake # a tool to control the generation of non-source files from sources
mercurial # a fast, lightweight scm system for very large distributed projects

3
modules/ratbag.nix Normal file
View file

@ -0,0 +1,3 @@
{
services.ratbagd.enable = true;
}

View file

@ -6,7 +6,6 @@
virtualisation = {
oci-containers = {
backend = "podman";
containers = {
flare-solvarr = {
image = "ghcr.io/flaresolverr/flaresolverr:latest";

17
modules/tts.nix Normal file
View file

@ -0,0 +1,17 @@
{ lib, config, ... }: lib.mkIf config.bchmnn.ai.enable {
virtualisation = {
oci-containers = {
containers = {
coqui-ai-tts = {
image = "ghcr.io/coqui-ai/tts:latest";
autoStart = true;
ports = ["127.0.0.1:5002:5002"];
entrypoint = "/bin/bash";
cmd = [];
};
};
};
};
}

View file

@ -1,3 +0,0 @@
{ ... }: {
nixpkgs.config.allowUnfree = true;
}

View file

@ -10,11 +10,20 @@
# required for containers under podman-compose to be able to talk to each other.
defaultNetwork.settings.dns_enabled = true;
};
oci-containers = {
backend = "podman";
};
containers = {
enable = true;
cdi.dynamic.nvidia.enable = config.bchmnn.nvidia.enable;
};
};
programs = {
dconf.enable = true;
virt-manager.enable = true;
};
environment.systemPackages = with pkgs; [ virtiofsd ];
}