From 6cb4ff6c6e1487b97a2e9116177f8dc0409d690b Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Thu, 21 Dec 2023 18:22:22 +0100 Subject: [PATCH] Improve systemm config --- bacon.nix | 45 ++++++++++++++++++++++++++++++++++ flake.nix | 52 ++++------------------------------------ system/default.nix | 60 ++++++++++++++++++---------------------------- 3 files changed, 72 insertions(+), 85 deletions(-) create mode 100644 bacon.nix diff --git a/bacon.nix b/bacon.nix new file mode 100644 index 0000000..7edd6e8 --- /dev/null +++ b/bacon.nix @@ -0,0 +1,45 @@ +{ inputs, system }: with inputs; +let + username = "sigmanificient"; +in { + inherit system; + + specialArgs = { + inherit username; + hostname = "Bacon"; + }; + + modules = + let + home-manager-conf = { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.${username} = import ./home; + extraSpecialArgs = { + inherit username system ecsls; + }; + }; + }; + + hosts-conf = { + networking.stevenBlackHosts.enable = true; + }; + + mod-nixhardware-lst = with nixos-hardware.nixosModules; [ + asus-battery + common-cpu-amd + common-pc + common-pc-ssd + ]; + in + [ + ./system + ./hardware-configuration.nix + ] ++ [ + home-manager.nixosModules.home-manager + home-manager-conf + hosts.nixosModule + hosts-conf + ] ++ mod-nixhardware-lst; +} diff --git a/flake.nix b/flake.nix index 00dcb3f..280ad6f 100644 --- a/flake.nix +++ b/flake.nix @@ -22,53 +22,9 @@ { formatter.${system} = pkgs.nixpkgs-fmt; - nixosConfigurations = - let - username = "sigmanificient"; - in - { - Bacon = nixpkgs.lib.nixosSystem { - inherit system; - - specialArgs = { - inherit username; - hostname = "Bacon"; - }; - - modules = - let - home-manager-conf = { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.${username} = import ./home; - extraSpecialArgs = { - inherit username system ecsls; - }; - }; - }; - - hosts-conf = { - networking.stevenBlackHosts.enable = true; - }; - - mod-nixhardware-lst = with nixos-hardware.nixosModules; [ - asus-battery - common-cpu-amd - common-pc - common-pc-ssd - ]; - in - [ - ./system - ./hardware-configuration.nix - ] ++ [ - home-manager.nixosModules.home-manager - home-manager-conf - hosts.nixosModule - hosts-conf - ] ++ mod-nixhardware-lst; - }; - }; + nixosConfigurations = { + Bacon = nixpkgs.lib.nixosSystem + (import ./bacon.nix { inherit inputs system; }); + }; }; } diff --git a/system/default.nix b/system/default.nix index d863896..9562669 100644 --- a/system/default.nix +++ b/system/default.nix @@ -1,4 +1,4 @@ -{ config, username, hostname, pkgs, ... }: +{ username, hostname, pkgs, ... }: { imports = [ @@ -86,7 +86,10 @@ ]; }; - hardware.pulseaudio.enable = false; + hardware = { + pulseaudio.enable = false; + opengl.enable = true; + }; programs = { command-not-found.enable = false; @@ -111,6 +114,21 @@ security.rtkit.enable = true; services = { + auto-cpufreq = { + enable = true; + settings = { + battery = { + governor = "powersave"; + turbo = "never"; + }; + + charger = { + governor = "performance"; + turbo = "auto"; + }; + }; + }; + gvfs.enable = true; tumbler.enable = true; openssh.enable = true; @@ -129,7 +147,6 @@ xserver = { enable = true; - excludePackages = with pkgs; [ xterm ]; displayManager.startx.enable = true; layout = "fr"; libinput = { @@ -140,16 +157,14 @@ windowManager.qtile = { enable = true; backend = "x11"; - extraPackages = python3Packages: with python3Packages; [ - qtile-extras - ]; + extraPackages = pypkgs: [ pypkgs.qtile-extras ]; }; }; upower.enable = true; }; - users.users."${username}" = { + users.users.${username} = { isNormalUser = true; shell = pkgs.zsh; extraGroups = [ "audio" "docker" "networkmanager" "libvirtd" "wheel" ]; @@ -186,7 +201,7 @@ XDG_STATE_HOME = "$HOME/.local/state"; }; - shells = with pkgs; [ zsh ]; + shells = [ pkgs.zsh ]; systemPackages = with pkgs; [ alsa-utils modemmanager @@ -228,33 +243,4 @@ ]; }; }; - - hardware.opengl.enable = true; - hardware.nvidia = { - open = false; - modesetting.enable = false; - package = config.boot.kernelPackages.nvidiaPackages.stable; - - prime = { - offload = { - enable = false; - enableOffloadCmd = false; - }; - amdgpuBusId = "PCI:5:0:0"; - nvidiaBusId = "PCI:1:0:0"; - }; - }; - - services.auto-cpufreq.enable = true; - services.auto-cpufreq.settings = { - battery = { - governor = "powersave"; - turbo = "never"; - }; - - charger = { - governor = "performance"; - turbo = "auto"; - }; - }; }