From 8e482fc5262da5c1fae1d795ca049e6b9c5740a6 Mon Sep 17 00:00:00 2001 From: LordGrimmauld Date: Wed, 29 Nov 2023 22:56:30 +0100 Subject: [PATCH] fix impure issues --- flake.lock | 6 +++--- modules/fonts.nix | 3 +-- modules/localisation.nix | 1 - modules/mypackaegsstayinstoreffs.nix | 2 +- modules/network.nix | 2 +- modules/opengl.nix | 3 --- modules/polkit.nix | 2 +- modules/printing.nix | 2 +- modules/sound.nix | 2 +- modules/system-packages.nix | 11 +++++++++-- modules/tabletdriver.nix | 2 +- modules/template.nix | 2 +- modules/tlp.nix | 1 - modules/users.nix | 2 +- modules/xdg.nix | 2 +- modules/xserver.nix | 1 - scripts.nix | 9 --------- 17 files changed, 22 insertions(+), 31 deletions(-) delete mode 100644 scripts.nix diff --git a/flake.lock b/flake.lock index ea9a5c5..d07dd44 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1700794826, - "narHash": "sha256-RyJTnTNKhO0yqRpDISk03I/4A67/dp96YRxc86YOPgU=", + "lastModified": 1701068326, + "narHash": "sha256-vmMceA+q6hG1yrjb+MP8T0YFDQIrW3bl45e7z24IEts=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5a09cb4b393d58f9ed0d9ca1555016a8543c2ac8", + "rev": "8cfef6986adfb599ba379ae53c9f5631ecd2fd9c", "type": "github" }, "original": { diff --git a/modules/fonts.nix b/modules/fonts.nix index 6849e60..0b21096 100644 --- a/modules/fonts.nix +++ b/modules/fonts.nix @@ -1,4 +1,4 @@ -with import {}; +{pkgs, fonts, ...}: { fonts.packages = with pkgs; [ noto-fonts @@ -9,5 +9,4 @@ with import {}; liberation_ttf ]; fonts.fontDir.enable = true; - } diff --git a/modules/localisation.nix b/modules/localisation.nix index 699a702..e945414 100644 --- a/modules/localisation.nix +++ b/modules/localisation.nix @@ -1,4 +1,3 @@ -with import {}; { time.timeZone = "Europe/Berlin"; diff --git a/modules/mypackaegsstayinstoreffs.nix b/modules/mypackaegsstayinstoreffs.nix index bd7cbc6..6ebe220 100644 --- a/modules/mypackaegsstayinstoreffs.nix +++ b/modules/mypackaegsstayinstoreffs.nix @@ -1,4 +1,4 @@ -with import {}; +{users, pkgs, ...}: { users.extraUsers.mypackaegsstayinstoreffs = { isNormalUser = true; diff --git a/modules/network.nix b/modules/network.nix index a5baf88..4759021 100644 --- a/modules/network.nix +++ b/modules/network.nix @@ -1,4 +1,4 @@ -with import {}; +{pkgs, lib, ...}: { # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/modules/opengl.nix b/modules/opengl.nix index 9144e63..8ab5255 100644 --- a/modules/opengl.nix +++ b/modules/opengl.nix @@ -1,12 +1,9 @@ -with import {}; { # Enable OpenGL hardware.opengl = { enable = true; driSupport = true; driSupport32Bit = true; - extraPackages = with pkgs; [ - ]; }; environment.sessionVariables = { diff --git a/modules/polkit.nix b/modules/polkit.nix index 892ae3d..4e2d487 100644 --- a/modules/polkit.nix +++ b/modules/polkit.nix @@ -1,4 +1,4 @@ -with import {}; +{pkgs, ...}: { security.polkit.enable = true; diff --git a/modules/printing.nix b/modules/printing.nix index 57abdad..c007621 100644 --- a/modules/printing.nix +++ b/modules/printing.nix @@ -1,4 +1,4 @@ -with import {}; +{pkgs, ... }: { imports = [ # Include the results of the hardware scan. diff --git a/modules/sound.nix b/modules/sound.nix index ef47e11..4394cd4 100644 --- a/modules/sound.nix +++ b/modules/sound.nix @@ -1,4 +1,4 @@ -with import {}; +{pkgs, ...}: { # Enable sound with pipewire. sound.enable = true; diff --git a/modules/system-packages.nix b/modules/system-packages.nix index 0520bea..f61e7bd 100644 --- a/modules/system-packages.nix +++ b/modules/system-packages.nix @@ -1,4 +1,4 @@ -with import {}; +{pkgs, ...}: { environment.systemPackages = with pkgs; [ wget @@ -17,6 +17,13 @@ with import {}; ffmpeg-full imagemagick - (import ../scripts.nix) + + (writeShellScriptBin "primerun" '' +export __NV_PRIME_RENDER_OFFLOAD=1 +export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 +export __GLX_VENDOR_LIBRARY_NAME=nvidia +export __VK_LAYER_NV_optimus=NVIDIA_only +exec "$@" +'') ]; } diff --git a/modules/tabletdriver.nix b/modules/tabletdriver.nix index dcbfaee..3a63d26 100644 --- a/modules/tabletdriver.nix +++ b/modules/tabletdriver.nix @@ -1,4 +1,4 @@ -with import {}; +{pkgs, ...}: { systemd.services.otd-daemon = { description = "opentabletdriver daemon, a user service to make the gui work"; diff --git a/modules/template.nix b/modules/template.nix index 89d9179..facb35d 100644 --- a/modules/template.nix +++ b/modules/template.nix @@ -1,4 +1,4 @@ -with import {}; +{ ... }: { } diff --git a/modules/tlp.nix b/modules/tlp.nix index 1121b17..51778d8 100644 --- a/modules/tlp.nix +++ b/modules/tlp.nix @@ -1,4 +1,3 @@ -with import {}; { services.power-profiles-daemon.enable = false; services.tlp = { diff --git a/modules/users.nix b/modules/users.nix index 3e187b7..9af65ab 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -1,4 +1,4 @@ -with import {}; +{pkgs, ...}: { users.users.grimmauld = { isNormalUser = true; diff --git a/modules/xdg.nix b/modules/xdg.nix index 08adb0a..26b3101 100644 --- a/modules/xdg.nix +++ b/modules/xdg.nix @@ -1,4 +1,4 @@ -with import {}; +{pkgs, ...}: { xdg.portal = { enable = true; diff --git a/modules/xserver.nix b/modules/xserver.nix index 0c8668d..501a716 100644 --- a/modules/xserver.nix +++ b/modules/xserver.nix @@ -1,4 +1,3 @@ -with import {}; { # Enable the X11 windowing system. services.xserver = { diff --git a/scripts.nix b/scripts.nix deleted file mode 100644 index 56cd095..0000000 --- a/scripts.nix +++ /dev/null @@ -1,9 +0,0 @@ -with import {}; - -writeShellScriptBin "primerun" '' -export __NV_PRIME_RENDER_OFFLOAD=1 -export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 -export __GLX_VENDOR_LIBRARY_NAME=nvidia -export __VK_LAYER_NV_optimus=NVIDIA_only -exec "$@" -''