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

This commit is contained in:
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 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 ]; hosts.nixos-desktop.modules = [ ./hosts/nixos-desktop ./modules/gaming ];
}; };
} }

View file

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

View file

@ -4,60 +4,53 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[
(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.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{
device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154"; device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=root" ]; 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" = fileSystems."/log" = {
{
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" =
{
device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154"; device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=log" ]; options = [ "subvol=log" ];
neededForBoot = true; 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"; device = "/dev/disk/by-uuid/938D-F813";
fsType = "vfat"; 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 = swapDevices =
[{ device = "/dev/disk/by-uuid/29ebf65f-e6ca-4625-9f72-a9321152be1b"; }]; [{ 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, ... }: { lib, pkgs, ... }:
{ {
imports = [ ./apps ./cli ./desktop ./services ./security.nix ]; imports = [ ./apps ./cli ./desktop ./services ];
# USERS # USERS
users.users.moritz = { users.users.moritz = {
@ -32,6 +32,11 @@
home.username = "moritz"; home.username = "moritz";
home.homeDirectory = "/home/moritz"; home.homeDirectory = "/home/moritz";
xdg.userDirs = {
enable = true;
createDirectories = true;
};
home.stateVersion = "21.05"; home.stateVersion = "21.05";
}; };
} }

View file

@ -6,8 +6,6 @@
enable = true; enable = true;
layout = "de"; layout = "de";
videoDrivers = [ "nvidia" ];
displayManager = { displayManager = {
defaultSession = "none+bspwm"; defaultSession = "none+bspwm";
@ -15,9 +13,7 @@
enable = true; enable = true;
user = "moritz"; user = "moritz";
}; };
lightdm = { lightdm = { enable = true; };
enable = true;
};
}; };
windowManager.bspwm.enable = true; windowManager.bspwm.enable = true;
}; };
@ -39,16 +35,9 @@
source = ./sxhkdrc; source = ./sxhkdrc;
onChange = "pkill -USR1 -x sxhkd"; onChange = "pkill -USR1 -x sxhkd";
}; };
"wallpaper/dracula.png" = { "wallpaper/dracula.png" = { source = ./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 = { services.davfs2 = {
enable = true; enable = true;
extraConfig = '' extraConfig = ''
buf_size 32
use_compression 1
table_size 4096
[/auto/diskstation] [/auto/diskstation]
trust_server_cert diskstation.pem trust_server_cert diskstation.pem
[/auto/media]
trust_server_cert diskstation.pem
[/auto/keepass] [/auto/keepass]
trust_server_cert home-boehmies-de.pem trust_server_cert home-boehmies-de.pem
''; '';
@ -16,6 +21,7 @@
mapConf = pkgs.writeText "auto" '' mapConf = pkgs.writeText "auto" ''
keepass -fstype=davfs,uid=1000 :https\://davs.home.boehmies.de/home/Drive/ 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/ 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 '' in ''
/auto file:${mapConf} /auto file:${mapConf}
@ -34,7 +40,18 @@
enable = true; enable = true;
pairs = { pairs = {
keepass.roots = [ "/home/moritz/Keepass" "/auto/keepass" ]; 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.