Split up Desktop confs

This commit is contained in:
Tristan D. 2023-12-10 05:19:43 +01:00
parent f9cc3f3e23
commit 2de8b412a0
Signed by: tristan
SSH key fingerprint: SHA256:3RU4RLOoM8oAjFU19f1W6t8uouZbA7GWkaSW6rjp1k8
13 changed files with 283 additions and 211 deletions

18
flake.lock generated
View file

@ -10,11 +10,11 @@
"yafas": "yafas" "yafas": "yafas"
}, },
"locked": { "locked": {
"lastModified": 1701982012, "lastModified": 1702060383,
"narHash": "sha256-SnSF/WWHlEgHN20kRxen445+rikGUpqsomyeFmJ/2tM=", "narHash": "sha256-XMMBRB3RoygT+lvQOlZHQI04VbhxpJkDQ3pa75aQiZg=",
"owner": "chaotic-cx", "owner": "chaotic-cx",
"repo": "nyx", "repo": "nyx",
"rev": "4e6d94c4035d1ce87916f1a10d7f993db019b826", "rev": "bb23b9a821adf19ed91bc4651c5d8689cfee1707",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -334,11 +334,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1701802827, "lastModified": 1701952659,
"narHash": "sha256-wTn0lpV75Uv6tU6haEypNsmnJJPb0hpaMIy/4uf5AiQ=", "narHash": "sha256-TJv2srXt6fYPUjxgLAL0cy4nuf1OZD4KuA1TrCiQqg0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a804fc878d7ba1558b960b4c64b0903da426ac41", "rev": "b4372c4924d9182034066c823df76d6eaf1f4ec4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -350,11 +350,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1701989134, "lastModified": 1702060431,
"narHash": "sha256-bGyoaB3XTIfKVsG7u0NKhcC0G5pruAElbLsDRffnZJQ=", "narHash": "sha256-8/yGvqBUx/oR2rDhY8+iWZ1nErjpsNCe2O8PvzFaerM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "6021d0574cac4d299f25c4e7f32cbc53b6e33571", "rev": "d854884a8c7d2014ff44a27cfe9cac8dd78cc7ea",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -38,7 +38,6 @@ in
libsForQt5.kdeconnect-kde libsForQt5.kdeconnect-kde
libsForQt5.plasma-vault libsForQt5.plasma-vault
libsForQt5.plasma-browser-integration libsForQt5.plasma-browser-integration
natron
neofetch neofetch
nextcloud-client nextcloud-client
onlyoffice-bin onlyoffice-bin

View file

@ -51,8 +51,9 @@ in
package = pkgs.unstable-pkgs.fish; package = pkgs.unstable-pkgs.fish;
interactiveShellInit = '' interactiveShellInit = ''
any-nix-shell fish --info-right | source any-nix-shell fish --info-right | source
direnv hook fish | source direnv hook fish | source
cat /var/lib/rust-motd/motd
''; '';
loginShellInit = '' loginShellInit = ''
direnv hook fish | source direnv hook fish | source

View file

@ -6,6 +6,7 @@
, ... , ...
}: { }: {
nixpkgs.hostPlatform = lib.mkDefault system; nixpkgs.hostPlatform = lib.mkDefault system;
nix = { nix = {
gc = { gc = {
automatic = true; automatic = true;
@ -57,10 +58,14 @@
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
curl
fish
figlet
neovim # editor neovim # editor
veracrypt veracrypt
vim # fallback ed
git git
vim # fallback ed
wget
]; ];
fileSystems."/etc/nixos" = { fileSystems."/etc/nixos" = {
@ -70,6 +75,50 @@
}; };
programs = { programs = {
rust-motd = {
enable = true;
enableMotdInSSHD = true;
settings = {
banner = {
color = "green";
command = ''
${pkgs.inetutils}/bin/hostname | ${pkgs.figlet}/bin/figlet -f slant
'';
};
uptime = {
prefix = "Up";
};
global = {
progress_full_character = "=";
progress_empty_character = "-";
progress_prefix = "[";
progress_suffix = "]";
};
filesystems = {
btrfsroot = "/media/@btrfsroot";
sandisk = "/media/SanDisk";
};
memory.swap_pos = "beside";
last_login = builtins.listToAttrs (map
(user: {
name = user;
value = 2;
})
(builtins.attrNames config.home-manager.users));
};
order = [
"global"
"banner"
"uptime"
"memory"
"filesystems"
"last_login"
];
};
nix-ld.dev.enable = true; nix-ld.dev.enable = true;
command-not-found.enable = false; command-not-found.enable = false;
nix-index-database.comma.enable = true; nix-index-database.comma.enable = true;
@ -93,6 +142,13 @@
KbdInteractiveAuthentication = false; KbdInteractiveAuthentication = false;
PubKeyAuthentication = true; PubKeyAuthentication = true;
}; };
extraConfig = ''
AllowTcpForwarding yes
X11Forwarding no
AllowAgentForwarding no
AllowStreamLocalForwarding no
AuthenticationMethods publickey
'';
}; };
gvfs.enable = true; gvfs.enable = true;

19
os-mods/desktop/audio.nix Normal file
View file

@ -0,0 +1,19 @@
{ config
, lib
, pkgs
, ...
}: {
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
};
## audio
sound.enable = true;
hardware.bluetooth.enable = true;
}

View file

@ -5,25 +5,42 @@
}: { }: {
programs.dconf.enable = true; programs.dconf.enable = true;
# fonts fonts = {
enableDefaultPackages = true;
fontDir.enable = true;
fontconfig = {
antialias = true;
fonts.fontDir.enable = true; defaultFonts.serif = [ "Iosevka Nerd Font Propo" ];
fonts.packages = with pkgs; [ defaultFonts.sansSerif = [ "Iosevka Nerd Font Propo" ];
emacs-all-the-icons-fonts defaultFonts.monospace = [ "Iosevka Nerd Font Mono" ];
corefonts defaultFonts.emoji = [ "Noto Color Emoji" ];
vistafonts
noto-fonts hinting.enable = true;
noto-fonts-cjk hinting.style = "slight";
noto-fonts-emoji
liberation_ttf subpixel.rgba = lib.mkDefault "rgb";
fira subpixel.lcdfilter = "default";
fira-code };
fira-code-symbols packages = with pkgs; [
mplus-outline-fonts.githubRelease emacs-all-the-icons-fonts
dina-font corefonts
proggyfonts vistafonts
(nerdfonts.override { fonts = [ "Iosevka" "IosevkaTerm" "FiraCode" "DroidSansMono" "NerdFontsSymbolsOnly" ]; }) noto-fonts
]; noto-fonts-cjk
noto-fonts-emoji
liberation_ttf
fira
fira-code
fira-code-symbols
mplus-outline-fonts.githubRelease
dina-font
proggyfonts
(nerdfonts.override {
fonts = [ "Iosevka" "IosevkaTerm" "FiraCode" "DroidSansMono" "NerdFontsSymbolsOnly" ];
})
];
};
networking.firewall = { networking.firewall = {
enable = true; enable = true;
@ -60,44 +77,5 @@
# }; # };
}; };
}; };
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
#########
## printing
printing = {
enable = true;
drivers = with pkgs; [
gutenprint
gutenprintBin
hplipWithPlugin
brlaser
brgenml1cupswrapper
];
};
}; };
## audio
sound.enable = true;
hardware.bluetooth.enable = true;
environment.systemPackages = with pkgs; [
cifs-utils
];
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
chaotic.steam.extraCompatPackages = with pkgs; [
proton-ge-custom
];
} }

