mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2026-09-20 00:59:04 +05:30
style: format code
This commit is contained in:
@@ -1,141 +1,139 @@
|
||||
{ config, ... }: {
|
||||
flake.modules.nixos.canopus =
|
||||
{
|
||||
pkgs,
|
||||
hostName,
|
||||
userName,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = with config.flake.modules.nixos; [
|
||||
boot
|
||||
networking
|
||||
desktop
|
||||
gaming
|
||||
virtualisation
|
||||
];
|
||||
{config, ...}: {
|
||||
flake.modules.nixos.canopus = {
|
||||
pkgs,
|
||||
hostName,
|
||||
userName,
|
||||
...
|
||||
}: {
|
||||
imports = with config.flake.modules.nixos; [
|
||||
boot
|
||||
networking
|
||||
desktop
|
||||
gaming
|
||||
virtualisation
|
||||
];
|
||||
|
||||
tnix = {
|
||||
boot = {
|
||||
secure-boot.enable = true;
|
||||
tnix = {
|
||||
boot = {
|
||||
secure-boot.enable = true;
|
||||
|
||||
impermanence = {
|
||||
enable = true;
|
||||
impermanence = {
|
||||
enable = true;
|
||||
|
||||
home = {
|
||||
directories = [
|
||||
"Distrobox"
|
||||
".steam"
|
||||
".bun"
|
||||
".rustup"
|
||||
".cache/awww"
|
||||
".config/BraveSoftware"
|
||||
".config/zed"
|
||||
".config/Vencord"
|
||||
".config/vesktop"
|
||||
".config/sops"
|
||||
".config/obs-studio"
|
||||
".config/easyeffects"
|
||||
".config/DankMaterialShell"
|
||||
".local/share/Steam"
|
||||
".local/share/lutris"
|
||||
".local/share/net.lutris.Lutris"
|
||||
".local/share/nvim"
|
||||
".local/share/opencode"
|
||||
".local/share/zsh"
|
||||
".local/share/zoxide"
|
||||
".local/share/voxtype"
|
||||
".local/state/lazygit"
|
||||
".local/share/vicinae"
|
||||
".local/share/TelegramDesktop"
|
||||
".local/share/GalaxyBudsClient"
|
||||
".local/state/serpantinum"
|
||||
".local/share/zed"
|
||||
];
|
||||
home = {
|
||||
directories = [
|
||||
"Distrobox"
|
||||
".steam"
|
||||
".bun"
|
||||
".rustup"
|
||||
".cache/awww"
|
||||
".config/BraveSoftware"
|
||||
".config/zed"
|
||||
".config/Vencord"
|
||||
".config/vesktop"
|
||||
".config/sops"
|
||||
".config/obs-studio"
|
||||
".config/easyeffects"
|
||||
".config/DankMaterialShell"
|
||||
".local/share/Steam"
|
||||
".local/share/lutris"
|
||||
".local/share/net.lutris.Lutris"
|
||||
".local/share/nvim"
|
||||
".local/share/opencode"
|
||||
".local/share/zsh"
|
||||
".local/share/zoxide"
|
||||
".local/share/voxtype"
|
||||
".local/state/lazygit"
|
||||
".local/share/vicinae"
|
||||
".local/share/TelegramDesktop"
|
||||
".local/share/GalaxyBudsClient"
|
||||
".local/state/serpantinum"
|
||||
".local/share/zed"
|
||||
];
|
||||
|
||||
files = [
|
||||
".wakatime.cfg"
|
||||
];
|
||||
};
|
||||
files = [
|
||||
".wakatime.cfg"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
networking = {
|
||||
openssh.enable = true;
|
||||
netbird-client.enable = true;
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
docker.enable = true;
|
||||
docker.nvidia.enable = false;
|
||||
qemu.enable = true;
|
||||
waydroid.enable = true;
|
||||
distrobox.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
sops.secrets = {
|
||||
tux-password = {
|
||||
sopsFile = ./secrets.yaml;
|
||||
neededForUsers = true;
|
||||
};
|
||||
|
||||
gemini-api-key = {
|
||||
sopsFile = ./secrets.yaml;
|
||||
owner = userName;
|
||||
};
|
||||
|
||||
openrouter-api-key = {
|
||||
sopsFile = ./secrets.yaml;
|
||||
owner = userName;
|
||||
};
|
||||
|
||||
opencode-go-api-key = {
|
||||
sopsFile = ./secrets.yaml;
|
||||
owner = userName;
|
||||
};
|
||||
|
||||
netbird-key = {
|
||||
sopsFile = ./secrets.yaml;
|
||||
owner = userName;
|
||||
};
|
||||
|
||||
vicinae-json = {
|
||||
sopsFile = ./secrets.yaml;
|
||||
owner = userName;
|
||||
};
|
||||
};
|
||||
|
||||
# --- Networking ---
|
||||
networking = {
|
||||
hostName = hostName;
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
wifi.backend = "iwd";
|
||||
};
|
||||
wireless.iwd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
Network = {
|
||||
EnableIPv6 = true;
|
||||
};
|
||||
Settings = {
|
||||
AutoConnect = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
firewall.enable = false;
|
||||
openssh.enable = true;
|
||||
netbird-client.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
davinci-resolve
|
||||
telegram-desktop
|
||||
galaxy-buds-client
|
||||
impala
|
||||
];
|
||||
|
||||
# !!! DO NOT CHANGE THIS !!!
|
||||
# This should match the version used at initial install.
|
||||
system.stateVersion = "26.05";
|
||||
virtualisation = {
|
||||
docker.enable = true;
|
||||
docker.nvidia.enable = false;
|
||||
qemu.enable = true;
|
||||
waydroid.enable = true;
|
||||
distrobox.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
sops.secrets = {
|
||||
tux-password = {
|
||||
sopsFile = ./secrets.yaml;
|
||||
neededForUsers = true;
|
||||
};
|
||||
|
||||
gemini-api-key = {
|
||||
sopsFile = ./secrets.yaml;
|
||||
owner = userName;
|
||||
};
|
||||
|
||||
openrouter-api-key = {
|
||||
sopsFile = ./secrets.yaml;
|
||||
owner = userName;
|
||||
};
|
||||
|
||||
opencode-go-api-key = {
|
||||
sopsFile = ./secrets.yaml;
|
||||
owner = userName;
|
||||
};
|
||||
|
||||
netbird-key = {
|
||||
sopsFile = ./secrets.yaml;
|
||||
owner = userName;
|
||||
};
|
||||
|
||||
vicinae-json = {
|
||||
sopsFile = ./secrets.yaml;
|
||||
owner = userName;
|
||||
};
|
||||
};
|
||||
|
||||
# --- Networking ---
|
||||
networking = {
|
||||
hostName = hostName;
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
wifi.backend = "iwd";
|
||||
};
|
||||
wireless.iwd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
Network = {
|
||||
EnableIPv6 = true;
|
||||
};
|
||||
Settings = {
|
||||
AutoConnect = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
davinci-resolve
|
||||
telegram-desktop
|
||||
galaxy-buds-client
|
||||
impala
|
||||
];
|
||||
|
||||
# !!! DO NOT CHANGE THIS !!!
|
||||
# This should match the version used at initial install.
|
||||
system.stateVersion = "26.05";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,49 +1,50 @@
|
||||
{ inputs, ... }:
|
||||
{
|
||||
flake.modules.nixos.canopus =
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
hasOptinPersistence = config.tnix.boot.impermanence.enable;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.disko.nixosModules.disko
|
||||
];
|
||||
{inputs, ...}: {
|
||||
flake.modules.nixos.canopus = {
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
hasOptinPersistence = config.tnix.boot.impermanence.enable;
|
||||
in {
|
||||
imports = [
|
||||
inputs.disko.nixosModules.disko
|
||||
];
|
||||
|
||||
disko.devices.disk.primary = {
|
||||
device = "/dev/nvme0n1";
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
size = "1G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"umask=0077"
|
||||
];
|
||||
};
|
||||
disko.devices.disk.primary = {
|
||||
device = "/dev/nvme0n1";
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
size = "1G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"umask=0077"
|
||||
];
|
||||
};
|
||||
swap = {
|
||||
size = "32G";
|
||||
content = {
|
||||
type = "swap";
|
||||
discardPolicy = "both";
|
||||
resumeDevice = true;
|
||||
};
|
||||
};
|
||||
swap = {
|
||||
size = "32G";
|
||||
content = {
|
||||
type = "swap";
|
||||
discardPolicy = "both";
|
||||
resumeDevice = true;
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
type = "8300";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
# Base subvolumes that always exist
|
||||
subvolumes = {
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
type = "8300";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
# Base subvolumes that always exist
|
||||
subvolumes =
|
||||
{
|
||||
"/root" = {
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
@@ -73,10 +74,10 @@
|
||||
mountpoint = "/persist";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,150 +1,150 @@
|
||||
{ inputs, config, ... }:
|
||||
{
|
||||
flake.modules.nixos.canopus =
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
system,
|
||||
...
|
||||
}@innerArgs:
|
||||
{
|
||||
imports =
|
||||
with config.flake.modules.nixos;
|
||||
[
|
||||
hardware
|
||||
]
|
||||
++ [
|
||||
inputs.nixos-hardware.nixosModules.asus-zephyrus-ga503
|
||||
inputs.cardwire.nixosModules.default
|
||||
];
|
||||
|
||||
boot.kernelParams = [ "nvidia-drm.modeset=1" ];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
inputs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
flake.modules.nixos.canopus = {
|
||||
lib,
|
||||
pkgs,
|
||||
system,
|
||||
...
|
||||
} @ innerArgs: {
|
||||
imports = with config.flake.modules.nixos;
|
||||
[
|
||||
hardware
|
||||
]
|
||||
++ [
|
||||
inputs.nixos-hardware.nixosModules.asus-zephyrus-ga503
|
||||
inputs.cardwire.nixosModules.default
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
hardware = {
|
||||
nvidia = {
|
||||
modesetting.enable = true;
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
};
|
||||
boot.kernelParams = ["nvidia-drm.modeset=1"];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
cpu.amd.updateMicrocode = lib.mkDefault innerArgs.config.hardware.enableRedistributableFirmware;
|
||||
hardware = {
|
||||
nvidia = {
|
||||
modesetting.enable = true;
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
xserver.videoDrivers = [ "nvidia" ];
|
||||
power-profiles-daemon.enable = true;
|
||||
upower.enable = true;
|
||||
|
||||
cardwire = {
|
||||
enable = true;
|
||||
settings = {
|
||||
auto_apply_gpu_state = true;
|
||||
experimental_nvidia_block = true;
|
||||
battery_auto_switch = true;
|
||||
battery_auto_switch_mode = "hybrid";
|
||||
};
|
||||
};
|
||||
|
||||
asusd = {
|
||||
enable = true;
|
||||
asusdConfig.text = ''
|
||||
(
|
||||
charge_control_end_threshold: 80,
|
||||
disable_nvidia_powerd_on_battery: true,
|
||||
ac_command: "",
|
||||
bat_command: "",
|
||||
|
||||
platform_profile_linked_epp: true,
|
||||
platform_profile_on_battery: Quiet,
|
||||
platform_profile_on_ac: Performance,
|
||||
|
||||
change_platform_profile_on_battery: true,
|
||||
change_platform_profile_on_ac: true,
|
||||
|
||||
profile_quiet_epp: Power,
|
||||
profile_balanced_epp: BalancePower,
|
||||
profile_custom_epp: Performance,
|
||||
profile_performance_epp: Performance,
|
||||
|
||||
ac_profile_tunings: {},
|
||||
dc_profile_tunings: {},
|
||||
armoury_settings: {},
|
||||
)
|
||||
'';
|
||||
profileConfig.text = ''
|
||||
(
|
||||
active_profile: Quiet,
|
||||
)
|
||||
'';
|
||||
fanCurvesConfig.text = ''
|
||||
(
|
||||
profiles: (
|
||||
balanced: [
|
||||
(
|
||||
fan: CPU,
|
||||
pwm: (20, 40, 60, 85, 110, 140, 170, 200),
|
||||
temp: (45, 55, 62, 68, 74, 80, 86, 92),
|
||||
enabled: true,
|
||||
),
|
||||
(
|
||||
fan: GPU,
|
||||
pwm: (20, 40, 60, 85, 110, 140, 170, 200),
|
||||
temp: (45, 55, 62, 68, 74, 80, 86, 92),
|
||||
enabled: true,
|
||||
),
|
||||
],
|
||||
performance: [
|
||||
(
|
||||
fan: CPU,
|
||||
pwm: (35, 60, 90, 120, 150, 180, 220, 255),
|
||||
temp: (45, 55, 62, 68, 74, 80, 86, 92),
|
||||
enabled: true,
|
||||
),
|
||||
(
|
||||
fan: GPU,
|
||||
pwm: (35, 60, 90, 120, 150, 180, 220, 255),
|
||||
temp: (45, 55, 62, 68, 74, 80, 86, 92),
|
||||
enabled: true,
|
||||
),
|
||||
],
|
||||
quiet: [
|
||||
(
|
||||
fan: CPU,
|
||||
pwm: (0, 10, 20, 35, 55, 80, 110, 140),
|
||||
temp: (45, 55, 62, 68, 74, 80, 86, 92),
|
||||
enabled: true,
|
||||
),
|
||||
(
|
||||
fan: GPU,
|
||||
pwm: (0, 10, 20, 35, 55, 80, 110, 140),
|
||||
temp: (45, 55, 62, 68, 74, 80, 86, 92),
|
||||
enabled: true,
|
||||
),
|
||||
],
|
||||
custom: [],
|
||||
),
|
||||
)
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
nixpkgs.config.cudaSupport = true;
|
||||
nixpkgs.hostPlatform = lib.mkDefault system;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
nvtopPackages.full
|
||||
];
|
||||
cpu.amd.updateMicrocode = lib.mkDefault innerArgs.config.hardware.enableRedistributableFirmware;
|
||||
};
|
||||
|
||||
services = {
|
||||
xserver.videoDrivers = ["nvidia"];
|
||||
power-profiles-daemon.enable = true;
|
||||
upower.enable = true;
|
||||
|
||||
cardwire = {
|
||||
enable = true;
|
||||
settings = {
|
||||
auto_apply_gpu_state = true;
|
||||
experimental_nvidia_block = true;
|
||||
battery_auto_switch = true;
|
||||
battery_auto_switch_mode = "hybrid";
|
||||
};
|
||||
};
|
||||
|
||||
asusd = {
|
||||
enable = true;
|
||||
asusdConfig.text = ''
|
||||
(
|
||||
charge_control_end_threshold: 80,
|
||||
disable_nvidia_powerd_on_battery: true,
|
||||
ac_command: "",
|
||||
bat_command: "",
|
||||
|
||||
platform_profile_linked_epp: true,
|
||||
platform_profile_on_battery: Quiet,
|
||||
platform_profile_on_ac: Performance,
|
||||
|
||||
change_platform_profile_on_battery: true,
|
||||
change_platform_profile_on_ac: true,
|
||||
|
||||
profile_quiet_epp: Power,
|
||||
profile_balanced_epp: BalancePower,
|
||||
profile_custom_epp: Performance,
|
||||
profile_performance_epp: Performance,
|
||||
|
||||
ac_profile_tunings: {},
|
||||
dc_profile_tunings: {},
|
||||
armoury_settings: {},
|
||||
)
|
||||
'';
|
||||
profileConfig.text = ''
|
||||
(
|
||||
active_profile: Quiet,
|
||||
)
|
||||
'';
|
||||
fanCurvesConfig.text = ''
|
||||
(
|
||||
profiles: (
|
||||
balanced: [
|
||||
(
|
||||
fan: CPU,
|
||||
pwm: (20, 40, 60, 85, 110, 140, 170, 200),
|
||||
temp: (45, 55, 62, 68, 74, 80, 86, 92),
|
||||
enabled: true,
|
||||
),
|
||||
(
|
||||
fan: GPU,
|
||||
pwm: (20, 40, 60, 85, 110, 140, 170, 200),
|
||||
temp: (45, 55, 62, 68, 74, 80, 86, 92),
|
||||
enabled: true,
|
||||
),
|
||||
],
|
||||
performance: [
|
||||
(
|
||||
fan: CPU,
|
||||
pwm: (35, 60, 90, 120, 150, 180, 220, 255),
|
||||
temp: (45, 55, 62, 68, 74, 80, 86, 92),
|
||||
enabled: true,
|
||||
),
|
||||
(
|
||||
fan: GPU,
|
||||
pwm: (35, 60, 90, 120, 150, 180, 220, 255),
|
||||
temp: (45, 55, 62, 68, 74, 80, 86, 92),
|
||||
enabled: true,
|
||||
),
|
||||
],
|
||||
quiet: [
|
||||
(
|
||||
fan: CPU,
|
||||
pwm: (0, 10, 20, 35, 55, 80, 110, 140),
|
||||
temp: (45, 55, 62, 68, 74, 80, 86, 92),
|
||||
enabled: true,
|
||||
),
|
||||
(
|
||||
fan: GPU,
|
||||
pwm: (0, 10, 20, 35, 55, 80, 110, 140),
|
||||
temp: (45, 55, 62, 68, 74, 80, 86, 92),
|
||||
enabled: true,
|
||||
),
|
||||
],
|
||||
custom: [],
|
||||
),
|
||||
)
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
nixpkgs.config.cudaSupport = true;
|
||||
nixpkgs.hostPlatform = lib.mkDefault system;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
nvtopPackages.full
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
flake.modules.homeManager.canopus = { pkgs, ... }: {
|
||||
{config, ...}: {
|
||||
flake.modules.homeManager.canopus = {pkgs, ...}: {
|
||||
imports = with config.flake.modules.homeManager; [
|
||||
desktop
|
||||
];
|
||||
@@ -27,8 +26,7 @@
|
||||
enable = true;
|
||||
settings = {
|
||||
authorized_fingerprints = {
|
||||
"f4:4b:17:61:f7:01:a4:a2:e1:c7:8c:1c:7a:f3:8b:87:14:3d:05:3d:a0:8b:cc:e7:88:d8:d8:d2:a4:c2:75:8b" =
|
||||
"sirius";
|
||||
"f4:4b:17:61:f7:01:a4:a2:e1:c7:8c:1c:7a:f3:8b:87:14:3d:05:3d:a0:8b:cc:e7:88:d8:d8:d2:a4:c2:75:8b" = "sirius";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -42,7 +40,7 @@
|
||||
position = "0x0",
|
||||
scale = "1",
|
||||
disabled = false
|
||||
})' &&
|
||||
})' &&
|
||||
hyprctl eval 'hl.monitor({
|
||||
output = "HDMI-A-1",
|
||||
mode = "preferred",
|
||||
@@ -58,7 +56,7 @@
|
||||
position = "0x0",
|
||||
scale = "1",
|
||||
disabled = false
|
||||
})' &&
|
||||
})' &&
|
||||
hyprctl eval 'hl.monitor({
|
||||
output = "HDMI-A-1",
|
||||
mode = "preferred",
|
||||
@@ -71,7 +69,7 @@
|
||||
hyprctl eval 'hl.monitor({
|
||||
output = "eDP-1",
|
||||
disabled = true
|
||||
})' &&
|
||||
})' &&
|
||||
hyprctl eval 'hl.monitor({
|
||||
output = "HDMI-A-1",
|
||||
mode = "preferred",
|
||||
|
||||
Reference in New Issue
Block a user