Compare commits

..

No commits in common. "c1c55085e543feed173ada8b381ef83411d6ca72" and "d0bb91ec083eae460cc5d2eb608f8a39f9aa0786" have entirely different histories.

13 changed files with 230 additions and 263 deletions

34
disko/btrfs-legacy.nix Normal file
View File

@ -0,0 +1,34 @@
{ mainDisk, ... }:
{
disk.main = {
device = mainDisk;
type = "disk";
content = {
type = "gpt";
partitions = {
MBR = {
size = "1M";
type = "EF02";
};
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"@root" = { mountpoint = "/"; };
"@nix" = { mountpoint = "/nix"; };
"@var" = { mountpoint = "/var"; };
"@docker" = { mountpoint = "/var/lib/docker"; };
"@home" = { mountpoint = "/home"; };
"@snapshots" = { mountpoint = "/.snapshots"; };
};
};
};
};
};
};
}

View File

@ -1,36 +0,0 @@
{ ... }:
{
disko.devices = {
disk.main = {
device = "/dev/sda";
type = "disk";
content = {
type = "gpt";
partitions = {
MBR = {
size = "1M";
type = "EF02";
};
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"@root" = { mountpoint = "/"; };
"@nix" = { mountpoint = "/nix"; };
"@var" = { mountpoint = "/var"; };
"@docker" = { mountpoint = "/var/lib/docker"; };
"@home" = { mountpoint = "/home"; };
"@snapshots" = { mountpoint = "/.snapshots"; };
};
};
};
};
};
};
};
}

View File

@ -1,92 +0,0 @@
{...}:
let
disks = [
"/dev/disk/by-id/ata-WDC_WDS120G2G0A-00JH30_184377804456"
"/dev/disk/by-id/ata-KINGSTON_SA400S37120G_50026B7783176055"
];
in
{
disko.devices = {
disk = {
ssd0 = {
type = "disk";
device = builtins.elemAt disks 0;
content = {
type = "gpt";
partitions = {
bios_grub = {
size = "2M";
type = "EF02";
};
pv = {
size = "100%";
content = {
type = "lvm_pv";
vg = "mainpool";
};
};
};
};
};
ssd1 = {
type = "disk";
device = builtins.elemAt disks 1;
content = {
type = "gpt";
partitions = {
pv = {
size = "100%";
content = {
type = "lvm_pv";
vg = "mainpool";
};
};
};
};
};
};
lvm_vg = {
mainpool = {
type = "lvm_vg";
lvs = {
root = {
size = "30G";
lvm_type = "raid0";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [ "noatime" ];
};
};
nix = {
size = "50G";
lvm_type = "raid0";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/nix";
mountOptions = [ "noatime" ];
};
};
games = {
size = "100%FREE";
lvm_type = "raid0";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/games";
mountOptions = [ "noatime" ];
};
};
};
};
};
};
}

View File