View file

@ -0,0 +1,15 @@
{ config
, lib
, pkgs
, ...
}: {
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
chaotic.steam.extraCompatPackages = with pkgs; [
proton-ge-custom
];
}

View file

@ -0,0 +1,21 @@
{ config
, lib
, pkgs
, ...
}: {
services = {
printing = {
enable = true;
drivers = with pkgs; [
gutenprint
gutenprintBin
hplipWithPlugin
brlaser
brgenml1cupswrapper
];
};
};
environment.systemPackages = with pkgs; [
cifs-utils
];
}

View file

@ -0,0 +1,53 @@
{ config
, lib
, pkgs
, modulesPath
, system
, inputs
, ...
}: {
# TODO allow primary/node config option to listen/send metrics to central location
services.netdata = {
enable = true;
config = {
global = {
# uncomment to reduce memory to 32 MB
#"page cache size" = 32;
# update interval
"update every" = 15;
};
db = {
"update every" = 5;
"storage tiers" = 3;
"dbengine multihost disk space MB" = 1024;
"dbengine tier 1 multihost disk space MB" = 1024;
"dbengine tier 2 multihost disk space MB" = 512;
"cleanup obsolete charts after secs" = 600;
};
ml = {
# enable machine learning
"enabled" = "yes";
};
};
configDir = {
"stream.conf" = pkgs.writeText "stream.conf" ''
[8fcb63b3-8361-4339-a010-fc459c2132b0]
enabled = yes
default history = 36000
default memory mode = dbengine
health enabled by default = auto
allow from = 192.*
'';
};
};
networking.firewall.allowedTCPPortRanges = [
{
from = 19999;
to = 19999;
} # netdata
];
}

