mirror of
https://github.com/zoriya/flake.git
synced 2025-12-05 22:26:21 +00:00
Cleanups
This commit is contained in:
@@ -30,5 +30,5 @@ Format disk with:
|
|||||||
nix-shell -p git go-task
|
nix-shell -p git go-task
|
||||||
git clone https://github.com/zoriya/flake
|
git clone https://github.com/zoriya/flake
|
||||||
cd flake
|
cd flake
|
||||||
sudo task install
|
sudo task install:host
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
user = "greeter";
|
user = "greeter";
|
||||||
};
|
};
|
||||||
initial_session = {
|
initial_session = {
|
||||||
command = ./niri-session.sh; # "${pkgs.niri}/bin/niri-session";
|
command = ./niri-session.sh;
|
||||||
user = user;
|
user = user;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
14
flake.nix
14
flake.nix
@@ -69,20 +69,6 @@
|
|||||||
env = "server";
|
env = "server";
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosConfigurations.kadan = mkSystem "kadan" {
|
|
||||||
env = "server";
|
|
||||||
custom = [
|
|
||||||
({pkgs, ...}: {
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
python3Packages.guessit
|
|
||||||
mediainfo
|
|
||||||
yt-dlp
|
|
||||||
mkvtoolnix-cli
|
|
||||||
];
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosConfigurations.virtual = mkSystem "virtual" {
|
nixosConfigurations.virtual = mkSystem "virtual" {
|
||||||
env = "niri";
|
env = "niri";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,149 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
|
|
||||||
boot.kernelModules = ["kvm-intel" "coretemp" "nct6775"];
|
|
||||||
boot.extraModulePackages = [config.boot.kernelPackages.nvidia_x11];
|
|
||||||
boot.blacklistedKernelModules = ["nouveau"];
|
|
||||||
|
|
||||||
fileSystems."/" = {
|
|
||||||
device = "none";
|
|
||||||
fsType = "tmpfs";
|
|
||||||
options = ["size=2G" "mode=755"];
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/tmp" = {
|
|
||||||
device = "none";
|
|
||||||
fsType = "tmpfs";
|
|
||||||
options = ["size=8G" "mode=755"];
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/nix" = {
|
|
||||||
device = "/dev/disk/by-label/kadan";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
|
||||||
device = "/dev/disk/by-label/boot";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/mnt/a" = {
|
|
||||||
device = "/dev/disk/by-label/a";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
fileSystems."/mnt/b" = {
|
|
||||||
device = "/dev/disk/by-label/b";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
fileSystems."/mnt/c" = {
|
|
||||||
device = "/dev/disk/by-label/c";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
fileSystems."/mnt/parity" = {
|
|
||||||
device = "/dev/disk/by-label/parity";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [
|
|
||||||
{
|
|
||||||
device = "/nix/persist/var/cache/swapfile";
|
|
||||||
size = 4 * 1024;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [mergerfs];
|
|
||||||
fileSystems."/mnt/kyoo" = {
|
|
||||||
device = "/mnt/a:/mnt/b:/mnt/c";
|
|
||||||
depends = ["/mnt/a" "/mnt/b" "/mnt/c"];
|
|
||||||
fsType = "fuse.mergerfs";
|
|
||||||
options = [
|
|
||||||
"func.getattr=newest" # For kyoo's scanner
|
|
||||||
"cache.files=partial" # To enable mmap (used by rtorrent)
|
|
||||||
"dropcacheonclose=true"
|
|
||||||
"category.create=mfs"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.snapraid = {
|
|
||||||
enable = true;
|
|
||||||
exclude = [
|
|
||||||
"*.unrecoverable"
|
|
||||||
"/tmp/"
|
|
||||||
"/lost+found/"
|
|
||||||
];
|
|
||||||
dataDisks = {
|
|
||||||
a = "/mnt/a/";
|
|
||||||
b = "/mnt/b/";
|
|
||||||
c = "/mnt/c/";
|
|
||||||
};
|
|
||||||
contentFiles = [
|
|
||||||
"/var/snapraid.content"
|
|
||||||
"/mnt/a/snapraid.content"
|
|
||||||
"/mnt/b/snapraid.content"
|
|
||||||
"/mnt/c/snapraid.content"
|
|
||||||
];
|
|
||||||
parityFiles = [
|
|
||||||
"/mnt/parity/snapraid.parity"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
|
||||||
#networking.interfaces.eno1.useDHCP = lib.mkDefault true;
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
|
|
||||||
hardware.graphics = {
|
|
||||||
enable = true;
|
|
||||||
enable32Bit = true;
|
|
||||||
extraPackages = with pkgs; [vaapiVdpau];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Load nvidia driver for Xorg and Wayland
|
|
||||||
services.xserver.videoDrivers = ["nvidia"];
|
|
||||||
hardware.nvidia-container-toolkit.enable = true;
|
|
||||||
|
|
||||||
hardware.nvidia = {
|
|
||||||
# Modesetting is required.
|
|
||||||
modesetting.enable = true;
|
|
||||||
|
|
||||||
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
|
||||||
powerManagement.enable = true;
|
|
||||||
# Fine-grained power management. Turns off GPU when not in use.
|
|
||||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
|
||||||
powerManagement.finegrained = false;
|
|
||||||
|
|
||||||
# Use the NVidia open source kernel module (not to be confused with the
|
|
||||||
# independent third-party "nouveau" open source driver).
|
|
||||||
# Support is limited to the Turing and later architectures. Full list of
|
|
||||||
# supported GPUs is at:
|
|
||||||
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
|
|
||||||
# Only available from driver 515.43.04+
|
|
||||||
# Do not disable this unless your GPU is unsupported or if you have a good reason to.
|
|
||||||
open = false;
|
|
||||||
|
|
||||||
# Enable the Nvidia settings menu,
|
|
||||||
# accessible via `nvidia-settings`.
|
|
||||||
nvidiaSettings = true;
|
|
||||||
|
|
||||||
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "23.05";
|
|
||||||
}
|
|
||||||
@@ -21,10 +21,11 @@ tasks:
|
|||||||
|
|
||||||
install:*:
|
install:*:
|
||||||
desc: install to disks labeled `nix` and `boot`
|
desc: install to disks labeled `nix` and `boot`
|
||||||
deps: [password:root, password:zoriya]
|
|
||||||
vars:
|
vars:
|
||||||
HOST: "{{index .MATCH 0}}"
|
HOST: "{{index .MATCH 0}}"
|
||||||
cmds:
|
cmds:
|
||||||
|
- task: password:root
|
||||||
|
- task: password:zoriya
|
||||||
- mkdir -p /mnt/{boot,nix}
|
- mkdir -p /mnt/{boot,nix}
|
||||||
- mount /dev/disk/by-label/boot /mnt/boot
|
- mount /dev/disk/by-label/boot /mnt/boot
|
||||||
- mount /dev/disk/by-label/nix /mnt/nix
|
- mount /dev/disk/by-label/nix /mnt/nix
|
||||||
|
|||||||
Reference in New Issue
Block a user