@ -1,38 +0,0 @@
{ ... }:
{
disko.devices = {
disk.main = {
device = "/dev/sda";
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
name = "ESP";
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
name = "root";
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
}

36
disko/simple-efi-gpt.nix Normal file
View File

@ -0,0 +1,36 @@
{ mainDisk, ... }:
{
disk.main = {
device = mainDisk;
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
name = "ESP";
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
name = "root";
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
}

View File

@ -14,6 +14,7 @@
# options # options
system = "x86_64-linux"; system = "x86_64-linux";
release = "25.11"; release = "25.11";
mainDisk = "/dev/sda";
myUser = "victor"; myUser = "victor";
# helper # helper
@ -22,22 +23,27 @@
nixosConfigurations = { nixosConfigurations = {
isengard = lib.nixosSystem { isengard = lib.nixosSystem {
inherit system; inherit system;
specialArgs = { inherit release myUser disko; }; specialArgs = { inherit release mainDisk myUser disko; };
modules = [ modules = [
./hosts/isengard.nix ./hosts/isengard.nix
./modules/base.nix ./modules/base.nix
]; ./modules/docker.nix
]
++ lib.optional (builtins.pathExists ./hardware-configuration.nix) ./hardware-configuration.nix;
}; };
palantir = lib.nixosSystem { palantir = lib.nixosSystem {
inherit system; inherit system;
specialArgs = { inherit release myUser disko; }; specialArgs = { inherit release mainDisk myUser disko; };
modules = [ modules = [
./hosts/palantir.nix ./hosts/palantir.nix
./modules/base.nix ./modules/base.nix
./modules/plasma.nix
./modules/gaming.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
./modules/home.nix ./modules/home.nix
]; ]
++ lib.optional (builtins.pathExists ./hardware-configuration.nix) ./hardware-configuration.nix;
}; };
}; };
}; };

View File

@ -1,22 +1,42 @@
{ config, pkgs, myUser, release, disko, ... }: { config, pkgs, myUser, release, disko, mainDisk, ... }:
{ {
# Imports networking.hostName = "isengard";
imports = [
disko.nixosModules.disko ../disko/isengard/btrfs-legacy.nix
../modules/docker.nix imports = [
disko.nixosModules.disko
]; ];
# Disks disko.devices = import ../disko/btrfs-legacy.nix {
inherit mainDisk;
};
boot.loader = { boot.loader = {
grub.enable = true; grub.enable = true;
}; };
# Networking
networking.hostName = "isengard";
networking.useDHCP = true;
time.timeZone = "Europe/Bucharest"; time.timeZone = "Europe/Bucharest";
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
users.users.${myUser} = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOiNyGO4RAxSdxvn2ZIBZ2Ze4iVVMrBNmu/V9JO70PoT victor@battleship"
];
};
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOiNyGO4RAxSdxvn2ZIBZ2Ze4iVVMrBNmu/V9JO70PoT victor@battleship"
];
networking.useDHCP = true;
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
};
system.stateVersion = release; system.stateVersion = release;
} }

View File

@ -1,45 +1,54 @@
{ config, pkgs, myUser, release, disko, ... }: { config, pkgs, myUser, release, disko, mainDisk, ... }:
{ {
# Imports networking.hostName = "palantir";
imports = [
disko.nixosModules.disko ../disko/palantir/lvm.nix
../modules/nvidia.nix imports = [
../modules/plasma.nix disko.nixosModules.disko
../modules/gaming.nix
]; ];
# Disks disko.devices = import ../disko/simple-efi-gpt.nix {
boot.initrd.services.lvm.enable = true; inherit mainDisk;
};
boot.loader = { boot.loader = {
systemd-boot.enable = true; systemd-boot.enable = true;
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
}; };
# Networking
networking.hostName = "palantir";
networking.useDHCP = true;
time.timeZone = "Europe/Vienna"; time.timeZone = "Europe/Vienna";
## Autologin users.users.${myUser} = {
services = { isNormalUser = true;
getty.autologinUser = myUser; extraGroups = [
displayManager.autoLogin = { "wheel"
enable = true; "video"
user = myUser; "render"
}; "input"
];
shell = pkgs.zsh;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOiNyGO4RAxSdxvn2ZIBZ2Ze4iVVMrBNmu/V9JO70PoT victor@battleship"
];
}; };
# Mounts users.users.root.openssh.authorizedKeys.keys = [
#fileSystems."/games" = { "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOiNyGO4RAxSdxvn2ZIBZ2Ze4iVVMrBNmu/V9JO70PoT victor@battleship"
# device = "/dev/disk/by-uuid/90bea801-2b8a-40db-8862-ccc55f2b2262"; ];
# fsType = "ext4";
# options = [ networking.useDHCP = true;
# "nofail" # Prevent system from failing if this drive doesn't mount
# ]; services.openssh = {
#}; enable = true;
settings.PasswordAuthentication = false;
};
fileSystems."/games" = {
device = "/dev/disk/by-uuid/90bea801-2b8a-40db-8862-ccc55f2b2262";
fsType = "ext4";
options = [
"nofail" # Prevent system from failing if this drive doesn't mount
];
};
# Release
system.stateVersion = release; system.stateVersion = release;
} }

View File

@ -1,38 +1,36 @@
{ config, pkgs, lib, myUser, ... }: { config, pkgs, mainDisk, lib, ... }:
let
cfg = config.my.allowUnfree;
in
{ {
nix.settings = { options = {
experimental-features = [ "nix-command" "flakes" ]; my.allowUnfree.names = lib.mkOption {
auto-optimise-store = true; type = lib.types.listOf lib.types.str;
default = [];
description = "Package names allowed by allowUnfreePredicate";
};
}; };
config = {
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
};
programs.zsh.enable = true; programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh; environment.systemPackages = with pkgs; [
environment.systemPackages = with pkgs; [ git
git curl
curl htop
htop tmux
tmux killall
killall neovim
neovim pciutils
progress progress
];
# SSH
users.users.${myUser} = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOiNyGO4RAxSdxvn2ZIBZ2Ze4iVVMrBNmu/V9JO70PoT victor@battleship"
]; ];
};
users.users.root.openssh.authorizedKeys.keys = [ nixpkgs.config.allowUnfreePredicate =
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOiNyGO4RAxSdxvn2ZIBZ2Ze4iVVMrBNmu/V9JO70PoT victor@battleship" pkg: builtins.elem (lib.getName pkg) cfg.names;
];
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
}; };
} }

View File

@ -3,6 +3,11 @@
{ {
users.users.${myUser}.extraGroups = [ "docker" ]; users.users.${myUser}.extraGroups = [ "docker" ];
virtualisation.docker.enable = true; virtualisation.docker = {
virtualisation.docker.storageDriver = "btrfs"; storageDriver = "btrfs";
rootless = {
enable = true;
setSocketVariable = true;
};
};
} }

View File

@ -1,16 +1,42 @@
{ config, pkgs, myUser, release, lib, ... }: { config, pkgs, myUser, release, lib, ... }:
{ {
# Groups for sunshine my.allowUnfree.names = lib.mkAfter [
users.users.${myUser}.extraGroups = [ "steam"
"wheel" "steam-unwrapped"
"video" "cuda-merged"
"render" "cuda_cuobjdump"
"input" "cuda_gdb"
]; "cuda_nvcc"
"cuda_nvdisasm"
"cuda_nvprune"
"cuda_cccl"
"cuda_cudart"
"cuda_cupti"
"cuda_cuxxfilt"
"cuda_nvml_dev"
"cuda_nvrtc"
"cuda_nvtx"
"cuda_profiler_api"
"cuda_sanitizer_api"
"libcublas"
"libcufft"
"libcurand"
"libcusolver"
"libnvjitlink"
"libcusparse"
"libnpp"
"cudnn"
];
nixpkgs.config.cudaSupport = true;
# Sunshine game stream
services = { services = {
getty.autologinUser = "victor";
displayManager.autoLogin = {
enable = true;
user = "victor";
};
sunshine = { sunshine = {
enable = true; enable = true;
autoStart = true; autoStart = true;
@ -28,7 +54,7 @@
enable = true; enable = true;
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
ffmpeg ffmpeg
zeroad zeroad
]; ];

View File

@ -1,13 +0,0 @@
{ config, lib, ... }:
{
nixpkgs.config.allowUnfree = true; # Cuz nvidia drivers and stuff
nixpkgs.config.cudaSupport = true;
hardware.graphics.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
open = false;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
}

View File

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
{ {
services = { services = {
@ -16,6 +16,18 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
librewolf librewolf
pciutils
]; ];
# Nvidia
my.allowUnfree.names = lib.mkAfter [
"nvidia-x11"
"nvidia-settings"
];
hardware.graphics.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
open = false;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
} }