View file

@ -15,7 +15,7 @@
enable = true; enable = true;
package = pkgs.unstable-os.docker; package = pkgs.unstable-os.docker;
storageDriver = "btrfs"; storageDriver = lib.mkDefault "btrfs";
}; };
virtualisation.libvirtd = { virtualisation.libvirtd = {

View file

@ -12,52 +12,59 @@
../../os-mods/cachix ../../os-mods/cachix
../../os-mods/common ../../os-mods/common
../../os-mods/desktop ../../os-mods/desktop
../../os-mods/desktop/audio.nix
../../os-mods/desktop/gaming.nix
../../os-mods/desktop/printing.nix
../../os-mods/netdata
../../os-mods/network ../../os-mods/network
../../os-mods/virt ../../os-mods/virt
../../os-mods/xmr ../../os-mods/xmr
../../users ../../users
./disko.nix ./disko.nix
]; ];
system.stateVersion = "23.05";
nix.settings.system-features = [ config = {
"benchmark" system.stateVersion = "23.05";
"big-parallel"
"kvm" nix.settings.system-features = [
"nixos-test" "benchmark"
"gccarch-x86-64-v3" "big-parallel"
"gccarch-znver3" "kvm"
]; "nixos-test"
boot = { "gccarch-x86-64-v3"
kernelPackages = pkgs.pkgsx86_64_v3.linuxPackages_cachyos; "gccarch-znver3"
loader = { ];
systemd-boot = { boot = {
enable = true; kernelPackages = pkgs.pkgsx86_64_v3.linuxPackages_cachyos;
configurationLimit = 32; loader = {
systemd-boot = {
enable = true;
configurationLimit = 32;
};
efi.canTouchEfiVariables = true;
}; };
efi.canTouchEfiVariables = true;
initrd = {
availableKernelModules = [ "ahci" "nvme" "xhci_pci" "uas" "usbhid" "usb_storage" "sd_mod" ];
kernelModules = [ ];
systemd.enable = true;
};
kernelModules = [ "kvm-amd" ];
extraModulePackages = [ ];
}; };
initrd = { services.btrfs.autoScrub.enable = true;
availableKernelModules = [ "ahci" "nvme" "xhci_pci" "uas" "usbhid" "usb_storage" "sd_mod" ];
kernelModules = [ ]; networking = {
systemd.enable = true; hostName = "nixos-desk";
useDHCP = lib.mkDefault true;
}; };
kernelModules = [ "kvm-amd" ]; hardware = {
extraModulePackages = [ ]; cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
};
zramSwap.enable = true;
}; };
services.btrfs.autoScrub.enable = true;
networking = {
hostName = "nixos-desk";
useDHCP = lib.mkDefault true;
};
hardware = {
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
};
zramSwap.enable = true;
} }

View file

