another one

This commit is contained in:
cnst
2024-08-03 14:03:54 +02:00
parent 2b2136dfba
commit e1f070d81a
62 changed files with 56 additions and 72 deletions

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
environment.systemPackages = [
pkgs.anyrun
];
}

6
system/bin/default.nix Normal file
View File

@@ -0,0 +1,6 @@
{
imports = [
./anyrun
./hyprland
];
}

View File

@@ -0,0 +1,10 @@
{
services = {
xserver = {
desktopManager.gnome = {
enable = true;
};
};
gnome.games.enable = true;
};
}

View File

@@ -0,0 +1,7 @@
{inputs, ...}: {
imports = [
inputs.hyprland.nixosModules.default
];
environment.variables.NIXOS_OZONE_WL = "1";
programs.hyprland.enable = true;
}

6
system/boot/default.nix Normal file
View File

@@ -0,0 +1,6 @@
{
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
}

View File

@@ -0,0 +1,24 @@
{
pkgs,
lib,
inputs,
...
}:
# lanzaboote config
{
imports = [
inputs.lanzaboote.nixosModules.lanzaboote
];
boot = {
lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot";
};
# we let lanzaboote install systemd-boot
loader.systemd-boot.enable = lib.mkForce false;
};
environment.systemPackages = [pkgs.sbctl];
}

32
system/default.nix Normal file
View File

@@ -0,0 +1,32 @@
let
shared = [
./bin
./etc
./nix
./srv
./usr/share
];
adampad =
shared
++ [
./bin/android
./srv/blueman
];
cnix =
shared
++ [
./usr/bin/gaming.nix
./usr/bin/android
./usr/bin/gimp
./usr/bin/inkscape
./srv/blueman
];
toothpc =
shared
++ [
./usr/bin/gaming.nix
];
in {
inherit shared adampad cnix toothpc;
}

View File

@@ -0,0 +1,8 @@
{
hardware = {
bluetooth = {
enable = true;
powerOnBoot = false;
};
};
}

View File

@@ -0,0 +1,3 @@
{
programs.dconf.enable = true;
}

10
system/etc/default.nix Normal file
View File

@@ -0,0 +1,10 @@
{
imports = [
# shared imports
./dconf
./security
./xdg
./zram
./zsh
];
}

View File

@@ -0,0 +1,27 @@
{pkgs, ...}: {
hardware = {
graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
libva
vaapiVdpau
libvdpau-va-gl
amdvlk
# mesa
mesa
# vulkan
vulkan-tools
vulkan-loader
vulkan-validation-layers
vulkan-extension-layer
];
extraPackages32 = with pkgs.pkgsi686Linux; [
vaapiVdpau
libvdpau-va-gl
];
};
};
}

View File

@@ -0,0 +1,30 @@
{
pkgs,
config,
...
}: {
hardware = {
graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
libva
vaapiVdpau
libvdpau-va-gl
intel-media-driver
nvidia-vaapi-driver
];
};
nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.beta;
# package = config.boot.kernelPackages.nvidiaPackages.stable;
modesetting.enable = true;
powerManagement = {
enable = false;
finegrained = false;
};
open = false;
nvidiaSettings = true;
};
};
}

View File

@@ -0,0 +1,8 @@
{
hardware = {
logitech.wireless = {
enable = true;
enableGraphical = true;
};
};
}

View File

@@ -0,0 +1,15 @@
{
networking = {
networkmanager.enable = true;
hostName = "adampad";
nftables.enable = true;
firewall = {
enable = true;
interfaces = {
"enp7s0" = {
allowedTCPPorts = [22 80 443];
};
};
};
};
}

View File

@@ -0,0 +1,15 @@
{
networking = {
networkmanager.enable = true;
hostName = "cnix";
nftables.enable = true;
firewall = {
enable = true;
interfaces = {
"enp7s0" = {
allowedTCPPorts = [22 80 443];
};
};
};
};
}

View File

@@ -0,0 +1,15 @@
{
networking = {
networkmanager.enable = true;
hostName = "toothpc";
nftables.enable = true;
firewall = {
enable = true;
interfaces = {
"enp4s0" = {
allowedTCPPorts = [22 80 443];
};
};
};
};
}

View File

@@ -0,0 +1,91 @@
{pkgs, ...}:
{
programs.nix-ld = {
enable = true;
# Sets up all the libraries to load
libraries = with pkgs; [
stdenv.cc.cc
openssl
xorg.libXcomposite
xorg.libXtst
xorg.libXrandr
xorg.libXext
xorg.libX11
xorg.libXfixes
libGL
libva
xorg.libxcb
xorg.libXdamage
xorg.libxshmfence
xorg.libXxf86vm
libelf
glib
gtk3
bzip2
xorg.libXinerama
xorg.libXcursor
xorg.libXrender
xorg.libXScrnSaver
xorg.libXi
xorg.libSM
xorg.libICE
gnome2.GConf
nspr
nss
cups
libcap
SDL2
libusb1
dbus-glib
ffmpeg
libudev0-shim
xorg.libXt
xorg.libXmu
libogg
libvorbis
SDL
SDL2_image
glew110
libidn
tbb
flac
freeglut
libjpeg
libpng
libpng12
libsamplerate
libmikmod
libtheora
libtiff
pixman
speex
SDL_image
SDL_ttf
SDL_mixer
SDL2_ttf
SDL2_mixer
libappindicator-gtk2
libdbusmenu-gtk2
libindicator-gtk2
libcaca
libcanberra
libgcrypt
libvpx
librsvg
xorg.libXft
libvdpau
gnome2.pango
cairo
atk
gdk-pixbuf
fontconfig
freetype
dbus
alsaLib
expat
libdrm
mesa
libxkbcommon
];
};
}

View File

@@ -0,0 +1,6 @@
{
security = {
rtkit.enable = true;
pam.services.hyprlock = {};
};
}

View File

@@ -0,0 +1,14 @@
{pkgs, ...}: {
xdg.portal = {
enable = true;
xdgOpenUsePortal = true;
config = {
common.default = ["gtk"];
hyprland.default = ["gtk" "hyprland"];
};
extraPortals = [
pkgs.xdg-desktop-portal-gtk
];
};
}

View File

@@ -0,0 +1,17 @@
{
services.xserver = {
enable = true;
videoDrivers = ["amdgpu"];
# xkb = {
# extraLayouts.hhkbse = {
# description = "HHKBse by cnst";
# languages = ["se"];
# symbolsFile = /home/cnst/.nix-config/nixos/hosts/cnix/xkb/symbols/hhkbse;
# };
# layout = "hhkbse";
# # dir = "/home/cnst/.nix-config/nixos/xkb";
# variant = "";
# options = "lv3:rwin_switch";
# };
};
}

View File

@@ -0,0 +1,17 @@
{
services.xserver = {
enable = true;
videoDrivers = ["amdgpu"];
xkb = {
extraLayouts.hhkbse = {
description = "HHKBse by cnst";
languages = ["se"];
symbolsFile = /home/cnst/.nix-config/hosts/cnix/xkb/symbols/hhkbse;
};
layout = "hhkbse";
# dir = "/home/cnst/.nix-config/nixos/xkb";
variant = "";
options = "lv3:rwin_switch";
};
};
}

View File

@@ -0,0 +1,7 @@
{
services.xserver = {
enable = true;
videoDrivers = ["nvidia"];
layout = "se";
};
}

View File

@@ -0,0 +1 @@
{zramSwap.enable = true;}

View File

@@ -0,0 +1 @@
{ programs.zsh.enable = true; }

44
system/nix/default.nix Normal file
View File

@@ -0,0 +1,44 @@
{
inputs,
lib,
config,
pkgs,
...
}: {
imports = [
./nixpkgs
./home-manager
./substituters
];
environment = {
systemPackages = [
pkgs.git
pkgs.scx
pkgs.stow
];
localBinInPath = true;
};
nix = {
# pin the registry to avoid downloading and evaling a new nixpkgs version every time
registry = lib.mapAttrs (_: v: {flake = v;}) inputs;
# set the path for channels compat
nixPath = lib.mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry;
settings = {
auto-optimise-store = true;
builders-use-substitutes = true;
warn-dirty = false;
experimental-features = ["nix-command" "flakes"];
flake-registry = "/etc/nix/registry.json";
# for direnv GC roots
keep-derivations = true;
keep-outputs = true;
trusted-users = ["root" "@wheel"];
};
};
}

23
system/nix/dev/dev.nix Normal file
View File

@@ -0,0 +1,23 @@
{pkgs ? import <nixpkgs> {}, ...}: {
default = pkgs.mkShell {
NIX_CONFIG = "extra-experimental-features = nix-command flakes";
nativeBuildInputs = with pkgs; [
rust-analyzer
cargo
clippy
rustc
rustfmt
openssl
pkg-config
gtk3
gtk4
libadwaita
glib
clang
gnumake
cmake
nasm
perl
];
};
}

View File

@@ -0,0 +1,10 @@
{inputs, ...}: {
imports = [
inputs.hm.nixosModules.default
];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
};
}

View File

@@ -0,0 +1,11 @@
{
environment.variables.FLAKE = "/home/adam/.nix-config";
programs = {
nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/home/adam/.nix-config";
};
};
}

View File

@@ -0,0 +1,11 @@
{
environment.variables.FLAKE = "/home/cnst/.nix-config";
programs = {
nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/home/cnst/.nix-config";
};
};
}

View File

@@ -0,0 +1,11 @@
{
environment.variables.FLAKE = "/home/toothpick/.nix-config";
programs = {
nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/home/toothpick/.nix-config";
};
};
}

View File

@@ -0,0 +1,13 @@
{
nixpkgs = {
overlays = [
(_: prev: {
python312 = prev.python312.override {packageOverrides = _: pysuper: {nose = pysuper.pynose;};};
})
];
config = {
allowUnfree = true;
input-fonts.acceptLicense = true;
};
};
}

View File

@@ -0,0 +1,28 @@
{
nix.settings = {
substituters = [
# high priority since it's almost always used
"https://cache.nixos.org?priority=10"
"https://anyrun.cachix.org"
"https://fufexan.cachix.org"
"https://helix.cachix.org"
"https://hyprland.cachix.org"
"https://nix-community.cachix.org"
"https://nix-gaming.cachix.org"
"https://yazi.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
"fufexan.cachix.org-1:LwCDjCJNJQf5XD2BV+yamQIMZfcKWR9ISIFy5curUsY="
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
"yazi.cachix.org-1:Dcdz63NZKfvUCbDGngQDAZq6kOroIrFoyO064uvLh8k="
];
};
}

View File

@@ -0,0 +1,10 @@
{
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
}

View File

@@ -0,0 +1 @@
{services.blueman.enable = true;}

View File

@@ -0,0 +1,8 @@
{pkgs, ...}: {
services.dbus = {
enable = true;
packages = with pkgs; [
gcr
];
};
}

16
system/srv/default.nix Normal file
View File

@@ -0,0 +1,16 @@
{
imports = [
./audio
./dbus
./fwupd
./gnome-keyring
./greetd
./gvfs
./locate
./mullvad
./openssh
./power
./samba
./udisks
];
}

View File

@@ -0,0 +1,3 @@
{
services.fwupd.enable = true;
}

View File

@@ -0,0 +1 @@
{services.gnome.gnome-keyring.enable = true;}

View File

@@ -0,0 +1,17 @@
{pkgs, ...}: {
services.greetd = {
enable = true;
settings = {
# AUTOLOGIN
# initial_session = {
# command = "${pkgs.hyprland}/bin/Hyprland";
# user = "cnst"; # <- select which user to auto-login
# };
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet -r --remember-session --asterisks";
user = "greeter";
};
};
};
security.pam.services.greetd.enableGnomeKeyring = true;
}

View File

@@ -0,0 +1 @@
{services.gvfs.enable = true;}

View File

@@ -0,0 +1,7 @@
{pkgs, ...}: {
services.locate = {
enable = true;
package = pkgs.plocate;
localuser = null;
};
}

View File

@@ -0,0 +1,6 @@
{pkgs, ...}: {
services.mullvad-vpn = {
enable = true;
package = pkgs.mullvad-vpn;
};
}

View File

@@ -0,0 +1,9 @@
{
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
};
}

View File

@@ -0,0 +1,6 @@
{
services = {
power-profiles-daemon.enable = true;
upower.enable = true;
};
}

View File

@@ -0,0 +1,19 @@
{pkgs, ...}: {
services = {
samba = {
enable = true;
package = pkgs.samba4Full;
openFirewall = true;
};
avahi = {
publish.enable = true;
publish.userServices = true;
enable = true;
openFirewall = true;
};
samba-wsdd = {
enable = true;
openFirewall = true;
};
};
}

View File

@@ -0,0 +1 @@
{services.udisks2.enable = true;}

View File

@@ -0,0 +1 @@
{ programs.adb.enable = true; }

View File

@@ -0,0 +1,3 @@
{pkgs, ...}: {
environment.systemPackages = [pkgs.bottles-unwrapped];
}

View File

@@ -0,0 +1,9 @@
{
programs.corectrl = {
enable = true;
gpuOverclock = {
enable = true;
ppfeaturemask = "0xffffffff";
};
};
}

View File

@@ -0,0 +1,29 @@
{
pkgs,
inputs,
...
}: {
programs.gamemode = {
enable = true;
settings = {
general = {
softrealtime = "auto";
renice = 15;
};
# gpu = {
# apply_gpu_optimisations = "accept-responsibility";
# gpu_device = 1;
# amd_performance_level = "high";
# };
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
};
};
};
# see https://github.com/fufexan/nix-gaming/#pipewire-low-latency
services.pipewire.lowLatency.enable = true;
imports = [
inputs.nix-gaming.nixosModules.pipewireLowLatency
];
}

View File

@@ -0,0 +1,10 @@
{
programs.gamescope = {
enable = true;
capSysNice = true;
args = [
"--rt"
"--expose-wayland"
];
};
}

20
system/usr/bin/gaming.nix Normal file
View File

@@ -0,0 +1,20 @@
{pkgs, ...}: {
imports = [
./steam
./lutris
# ./bottles
./gamemode
./gamescope
./corectrl
];
environment = {
systemPackages = with pkgs; [
# Misc
protonup
winetricks
];
sessionVariables = {
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "/home/cnst/.steam/root/compatibilitytools.d";
};
};
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
gimp-with-plugins
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
inkscape-with-extensions
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
lutris
];
}

View File

@@ -0,0 +1,8 @@
{
programs = {
steam = {
enable = true;
gamescopeSession.enable = true;
};
};
}

View File

@@ -0,0 +1,7 @@
{
imports = [
# shared imports
./fonts
./locale
];
}

View File

@@ -0,0 +1,29 @@
{pkgs, ...}: {
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
liberation_ttf
fira-code-symbols
font-awesome
recursive
input-fonts
(nerdfonts.override {
fonts = [
"JetBrainsMono"
"FiraCode"
"FiraMono"
"Iosevka"
"3270"
"DroidSansMono"
"SourceCodePro"
"UbuntuMono"
"Overpass"
"Monoid"
"Mononoki"
"Hack"
"IBMPlexMono"
];
})
];
}

View File

@@ -0,0 +1,19 @@
{
time.timeZone = "Europe/Stockholm";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "sv_SE.UTF-8";
LC_IDENTIFICATION = "sv_SE.UTF-8";
LC_MEASUREMENT = "sv_SE.UTF-8";
LC_MONETARY = "sv_SE.UTF-8";
LC_NAME = "sv_SE.UTF-8";
LC_NUMERIC = "sv_SE.UTF-8";
LC_PAPER = "sv_SE.UTF-8";
LC_TELEPHONE = "sv_SE.UTF-8";
LC_TIME = "sv_SE.UTF-8";
};
};
}