Add back vfio, remove postgres
This commit is contained in:
parent
cae59cf989
commit
9bda4ce478
18
flake.lock
18
flake.lock
|
@ -23,11 +23,11 @@
|
|||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1650522846,
|
||||
"narHash": "sha256-SxWHXRI3qJwswyXAtzsi6PKVY3KLNNnb072KaJthII8=",
|
||||
"lastModified": 1653463224,
|
||||
"narHash": "sha256-bUxKhqZhki2vPzFTl8HOo1m7pagF7WzY1MZiso8U5ws=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "6b4ebea9093c997c5f275c820e679108de4871ab",
|
||||
"rev": "39a7bfc496d2ddfce73fe9542af1f2029ba4fe39",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -38,11 +38,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1652020977,
|
||||
"narHash": "sha256-9hDlNbrxzD/pLlXmoQ6gzxbYiSAKrj7uHYUWNByLFlI=",
|
||||
"lastModified": 1653565689,
|
||||
"narHash": "sha256-xdJ6bmPxDPIMItZJWsDxopPXUTAFPWMkNkyOOcptWSc=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "3c5ae9be1f18c790ea890ef8decbd0946c0b4c04",
|
||||
"rev": "9bc0e974545d5bc4c24e1ed047be0dc4e30e494b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -54,11 +54,11 @@
|
|||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1652082323,
|
||||
"narHash": "sha256-7GSVLvfCJtH9dJ3om9Lg4fsi9UKvoxxR69gUTcx0ol8=",
|
||||
"lastModified": 1653581809,
|
||||
"narHash": "sha256-Uvka0V5MTGbeOfWte25+tfRL3moECDh1VwokWSZUdoY=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "2a3aac479caeba0a65b2ad755fe5f284f1fde74d",
|
||||
"rev": "83658b28fe638a170a19b8933aa008b30640fbd1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
./boot-config.nix
|
||||
./hardware-configuration.nix
|
||||
./scripts.nix
|
||||
./postgres.nix
|
||||
./vfio.nix
|
||||
../../sets/builder.nix
|
||||
../../sets/fpga.nix
|
||||
../../sets/hacking.nix
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
package = pkgs.postgresql_14;
|
||||
extraPlugins = with config.services.postgresql.package.pkgs; [ postgis ];
|
||||
|
||||
ensureDatabases = [ "osm" ];
|
||||
ensureUsers = [{
|
||||
name = "artemis";
|
||||
ensurePermissions = {
|
||||
"DATABASE osm" = "ALL PRIVILEGES";
|
||||
};
|
||||
}];
|
||||
};
|
||||
}
|
34
system/starlight/vfio.nix
Normal file
34
system/starlight/vfio.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ pkgs, pkgs-unstable, ... }:
|
||||
|
||||
# based on https://alexbakker.me/post/nixos-pci-passthrough-qemu-vfio.html
|
||||
{
|
||||
environment.systemPackages = [
|
||||
pkgs-unstable.looking-glass-client
|
||||
pkgs.scream
|
||||
];
|
||||
|
||||
boot.initrd = {
|
||||
availableKernelModules = [ "amdgpu" "vfio-pci" ];
|
||||
preDeviceCommands = ''
|
||||
echo vfio-pci > /sys/bus/pci/devices/0000:0b:00.0/driver_override
|
||||
echo vfio-pci > /sys/bus/pci/devices/0000:0b:00.1/driver_override
|
||||
modprobe -i vfio-pci
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"f /dev/shm/scream 0660 artemis qemu-libvirtd -"
|
||||
"f /dev/shm/looking-glass 0660 artemis qemu-libvirtd -"
|
||||
];
|
||||
|
||||
systemd.user.services.scream-ivshmem = {
|
||||
enable = true;
|
||||
description = "Scream IVSHMEM";
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.scream}/bin/scream -m /dev/shm/scream -o pulse";
|
||||
Restart = "always";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
requires = [ "pulseaudio.service" ];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue