From cc08b0d2f2974604258798024ba5898a8730e976 Mon Sep 17 00:00:00 2001 From: servostar Date: Sat, 2 Dec 2023 10:47:09 +0100 Subject: [PATCH] moved qmeu, steam and various dev configs --- configuration.nix | 40 ---------------------------------------- dev/default.nix | 2 ++ dev/docker-rootless.nix | 9 +++++++++ dev/php.nix | 6 ++++++ dev/qemu.nix | 10 ++++++++++ extra/default.nix | 1 + extra/steam.nix | 11 +++++++++++ nix-settings.nix | 10 +--------- template.nix | 3 +++ users/servostar/user.nix | 1 + 10 files changed, 44 insertions(+), 49 deletions(-) create mode 100644 dev/docker-rootless.nix create mode 100644 dev/php.nix create mode 100644 dev/qemu.nix create mode 100644 extra/steam.nix create mode 100644 template.nix diff --git a/configuration.nix b/configuration.nix index e37c36d..43b1a6a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,7 +1,3 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running nixos-help). - { config, pkgs, lib, ... }: let @@ -97,9 +93,6 @@ in # Configure console keymap console.keyMap = "de"; - # Enable CUPS to print documents. - services.printing.enable = true; - ################################################ # __ ___ _ _ _ _ _ # \ \ / (_)_ __| |_ _ _ __ _| (_)___ __ _| |_(_) ___ _ __ @@ -113,19 +106,6 @@ in # - Docker ################################################ - # enable rootless docker for more security - virtualisation.docker.rootless = { - enable = true; - setSocketVariable = true; - }; - # regulary clean unused docker images - virtualisation.docker.autoPrune.enable = true; - # add user teridax to docker group - users.extraGroups.docker.members = [ "servostar" ]; - - # KVM - virtualisation.libvirtd.enable = true; - # android container virtualisation.waydroid.enable = true; @@ -159,34 +139,14 @@ in # services.xserver.libinput.enable = true; programs.java.enable = true; - programs.steam = { - enable = true; - remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play - dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server - }; - hardware.opengl.driSupport32Bit = true; # Enables support for 32bit libs that steam uses - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = (with pkgs; [ (python3.withPackages(python-packages)) - conda - - virt-manager distrobox - # Rust toolchain - rustup - libiconv - rust-analyzer - - php - php.packages.composer - go nodejs diff --git a/dev/default.nix b/dev/default.nix index dca0e6f..470f518 100644 --- a/dev/default.nix +++ b/dev/default.nix @@ -2,6 +2,8 @@ imports = [ ./language-server.nix ./dotnet.nix + ./docker-rootless.nix ./platformio.nix + ./qemu.nix ]; } diff --git a/dev/docker-rootless.nix b/dev/docker-rootless.nix new file mode 100644 index 0000000..7b60e25 --- /dev/null +++ b/dev/docker-rootless.nix @@ -0,0 +1,9 @@ +{ pkgs, config, ... }: { + # enable rootless docker for more security + virtualisation.docker.rootless = { + enable = true; + setSocketVariable = true; + }; + # regulary clean unused docker images + virtualisation.docker.autoPrune.enable = true; +} diff --git a/dev/php.nix b/dev/php.nix new file mode 100644 index 0000000..36b2377 --- /dev/null +++ b/dev/php.nix @@ -0,0 +1,6 @@ +{ pkgs, config, ... }: { + environment.systemPackages = (with pkgs; [ + php + php.packages.composer + ]) +} diff --git a/dev/qemu.nix b/dev/qemu.nix new file mode 100644 index 0000000..1c5c1f3 --- /dev/null +++ b/dev/qemu.nix @@ -0,0 +1,10 @@ +{ pkgs, config, ... }: { + # KVM + virtualisation.libvirtd.enable = true; + # programs.virt-manager.enable = true; # after 23.11 + + # only before 23.11 + environment.systemPackages = (with pkgs; [ + virt-manager + ]); +} diff --git a/extra/default.nix b/extra/default.nix index 2697f2e..476559f 100644 --- a/extra/default.nix +++ b/extra/default.nix @@ -4,5 +4,6 @@ ./dvd.nix ./yubikey.nix ./wireguard.nix + ./steam.nix ]; } diff --git a/extra/steam.nix b/extra/steam.nix new file mode 100644 index 0000000..1b789c2 --- /dev/null +++ b/extra/steam.nix @@ -0,0 +1,11 @@ +{ pkgs, config, ... }: { + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + programs.steam = { + enable = true; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + }; + hardware.opengl.driSupport32Bit = true; # Enables support for 32bit libs that steam uses +} diff --git a/nix-settings.nix b/nix-settings.nix index af579c9..417c5b2 100644 --- a/nix-settings.nix +++ b/nix-settings.nix @@ -8,9 +8,6 @@ # Configuration for nix { config, pkgs, lib, ... }: -let - unstableTarball = fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz; -in { # cleanup nix store after every build nix.settings.auto-optimise-store = true; @@ -23,12 +20,7 @@ in options = "--delete-older-than 30d"; }; - # enable unstable packages nixpkgs.config = { - packageOverrides = pkgs: with pkgs; { - unstable = import unstableTarball { - config = config.nixpkgs.config; - }; - }; + allowAliases = true; }; } diff --git a/template.nix b/template.nix new file mode 100644 index 0000000..762b694 --- /dev/null +++ b/template.nix @@ -0,0 +1,3 @@ +{ pkgs, config, ... }: { + # put your nix module in here! +} diff --git a/users/servostar/user.nix b/users/servostar/user.nix index c1a2891..33c6e02 100644 --- a/users/servostar/user.nix +++ b/users/servostar/user.nix @@ -22,6 +22,7 @@ "tty" "uucp" "plugdev" + "docker" ]; # use zsh shell = pkgs.zsh;