Skip to content

Commit

Permalink
Improve systemm config
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigmanificient committed Dec 21, 2023
1 parent 46e3a29 commit 6cb4ff6
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 85 deletions.
45 changes: 45 additions & 0 deletions bacon.nix
Original file line number Diff line number Diff line change
@@ -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;
}
52 changes: 4 additions & 48 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; });
};
};
}
60 changes: 23 additions & 37 deletions system/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, username, hostname, pkgs, ... }:
{ username, hostname, pkgs, ... }:
{
imports =
[
Expand Down Expand Up @@ -86,7 +86,10 @@
];
};

hardware.pulseaudio.enable = false;
hardware = {
pulseaudio.enable = false;
opengl.enable = true;
};

programs = {
command-not-found.enable = false;
Expand All @@ -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;
Expand All @@ -129,7 +147,6 @@

xserver = {
enable = true;
excludePackages = with pkgs; [ xterm ];
displayManager.startx.enable = true;
layout = "fr";
libinput = {
Expand All @@ -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" ];
Expand Down Expand Up @@ -186,7 +201,7 @@
XDG_STATE_HOME = "$HOME/.local/state";
};

shells = with pkgs; [ zsh ];
shells = [ pkgs.zsh ];
systemPackages = with pkgs; [
alsa-utils
modemmanager
Expand Down Expand Up @@ -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";
};
};
}

0 comments on commit 6cb4ff6

Please sign in to comment.