@ -8,6 +8,10 @@
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")
../../os-mods/common ../../os-mods/common
../../os-mods/cachix ../../os-mods/cachix
../../os-mods/desktop
../../os-mods/desktop/audio.nix
../../os-mods/desktop/printing.nix
../../os-mods/netdata
../../os-mods/network ../../os-mods/network
]; ];
@ -27,6 +31,12 @@
extraModulePackages = [ ]; extraModulePackages = [ ];
}; };
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
netmaker
];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/8598929f-bf20-4f02-9f20-acf899eeee2c"; device = "/dev/disk/by-uuid/8598929f-bf20-4f02-9f20-acf899eeee2c";
fsType = "ext4"; fsType = "ext4";
@ -43,93 +53,19 @@
options = [ "bind" ]; options = [ "bind" ];
}; };
sound.enable = true; security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.login1.suspend" ||
action.id == "org.freedesktop.login1.suspend-multiple-sessions" ||
action.id == "org.freedesktop.login1.hibernate" ||
action.id == "org.freedesktop.login1.hibernate-multiple-sessions")
{
return polkit.Result.NO;
}
});
'';
security = { services.qemuGuest.enable = true;
rtkit.enable = true;
sudo.wheelNeedsPassword = false;
polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.login1.suspend" ||
action.id == "org.freedesktop.login1.suspend-multiple-sessions" ||
action.id == "org.freedesktop.login1.hibernate" ||
action.id == "org.freedesktop.login1.hibernate-multiple-sessions")
{
return polkit.Result.NO;
}
});
'';
};
services = {
xserver = {
enable = true;
displayManager = {
sddm.enable = true;
autoLogin = {
enable = true;
user = "reopen5194";
};
};
desktopManager.plasma5.enable = true;
# Configure keymap in X11
layout = "us";
xkbVariant = "";
};
printing.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
};
# QemuGuest
qemuGuest.enable = true;
netdata = {
enable = true;
config = {
global = {
# uncomment to reduce memory to 32 MB
#"page cache size" = 32;
# update interval
"update every" = 15;
};
db = {
"update every" = 5;
"storage tiers" = 3;
"dbengine multihost disk space MB" = 1024;
"dbengine tier 1 multihost disk space MB" = 1024;
"dbengine tier 2 multihost disk space MB" = 512;
"cleanup obsolete charts after secs" = 600;
};
ml = {
# enable machine learning
"enabled" = "yes";
};
};
configDir = {
"stream.conf" = pkgs.writeText "stream.conf" ''
[8fcb63b3-8361-4339-a010-fc459c2132b0]
enabled = yes
default history = 36000
default memory mode = dbengine
health enabled by default = auto
allow from = 192.*
'';
};
};
};
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.reopen5194 = { users.users.reopen5194 = {
@ -150,17 +86,6 @@
]; ];
}; };
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
neovim
vim
curl
fish
netmaker
# wget
];
# Some programs need SUID wrappers, can be configured further or are # Some programs need SUID wrappers, can be configured further or are
# started in user sessions. # started in user sessions.
# programs.mtr.enable = true; # programs.mtr.enable = true;
@ -168,6 +93,7 @@
# Virtualization # Virtualization
virtualisation.docker = { virtualisation.docker = {
enable = true; enable = true;
package = pkgs.unstable-os.docker;
# rootless = { # rootless = {
# enable = true; # enable = true;
# setSocketVariable = true; # setSocketVariable = true;
@ -183,12 +109,5 @@
# "net.ipv4.ip_unprivileged_port_start" = 79; # "net.ipv4.ip_unprivileged_port_start" = 79;
# }; # };
networking.firewall.allowedTCPPortRanges = [
{
from = 19999;
to = 19999;
} # netdata
];
system.stateVersion = "23.05"; # Did you read the comment? system.stateVersion = "23.05"; # Did you read the comment?
} }

View file

@ -12,13 +12,15 @@
../../os-mods/cachix ../../os-mods/cachix
../../os-mods/common ../../os-mods/common
../../os-mods/desktop ../../os-mods/desktop
../../os-mods/desktop/audio.nix
../../os-mods/desktop/gaming.nix
../../os-mods/desktop/printing.nix
../../os-mods/network ../../os-mods/network
../../os-mods/ryzenapu ../../os-mods/ryzenapu
../../os-mods/virt ../../os-mods/virt
../../users ../../users
./disko.nix ./disko.nix
]; ];
system.stateVersion = "23.05";
nix.settings.system-features = [ nix.settings.system-features = [
"benchmark" "benchmark"
@ -159,4 +161,6 @@
}; };
zramSwap.enable = true; zramSwap.enable = true;
system.stateVersion = "23.05";
} }