Merge branch 'nixos' of github.com:MoritzBoehme/dotfiles into nixos

dev-docs
Moritz Böhme 2021-10-03 16:35:21 +02:00
commit ba1e81f5b3
10 changed files with 150 additions and 66 deletions

View File

@ -66,7 +66,8 @@
agenix.nixosModules.age
];
hosts.nixos-laptop.modules = [ ./hosts/nixos-laptop ];
hosts.nixos-laptop.modules =
[ ./hosts/nixos-laptop ./modules/containers ];
hosts.nixos-desktop.modules = [ ./hosts/nixos-desktop ./modules/gaming ];
};
}

View File

@ -5,8 +5,7 @@
{ config, pkgs, ... }:
{
imports =
[
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
];
@ -36,6 +35,8 @@
interfaces.enp42s0.useDHCP = true;
};
services.xserver.videoDrivers = [ "nvidia" ];
# Powersaving
services.tlp.enable = true;
powerManagement.enable = true;

View File

@ -4,60 +4,53 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
fileSystems."/" = {
device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154";
fsType = "btrfs";
options = [ "subvol=root" ];
};
boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/078b81ba-238e-471d-9951-b743588532b8";
boot.initrd.luks.devices."enc".device =
"/dev/disk/by-uuid/078b81ba-238e-471d-9951-b743588532b8";
fileSystems."/home" =
{
device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154";
fsType = "btrfs";
options = [ "subvol=home" ];
};
fileSystems."/nix" =
{
device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/persist" =
{
device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154";
fsType = "btrfs";
options = [ "subvol=persist" ];
};
fileSystems."/log" =
{
fileSystems."/log" = {
device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154";
fsType = "btrfs";
options = [ "subvol=log" ];
neededForBoot = true;
};
fileSystems."/boot" =
{
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/938D-F813";
fsType = "vfat";
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154";
fsType = "btrfs";
options = [ "subvol=persist" ];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154";
fsType = "btrfs";
options = [ "subvol=home" ];
};
swapDevices =
[{ device = "/dev/disk/by-uuid/29ebf65f-e6ca-4625-9f72-a9321152be1b"; }];

View File

@ -0,0 +1,6 @@
{ config, lib, pkgs, ... }:
{
imports = [ ./media.nix ];
virtualisation.docker.enable = true;
}

View File

@ -0,0 +1,72 @@
{ config, lib, pkgs, ... }:
{
virtualisation.oci-containers.containers = {
"transmission" = {
image = "haugene/transmission-openvpn";
environmentFiles = [ /run/secrets/nordvpn ];
environment = {
"LOCAL_NETWORK" = "192.168.0.0/24";
"OPENVPN_PROVIDER" = "NORDVPN";
"TRANSMISSION_ALT_SPEED_DOWN" = "20000";
"TRANSMISSION_ALT_SPEED_TIME_ENABLED" = "true";
"TRANSMISSION_ALT_SPEED_UP" = "2000";
"TRANSMISSION_MAX_PEERS_GLOBAL" = "1000";
"TRANSMISSION_PEER_LIMIT_GLOBAL" = "1000";
"TRANSMISSION_PEER_LIMIT_PER_TORRENT" = "100";
"TRANSMISSION_RATIO_LIMIT" = "10";
"TRANSMISSION_RATIO_LIMIT_ENABLED" = "true";
"TZ" = "DE";
"ENABLE_UFW" = "true";
"PUID" = "1000";
"PGID" = "100";
};
ports = [ "9091:9091" ];
volumes = [ "/home/moritz/Docker/Transmission:/data/" ];
extraOptions = [ "--cap-add=NET_ADMIN" ];
};
"jackett" = {
image = "linuxserver/jackett";
environment = {
"PUID" = "1000";
"PGID" = "100";
"TZ" = "DE";
};
volumes = [
"/home/moritz/Docker/jackett/config:/config"
"/home/moritz/Docker/jackett/blackhole:/downloads"
];
ports = [ "9117:9117" ];
};
"radarr" = {
image = "linuxserver/radarr";
environment = {
"PUID" = "1000";
"PGID" = "100";
"TZ" = "DE";
};
volumes = [
"/auto/media/movies:/movies"
"/home/moritz/Docker/transmission/completed/movies:/downloads"
"/home/moritz/Docker/radarr"
];
ports = [ "7878:7878" ];
};
"sonarr" = {
image = "linuxserver/sonarr";
environment = {
"PUID" = "1000";
"PGID" = "100";
"TZ" = "DE";
};
volumes = [
"/auto/media/tv:/tv"
"/home/moritz/Docker/transmission/completed/movies:/downloads"
"/home/moritz/Docker/sonarr"
];
ports = [ "8989:8989" ];
};
};
}

View File

@ -1,7 +1,7 @@
{ lib, pkgs, ... }:
{
imports = [ ./apps ./cli ./desktop ./services ./security.nix ];
imports = [ ./apps ./cli ./desktop ./services ];
# USERS
users.users.moritz = {
@ -32,6 +32,11 @@
home.username = "moritz";
home.homeDirectory = "/home/moritz";
xdg.userDirs = {
enable = true;
createDirectories = true;
};
home.stateVersion = "21.05";
};
}

View File

@ -6,8 +6,6 @@
enable = true;
layout = "de";
videoDrivers = [ "nvidia" ];
displayManager = {
defaultSession = "none+bspwm";
@ -15,9 +13,7 @@
enable = true;
user = "moritz";
};
lightdm = {
enable = true;
};
lightdm = { enable = true; };
};
windowManager.bspwm.enable = true;
};
@ -39,16 +35,9 @@
source = ./sxhkdrc;
onChange = "pkill -USR1 -x sxhkd";
};
"wallpaper/dracula.png" = {
source = ./dracula.png;
"wallpaper/dracula.png" = { source = ./dracula.png; };
};
};
};
home.packages = with pkgs; [
feh
playerctl
pamixer
brightnessctl
];
home.packages = with pkgs; [ feh playerctl pamixer brightnessctl ];
};
}

View File

@ -4,8 +4,13 @@
services.davfs2 = {
enable = true;
extraConfig = ''
buf_size 32
use_compression 1
table_size 4096
[/auto/diskstation]
trust_server_cert diskstation.pem
[/auto/media]
trust_server_cert diskstation.pem
[/auto/keepass]
trust_server_cert home-boehmies-de.pem
'';
@ -16,6 +21,7 @@
mapConf = pkgs.writeText "auto" ''
keepass -fstype=davfs,uid=1000 :https\://davs.home.boehmies.de/home/Drive/
diskstation -fstype=davfs,uid=1000 :https\://192.168.0.2\:5006/home/Drive/
media -fstype=davfs,uid=1000 :https\://192.168.0.2\:5006/media
'';
in ''
/auto file:${mapConf}
@ -34,7 +40,18 @@
enable = true;
pairs = {
keepass.roots = [ "/home/moritz/Keepass" "/auto/keepass" ];
diskstation.roots = [ "/home/moritz/Documents" "/auto/diskstation" ];
diskstation = {
roots = [ "/home/moritz/Documents" "/auto/diskstation" ];
commandOptions = {
auto = "true";
batch = "true";
log = "false";
repeat = "watch";
sshcmd = "\${pkgs.openssh}/bin/ssh";
ui = "text";
fastcheck = "true";
};
};
};
};
};

Binary file not shown.

Binary file not shown.