From 5558ffce13cf09af7c20a05b436d0f9918a0cc97 Mon Sep 17 00:00:00 2001 From: tristan Date: Tue, 9 May 2023 08:38:51 +0100 Subject: [PATCH] move displays to hardware section --- flake.nix | 13 ------------- hardware/work.nix | 2 ++ hardware/zenix.nix | 14 ++++++++++++++ lib/home.nix | 6 ------ lib/mkconf.nix | 3 +-- lib/modules/work.nix | 10 ++++++++++ system/global/system.nix | 4 ++++ system/work/system.nix | 16 ---------------- 8 files changed, 31 insertions(+), 37 deletions(-) diff --git a/flake.nix b/flake.nix index 0bae5ef..774bdf3 100644 --- a/flake.nix +++ b/flake.nix @@ -28,22 +28,9 @@ nixosConfigurations = { zenix = mkConf "zenix" { inherit pkgs nixpkgs system user userName home-manager hyprland; - displays = [ - { - name = "DP-1"; - resolution = {x=1920;y=1080;freq=144;}; - wallpaper = "~/Pictures/backgrounds/demonslayer.jpg"; - } - { - name = "HDMI-A-1"; - resolution = {x=1920;y=1080;freq=60;}; - wallpaper = "~/Pictures/backgrounds/nier.jpg"; - } - ]; }; FCS-Tristan-Nixbook = mkConf "work" { inherit pkgs nixpkgs system user userName home-manager hyprland; - laptop = true; work = true; }; }; diff --git a/hardware/work.nix b/hardware/work.nix index 8eb93a0..053dcc4 100644 --- a/hardware/work.nix +++ b/hardware/work.nix @@ -85,5 +85,7 @@ libvdpau-va-gl ]; }; + + roles.laptop.enable = true; } diff --git a/hardware/zenix.nix b/hardware/zenix.nix index a157c81..9cfdc4b 100644 --- a/hardware/zenix.nix +++ b/hardware/zenix.nix @@ -66,4 +66,18 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + displays = [ + { + name = "DP-1"; + resolution = {x=1920;y=1080;freq=144;}; + wallpaper = "~/Pictures/backgrounds/demonslayer.jpg"; + } + { + name = "HDMI-A-1"; + resolution = {x=1920;y=1080;freq=60;}; + wallpaper = "~/Pictures/backgrounds/nier.jpg"; + } + ]; + } diff --git a/lib/home.nix b/lib/home.nix index 3083fda..d56b678 100644 --- a/lib/home.nix +++ b/lib/home.nix @@ -1,7 +1,6 @@ { user , name , hyprland -, laptop ? false , work ? false , displays ? [] , userName @@ -33,12 +32,7 @@ ../system/${name}/home.nix ]; - roles.laptop.enable = laptop; roles.work.enable = work; roles.personal.enable = !work; - displays = { - enable = true; - displays = displays; - }; } diff --git a/lib/mkconf.nix b/lib/mkconf.nix index bd35fef..a7e552a 100644 --- a/lib/mkconf.nix +++ b/lib/mkconf.nix @@ -6,7 +6,6 @@ name: , hyprland , laptop ? false , work ? false -, displays ? [] , userName , ... }: @@ -30,6 +29,6 @@ nixpkgs.lib.nixosSystem rec { hyprland.homeManagerModules.default ]; } - (import ./home.nix { inherit user userName name hyprland laptop work displays; }) + (import ./home.nix { inherit user userName name hyprland laptop work; }) ]; } diff --git a/lib/modules/work.nix b/lib/modules/work.nix index d32560b..c24b0ba 100644 --- a/lib/modules/work.nix +++ b/lib/modules/work.nix @@ -81,5 +81,15 @@ with lib; plugins = [ pkgs.networkmanager-openvpn ]; }; }; + + virtualisation.docker = { + enable = true; + storageDriver = "btrfs"; + rootless = { + enable = true; + setSocketVariable = true; + }; + }; + }; } diff --git a/system/global/system.nix b/system/global/system.nix index 7009ec0..f1ef878 100644 --- a/system/global/system.nix +++ b/system/global/system.nix @@ -172,5 +172,9 @@ bind-key -T copy-mode-vi y send-keys -X copy-selection ''; + boot.kernel.sysctl = { + "net.ipv4.ip_unprivileged_port_start" = 53; + }; + } diff --git a/system/work/system.nix b/system/work/system.nix index 12077ec..6951b52 100644 --- a/system/work/system.nix +++ b/system/work/system.nix @@ -5,10 +5,6 @@ networking.hostName = "FCS-Tristan-Nixbook"; - boot.kernel.sysctl = { - "net.ipv4.ip_unprivileged_port_start" = 53; - }; - system.stateVersion = "22.11"; # do not change security.pki.certificates = [ @@ -45,17 +41,5 @@ '' ]; - # dangerous - # users.users.tristan.extraGroups = [ "docker" ]; - - virtualisation.docker = { - enable = true; - storageDriver = "btrfs"; - rootless = { - enable = true; - setSocketVariable = true; - }; - }; - }