init
This commit is contained in:
commit
3ab713a5b3
64 changed files with 2043 additions and 0 deletions
3
class/desktop/codium.nix
Normal file
3
class/desktop/codium.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{pkgs, ...}: {
|
||||
environment.systemPackages = [pkgs.vscodium-fhs];
|
||||
}
|
67
class/desktop/compatibility.nix
Normal file
67
class/desktop/compatibility.nix
Normal file
|
@ -0,0 +1,67 @@
|
|||
{pkgs, ...}: {
|
||||
environment.systemPackages = [
|
||||
pkgs.appimage-run
|
||||
pkgs.wineWowPackages.unstableFull
|
||||
];
|
||||
|
||||
services.envfs.enable = true;
|
||||
|
||||
programs.nix-ld = {
|
||||
enable = true;
|
||||
libraries = [
|
||||
pkgs.alsa-lib
|
||||
pkgs.atk
|
||||
pkgs.at-spi2-atk
|
||||
pkgs.at-spi2-core
|
||||
pkgs.cairo
|
||||
pkgs.cups
|
||||
pkgs.curl
|
||||
pkgs.dbus
|
||||
pkgs.expat
|
||||
pkgs.fontconfig
|
||||
pkgs.freetype
|
||||
pkgs.fuse
|
||||
pkgs.fuse3
|
||||
pkgs.gdk-pixbuf
|
||||
pkgs.glib
|
||||
pkgs.gtk3
|
||||
pkgs.gtk4
|
||||
pkgs.icu
|
||||
pkgs.libappindicator
|
||||
pkgs.libdrm
|
||||
pkgs.libGL
|
||||
pkgs.libglvnd
|
||||
pkgs.libnotify
|
||||
pkgs.libpulseaudio
|
||||
pkgs.libunwind
|
||||
pkgs.libusb1
|
||||
pkgs.libuuid
|
||||
pkgs.libxkbcommon
|
||||
pkgs.libxml2
|
||||
pkgs.mesa
|
||||
pkgs.nspr
|
||||
pkgs.nss
|
||||
pkgs.openssl
|
||||
pkgs.pango
|
||||
pkgs.pipewire
|
||||
pkgs.stdenv.cc.cc
|
||||
pkgs.systemd
|
||||
pkgs.vulkan-loader
|
||||
pkgs.xorg.libX11
|
||||
pkgs.xorg.libxcb
|
||||
pkgs.xorg.libXcomposite
|
||||
pkgs.xorg.libXcursor
|
||||
pkgs.xorg.libXdamage
|
||||
pkgs.xorg.libXext
|
||||
pkgs.xorg.libXfixes
|
||||
pkgs.xorg.libXi
|
||||
pkgs.xorg.libxkbfile
|
||||
pkgs.xorg.libXrandr
|
||||
pkgs.xorg.libXrender
|
||||
pkgs.xorg.libXScrnSaver
|
||||
pkgs.xorg.libxshmfence
|
||||
pkgs.xorg.libXtst
|
||||
pkgs.zlib
|
||||
];
|
||||
};
|
||||
}
|
21
class/desktop/default.nix
Normal file
21
class/desktop/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
imports = [
|
||||
./codium.nix
|
||||
./compatibility.nix
|
||||
./docker.nix
|
||||
./fish.nix
|
||||
./flatpak.nix
|
||||
./fonts.nix
|
||||
./fs.nix
|
||||
./gamemode.nix
|
||||
./gtk.nix
|
||||
./hardware.nix
|
||||
./location.nix
|
||||
./mullvad.nix
|
||||
./networking.nix
|
||||
./pipewire.nix
|
||||
./plasma.nix
|
||||
./printing.nix
|
||||
./syncthing.nix
|
||||
];
|
||||
}
|
3
class/desktop/docker.nix
Normal file
3
class/desktop/docker.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
virtualisation.docker.enable = true;
|
||||
}
|
4
class/desktop/fish.nix
Normal file
4
class/desktop/fish.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{pkgs, ...}: {
|
||||
programs.fish.enable = true;
|
||||
users.defaultUserShell = pkgs.fish;
|
||||
}
|
25
class/desktop/flatpak.nix
Normal file
25
class/desktop/flatpak.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# FIXME: This is unnecessary when https://github.com/NixOS/nixpkgs/pull/262462 is merged
|
||||
system.fsPackages = [pkgs.bindfs];
|
||||
fileSystems = let
|
||||
mkRoSymBind = path: {
|
||||
device = path;
|
||||
fsType = "fuse.bindfs";
|
||||
options = ["ro" "resolve-symlinks" "x-gvfs-hide"];
|
||||
};
|
||||
aggregatedFonts = pkgs.buildEnv {
|
||||
name = "system-fonts";
|
||||
paths = config.fonts.packages;
|
||||
pathsToLink = ["/share/fonts"];
|
||||
};
|
||||
in {
|
||||
"/usr/share/icons" = mkRoSymBind "/run/current-system/sw/share/icons";
|
||||
"/usr/share/fonts" = mkRoSymBind (aggregatedFonts + "/share/fonts");
|
||||
};
|
||||
|
||||
services.flatpak.enable = true;
|
||||
}
|
25
class/desktop/fonts.nix
Normal file
25
class/desktop/fonts.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{pkgs, ...}: {
|
||||
fonts = {
|
||||
enableDefaultPackages = true;
|
||||
|
||||
packages = with pkgs; [
|
||||
noto-fonts
|
||||
noto-fonts-extra
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-cjk-serif
|
||||
noto-fonts-emoji
|
||||
(nerdfonts.override {fonts = ["Noto" "Iosevka"];})
|
||||
];
|
||||
|
||||
fontconfig = {
|
||||
enable = true;
|
||||
|
||||
defaultFonts = {
|
||||
monospace = ["NotoSansMono Nerd Font"];
|
||||
sansSerif = ["Noto Sans"];
|
||||
serif = ["Noto Serif"];
|
||||
emoji = ["Noto Color Emoji"];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
14
class/desktop/fs.nix
Normal file
14
class/desktop/fs.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
boot.initrd.luks.devices.main.device = "/dev/disk/by-label/cryptmain";
|
||||
|
||||
fileSystems = {
|
||||
"/home" = {
|
||||
device = "/dev/mapper/main";
|
||||
fsType = "btrfs";
|
||||
options = ["subvol=home" "compress=zstd" "noatime"];
|
||||
};
|
||||
"/nix".device = "/dev/mapper/main";
|
||||
"/persist".device = "/dev/mapper/main";
|
||||
"/var/log".device = "/dev/mapper/main";
|
||||
};
|
||||
}
|
18
class/desktop/gamemode.nix
Normal file
18
class/desktop/gamemode.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.gamemode = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
renice = 10;
|
||||
};
|
||||
custom = {
|
||||
start = "${lib.getExe pkgs.libnotify} 'GameMode started'";
|
||||
end = "${lib.getExe pkgs.libnotify} 'GameMode stopped'";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
7
class/desktop/gtk.nix
Normal file
7
class/desktop/gtk.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{pkgs, ...}: {
|
||||
xdg.portal.extraPortals = [
|
||||
pkgs.xdg-desktop-portal-gtk
|
||||
];
|
||||
|
||||
programs.dconf.enable = true;
|
||||
}
|
15
class/desktop/hardware.nix
Normal file
15
class/desktop/hardware.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{pkgs, ...}: {
|
||||
hardware = {
|
||||
bluetooth.enable = true;
|
||||
xone.enable = true;
|
||||
xpadneo.enable = true;
|
||||
opentabletdriver.enable = true;
|
||||
opengl = {
|
||||
driSupport32Bit = true;
|
||||
extraPackages32 = [
|
||||
pkgs.pkgsi686Linux.libvdpau-va-gl
|
||||
pkgs.pkgsi686Linux.vaapiVdpau
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
5
class/desktop/location.nix
Normal file
5
class/desktop/location.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
location.provider = "geoclue2";
|
||||
|
||||
services.automatic-timezoned.enable = true;
|
||||
}
|
5
class/desktop/mullvad.nix
Normal file
5
class/desktop/mullvad.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
environment.persistence."/persist".directories = ["/etc/mullvad-vpn"];
|
||||
|
||||
services.mullvad-vpn.enable = true;
|
||||
}
|
40
class/desktop/networking.nix
Normal file
40
class/desktop/networking.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
environment.persistence."/persist".directories = ["/etc/NetworkManager"];
|
||||
|
||||
services.resolved.enable = true;
|
||||
services.opensnitch.enable = true;
|
||||
|
||||
networking = {
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
dns = "systemd-resolved";
|
||||
};
|
||||
firewall = {
|
||||
allowedTCPPorts = [
|
||||
# Spotify track sync
|
||||
57621
|
||||
# Steam Remote Play
|
||||
27036
|
||||
# Source Dedicated Server SRCDS Rcon port
|
||||
27015
|
||||
# Syncthing TCP based sync protocol traffic
|
||||
22000
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
# Source Dedicated Server gameplay traffic
|
||||
27015
|
||||
# Syncthing QUIC based sync protocol traffic
|
||||
22000
|
||||
# Syncthing port for discovery broadcasts on IPv4 and multicasts on IPv6
|
||||
21027
|
||||
];
|
||||
allowedUDPPortRanges = [
|
||||
# Steam Remote Play
|
||||
{
|
||||
from = 27031;
|
||||
to = 27036;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
10
class/desktop/pipewire.nix
Normal file
10
class/desktop/pipewire.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
wireplumber.enable = true;
|
||||
alsa.enable = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
}
|
44
class/desktop/plasma.nix
Normal file
44
class/desktop/plasma.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{pkgs, ...}: {
|
||||
# TODO
|
||||
# displayManager = {
|
||||
# defaultSession = "plasmawayland";
|
||||
# sddm = {
|
||||
# enable = true;
|
||||
# autoNumlock = true;
|
||||
# settings = {
|
||||
# Theme = {
|
||||
# CursorTheme = "breeze_cursors";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
|
||||
services = {
|
||||
xserver = {
|
||||
enable = true;
|
||||
desktopManager.plasma5.enable = true;
|
||||
displayManager.sddm.enable = true;
|
||||
excludePackages = with pkgs; [
|
||||
xterm
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
environment = {
|
||||
systemPackages = [
|
||||
pkgs.discover
|
||||
pkgs.sddm-kcm
|
||||
];
|
||||
sessionVariables = {
|
||||
"SUDO_ASKPASS" = pkgs.writeShellScript "kdialogaskpass" ''
|
||||
exec ${pkgs.kdialog} --password Askpass
|
||||
'';
|
||||
"MOZ_USE_XINPUT2" = "1";
|
||||
"GDK_SCALE" = "1";
|
||||
};
|
||||
};
|
||||
|
||||
xdg.portal.xdgOpenUsePortal = true;
|
||||
|
||||
programs.kdeconnect.enable = true;
|
||||
}
|
10
class/desktop/printing.nix
Normal file
10
class/desktop/printing.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
services = {
|
||||
printing = {
|
||||
enable = true;
|
||||
webInterface = true;
|
||||
cups-pdf.enable = true;
|
||||
};
|
||||
system-config-printer.enable = true;
|
||||
};
|
||||
}
|
7
class/desktop/syncthing.nix
Normal file
7
class/desktop/syncthing.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
overrideDevices = false;
|
||||
overrideFolders = false;
|
||||
};
|
||||
}
|
6
class/server/default.nix
Normal file
6
class/server/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./fs.nix
|
||||
./time.nix
|
||||
];
|
||||
}
|
12
class/server/fs.nix
Normal file
12
class/server/fs.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
fileSystems = {
|
||||
"/home" = {
|
||||
device = "tmpfs";
|
||||
fsType = "tmpfs";
|
||||
options = ["size=4G" "mode=751"];
|
||||
};
|
||||
"/nix".device = "/dev/disk/by-label/main";
|
||||
"/persist".device = "/dev/disk/by-label/main";
|
||||
"/var/log".device = "/dev/disk/by-label/main";
|
||||
};
|
||||
}
|
3
class/server/time.nix
Normal file
3
class/server/time.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
time.timeZone = "UTC";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue