meta: reorganize nix-os and hosts to single directory nixos
This commit is contained in:
parent
be46e02c61
commit
cb05ce5b44
76 changed files with 54 additions and 52 deletions
57
nixos/hosts/main/cryptocurrency.nix
Normal file
57
nixos/hosts/main/cryptocurrency.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
"${inputs.nix-bitcoin}/modules/modules.nix"
|
||||
];
|
||||
|
||||
config = {
|
||||
|
||||
services.bitcoind = {
|
||||
enable = true;
|
||||
listen = true;
|
||||
txindex = true;
|
||||
disablewallet = true;
|
||||
extraConfig = ''
|
||||
coinstatsindex=1
|
||||
maxmempool=2048
|
||||
persistmempool=1
|
||||
'';
|
||||
tor.proxy = true;
|
||||
rpc.address = "0.0.0.0";
|
||||
rpc.allowip = [
|
||||
"10.0.0.0/8"
|
||||
"172.16.0.0/12"
|
||||
"192.168.0.0/16"
|
||||
];
|
||||
};
|
||||
|
||||
services.electrs = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.monero = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
proxy=127.0.0.1:9050
|
||||
igd=disabled
|
||||
'';
|
||||
};
|
||||
|
||||
services.tor.client.enable = true;
|
||||
|
||||
nix-bitcoin = {
|
||||
onionServices = {
|
||||
bitcoind = {
|
||||
public = true;
|
||||
};
|
||||
};
|
||||
generateSecrets = true;
|
||||
secretsDir = "/var/nix-bitcoin";
|
||||
configVersion = "0.0.121";
|
||||
};
|
||||
};
|
||||
}
|
98
nixos/hosts/main/default.nix
Normal file
98
nixos/hosts/main/default.nix
Normal file
|
@ -0,0 +1,98 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../modules/core.nix
|
||||
../../modules/core-desktop.nix
|
||||
../../modules/nvidia.nix
|
||||
../../modules/docker.nix
|
||||
../../modules/razer.nix
|
||||
../../modules/desktopManagers/cosmic.nix
|
||||
../../modules/displayManagers/cosmic-greeter.nix
|
||||
../../modules/shell.nix
|
||||
../../modules/virtualization.nix
|
||||
../../modules/polkit/disable-shutdown.nix
|
||||
../../modules/locale.nix
|
||||
../../modules/adb.nix
|
||||
../../modules/account.nix
|
||||
../../modules/services/nix-binary-cache.nix
|
||||
../../modules/udev.nix
|
||||
../../modules/gnupg.nix
|
||||
|
||||
"${inputs.nixos-vscode-server}"
|
||||
|
||||
./cryptocurrency.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
networking.hostName = "wroclaw-main";
|
||||
|
||||
services.printing.drivers = with pkgs; [
|
||||
hplip
|
||||
];
|
||||
|
||||
nixpkgs.overlays = [
|
||||
self.overlays.cosmicPackages
|
||||
];
|
||||
nixpkgs.config = {
|
||||
cudaSupport = true;
|
||||
};
|
||||
|
||||
# nixos-vscode-server module needs this
|
||||
programs.nix-ld.enable = true;
|
||||
services.vscode-server = {
|
||||
enable = true;
|
||||
extraRuntimeDependencies = with pkgs; [
|
||||
docker
|
||||
];
|
||||
};
|
||||
|
||||
services.pipewire.wireplumber.configPackages = [(
|
||||
pkgs.stdenvNoCC.mkDerivation {
|
||||
name = "wireplumber-config";
|
||||
src = ./wireplumber;
|
||||
phases = [ "installPhase" ];
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/wireplumber/wireplumber.conf.d
|
||||
cp -r $src/* $out/share/wireplumber/wireplumber.conf.d
|
||||
'';
|
||||
}
|
||||
)];
|
||||
|
||||
services.printing.startWhenNeeded = false;
|
||||
|
||||
# rgb control for razer, graphics card and motherboard
|
||||
hardware.i2c.enable = true;
|
||||
services.hardware.openrgb.enable = true;
|
||||
|
||||
services.ollama = {
|
||||
enable = true;
|
||||
port = 1434;
|
||||
acceleration = "cuda";
|
||||
package = pkgs.unstable.ollama;
|
||||
host = "0.0.0.0";
|
||||
};
|
||||
|
||||
services.mysql = {
|
||||
enable = true;
|
||||
package = pkgs.mariadb;
|
||||
};
|
||||
|
||||
environment.sessionVariables = {
|
||||
OLLAMA_HOST = "127.0.0.1:${builtins.toString config.services.ollama.port}";
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
};
|
||||
}
|
10
nixos/hosts/main/wireplumber/51-digital-output.conf
Normal file
10
nixos/hosts/main/wireplumber/51-digital-output.conf
Normal file
|
@ -0,0 +1,10 @@
|
|||
monitor.alsa.rules = [{
|
||||
matches = [{
|
||||
node.name = "alsa_output.pci-0000_00_1f.3.iec958-stereo"
|
||||
}]
|
||||
actions = {
|
||||
update-props = {
|
||||
node.description = "Digital Output"
|
||||
}
|
||||
}
|
||||
}]
|
10
nixos/hosts/main/wireplumber/51-hdmi-otuput.conf
Normal file
10
nixos/hosts/main/wireplumber/51-hdmi-otuput.conf
Normal file
|
@ -0,0 +1,10 @@
|
|||
monitor.alsa.rules = [{
|
||||
matches = [{
|
||||
node.name = "alsa_output.pci-0000_01_00.1.hdmi-stereo"
|
||||
}]
|
||||
actions = {
|
||||
update-props = {
|
||||
node.description = "Monitor speakers"
|
||||
}
|
||||
}
|
||||
}]
|
11
nixos/hosts/main/wireplumber/51-razerHeadphones-device.conf
Normal file
11
nixos/hosts/main/wireplumber/51-razerHeadphones-device.conf
Normal file
|
@ -0,0 +1,11 @@
|
|||
monitor.alsa.rules = [{
|
||||
matches = [{
|
||||
device.name = "alsa_card.usb-Razer_Razer_USB_Audio_Controller_000000000000000000000000-00"
|
||||
}]
|
||||
actions = {
|
||||
update-props = {
|
||||
device.description = "Headphones"
|
||||
device.profile = "Pro Audio"
|
||||
}
|
||||
}
|
||||
}]
|
10
nixos/hosts/main/wireplumber/51-razerHeadphones-input.conf
Normal file
10
nixos/hosts/main/wireplumber/51-razerHeadphones-input.conf
Normal file
|
@ -0,0 +1,10 @@
|
|||
monitor.alsa.rules = [{
|
||||
matches = [{
|
||||
node.name = "alsa_input.usb-Razer_Razer_USB_Audio_Controller_000000000000000000000000-00.pro-input-0"
|
||||
}]
|
||||
actions = {
|
||||
update-props = {
|
||||
node.description = "Headphones"
|
||||
}
|
||||
}
|
||||
}]
|
22
nixos/hosts/main/wireplumber/51-razerHeadphones-output.conf
Normal file
22
nixos/hosts/main/wireplumber/51-razerHeadphones-output.conf
Normal file
|
@ -0,0 +1,22 @@
|
|||
monitor.alsa.rules = [
|
||||
{
|
||||
matches = [{
|
||||
node.name = "alsa_output.usb-Razer_Razer_USB_Audio_Controller_000000000000000000000000-00.pro-output-0"
|
||||
}]
|
||||
actions = {
|
||||
update-props = {
|
||||
node.description = "Headphones (Chat)"
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
matches = [{
|
||||
node.name = "alsa_output.usb-Razer_Razer_USB_Audio_Controller_000000000000000000000000-00.pro-output-1"
|
||||
}]
|
||||
actions = {
|
||||
update-props = {
|
||||
node.description = "Headphones (Game)"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
60
nixos/hosts/tablet.nix
Normal file
60
nixos/hosts/tablet.nix
Normal file
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
self,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../modules/core.nix
|
||||
../modules/core-desktop.nix
|
||||
../modules/account.nix
|
||||
../modules/adb.nix
|
||||
../modules/locale.nix
|
||||
../modules/shell.nix
|
||||
../modules/gnupg.nix
|
||||
../modules/polkit/network.nix
|
||||
|
||||
../modules/desktopManagers/cosmic.nix
|
||||
../modules/displayManagers/cosmic-greeter.nix
|
||||
../modules/udev.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
networking.hostName = "wroclaw-hp";
|
||||
networking.networkmanager.enable = true;
|
||||
networking.firewall.enable = true;
|
||||
hardware.sensor.iio.enable = true;
|
||||
|
||||
nixpkgs.overlays = [
|
||||
self.overlays.cosmicPackages
|
||||
];
|
||||
|
||||
networking.firewall.allowedTCPPortRanges = [
|
||||
# KDE Connect
|
||||
rec { from = 1714; to = from + 50; }
|
||||
];
|
||||
|
||||
networking.firewall.allowedUDPPortRanges = [
|
||||
# KDE Connect
|
||||
rec { from = 1714; to = from + 50; }
|
||||
];
|
||||
|
||||
services.logind = {
|
||||
powerKey = "suspend";
|
||||
powerKeyLongPress = "poweroff";
|
||||
suspendKey = "suspend-then-hibernate";
|
||||
suspendKeyLongPress = "hibernate";
|
||||
lidSwitch = "lock";
|
||||
lidSwitchDocked = "ignore";
|
||||
lidSwitchExternalPower = "lock";
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
};
|
||||
}
|
||||
|
25
nixos/hosts/vm-base.nix
Normal file
25
nixos/hosts/vm-base.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ lib, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
"${modulesPath}/virtualisation/qemu-vm.nix"
|
||||
../modules/account.nix
|
||||
../modules/core.nix
|
||||
../modules/core-desktop.nix
|
||||
../modules/locale.nix
|
||||
../modules/polkit/disable-shutdown.nix
|
||||
../modules/shell.nix
|
||||
../modules/udev.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
services.syncthing.enable = lib.mkForce false;
|
||||
virtualisation = {
|
||||
memorySize = 4096;
|
||||
};
|
||||
virtualisation.forwardPorts = [
|
||||
{ from = "host"; host.port = 2222; guest.port = 22; }
|
||||
];
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
};
|
||||
}
|
17
nixos/hosts/vm-cosmic.nix
Normal file
17
nixos/hosts/vm-cosmic.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./vm-base.nix
|
||||
../modules/desktopManagers/cosmic.nix
|
||||
../modules/displayManagers/cosmic-greeter.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
nixpkgs.overlays = [(import ../pkgs/overlays/cosmic-packages.nix { inherit inputs; })];
|
||||
nix.settings = {
|
||||
substituters = [ "https://cosmic.cachix.org/" ];
|
||||
trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ];
|
||||
};
|
||||
};
|
||||
}
|
9
nixos/hosts/vm-gnome.nix
Normal file
9
nixos/hosts/vm-gnome.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./vm-base.nix
|
||||
../modules/desktopManagers/gnome.nix
|
||||
../modules/displayManagers/gdm.nix
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue