re-split direcories #1

Merged
vinzenz merged 28 commits from modules into main 2025-09-15 19:44:30 +02:00
11 changed files with 113 additions and 101 deletions
Showing only changes of commit 084e819232 - Show all commits

View file

@ -92,7 +92,8 @@
importDir =
dir:
(lib.attrsets.mapAttrs' (
m: _: lib.attrsets.nameValuePair (lib.strings.removeSuffix ".nix" m) (import "${dir}/${m}")
m: _:
lib.attrsets.nameValuePair (lib.strings.removeSuffix ".nix" m) { imports = [ "${dir}/${m}" ]; }
) (builtins.readDir dir));
in
rec {
@ -113,6 +114,16 @@
stateVersion = "22.11";
autoUpgrade.flake = "git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git";
};
nixpkgs.overlays = [
overlays.unstable-packages
overlays.zerforschen
];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
}
./hosts/${device}/hardware.nix
@ -124,27 +135,25 @@
self.nixosModules.autoupdate
self.nixosModules.openssh
self.nixosModules.tailscale
self.nixosModules.allowed-unfree-list
self.nixosModules.extra-caches
./modules/nixpkgs.nix
{
nixpkgs.overlays = [
overlays.unstable-packages
overlays.zerforschen
];
}
]
++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [
{
home-manager.extraSpecialArgs = specialArgs;
time.timeZone = "Europe/Berlin";
home-manager.sharedModules = [
self.homeModules.adwaita
];
}
self.nixosModules.pkgs-unstable
self.nixosModules.niri
self.nixosModules.kdeconnect
self.nixosModules.en-de
self.nixosModules.adwaita
self.nixosModules.gnome
./modules/home-manager.nix
@ -178,6 +187,8 @@
};
};
homeModules = importDir ./homeModules;
formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree);
};
}

View file

@ -1,7 +1,9 @@
{ nixosModules, ... }:
{
imports = [
../../modules/gnome.nix
../../modules/gaming.nix
nixosModules.steam
../../modules/desktop-environment.nix
../../modules/desktop-hardware.nix

View file

@ -3,6 +3,7 @@
imports = [
../../modules/gnome.nix
../../modules/gaming.nix
nixosModules.steam
nixosModules.printing
nixosModules.podman
../../modules/desktop-environment.nix

View file

@ -3,6 +3,7 @@
imports = [
../../modules/gnome.nix
../../modules/gaming.nix
nixosModules.steam
nixosModules.printing
nixosModules.podman
#../../modules/niri.nix

View file

@ -56,6 +56,7 @@
enable = true;
binfmt = true;
};
xwayland.enable = true;
};
systemd = {

View file

@ -8,7 +8,6 @@
extraPackages32 = with pkgs; [ mangohud ];
};
steam-hardware.enable = true;
xpadneo.enable = true;
};
@ -23,59 +22,9 @@
lutris
];
programs = {
xwayland.enable = true;
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
gamescopeSession.enable = false;
};
gamemode.enable = true;
};
networking.firewall = {
allowedUDPPorts = [
networking.firewall.allowedUDPPorts = [
# Factorio
34197
# steam network transfer
3478
];
allowedTCPPorts = [
# steam network transfer
24070
];
allowedTCPPortRanges = [
# steam network transfer
{
from = 27015;
to = 27050;
}
];
allowedUDPPortRanges = [
# steam network transfer
{
from = 4379;
to = 4380;
}
{
from = 27000;
to = 27100;
}
];
};
allowedUnfreePackages = [
"steam"
"steam-original"
"steam-run"
"steam-unwrapped"
"ut1999"
];
};
}

View file

@ -1,35 +1,4 @@
{ config, lib, ... }:
{
options.allowedUnfreePackages = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
example = [ "steam" ];
};
config = {
nixpkgs.config = {
# https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.allowedUnfreePackages;
};
nix.settings = {
substituters = [
"https://cache.nixos.org/"
"https://nix-community.cachix.org"
"https://cache.lix.systems"
"https://niri.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
"niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
];
experimental-features = [
"nix-command"
"flakes"
];
};
documentation = {
enable = true; # documentation of packages
nixos.enable = false; # nixos documentation
@ -37,5 +6,4 @@
info.enable = false; # info pages and the info command
doc.enable = false; # documentation distributed in packages' /share/doc
};
};
}

View file

@ -0,0 +1,15 @@
{ lib, config, ... }:
{
options.allowedUnfreePackages = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
example = [ "steam" ];
};
config = {
nixpkgs.config = {
# https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.allowedUnfreePackages;
};
};
}

View file

@ -0,0 +1,16 @@
{
nix.settings = {
substituters = [
"https://cache.nixos.org/"
"https://nix-community.cachix.org"
"https://cache.lix.systems"
"https://niri.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
"niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
];
};
}

48
nixosModules/steam.nix Normal file
View file

@ -0,0 +1,48 @@
{ nixosModules, ... }:
{
imports = [ nixosModules.allowed-unfree-list ];
hardware.steam-hardware.enable = true;
programs = {
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
gamescopeSession.enable = false;
};
gamemode.enable = true;
};
# steam network transfer
networking.firewall = {
allowedUDPPorts = [ 3478 ];
allowedTCPPorts = [ 24070 ];
allowedTCPPortRanges = [
{
from = 27015;
to = 27050;
}
];
allowedUDPPortRanges = [
{
from = 4379;
to = 4380;
}
{
from = 27000;
to = 27100;
}
];
};
allowedUnfreePackages = [
"steam"
"steam-original"
"steam-run"
"steam-unwrapped"
];
}