From 4d3865b36223797c93d93082103dcb3a80271d9c Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Sat, 27 Aug 2022 23:41:37 +0300 Subject: [PATCH] update system config --- home/home.nix | 3 +- home/wm/bar/polybar/config.nix | 2 +- home/wm/bar/polybar/default.nix | 2 +- home/wm/xmonad/config.hs | 6 +-- scripts/get_volume.sh | 4 +- system/configuration.nix | 66 ++++++++++++++++++++++++--------- 6 files changed, 57 insertions(+), 26 deletions(-) diff --git a/home/home.nix b/home/home.nix index 6471f3c..9a6d4e6 100644 --- a/home/home.nix +++ b/home/home.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: let - secrets = import ./secrets.nix; + secrets = import ../secrets.nix; in { imports = (import ./wm) ++ (import ./shell) ++ (import ./progs); @@ -22,6 +22,7 @@ in home.packages = with pkgs; [ # TODO: move packages to separate modules + kotatogram-desktop asciinema # record the terminal neofetch # command-line system information diff --git a/home/wm/bar/polybar/config.nix b/home/wm/bar/polybar/config.nix index de742c3..7b0daf5 100644 --- a/home/wm/bar/polybar/config.nix +++ b/home/wm/bar/polybar/config.nix @@ -60,7 +60,7 @@ with lib; type = "internal/network"; interval = 3; interface = { - text = "wlxd03745e1e87b"; + text = "wlp11s0f3u2"; type = "wireless"; }; label.connected = "%essid% %signal%"; diff --git a/home/wm/bar/polybar/default.nix b/home/wm/bar/polybar/default.nix index c7001ce..13b1692 100644 --- a/home/wm/bar/polybar/default.nix +++ b/home/wm/bar/polybar/default.nix @@ -25,7 +25,7 @@ in config = mkIf cfg.enable { systemd.user.services.polybar = { # Add additional /usr/bin to run custom scripts - Service.Environment = mkForce "PATH=${pcfg.package}/bin:/run/wrappers/bin:/usr/bin"; + Service.Environment = mkForce "PATH=${pcfg.package}/bin:/run/current-system/sw/bin"; }; services.polybar = { diff --git a/home/wm/xmonad/config.hs b/home/wm/xmonad/config.hs index fd56569..8fed071 100644 --- a/home/wm/xmonad/config.hs +++ b/home/wm/xmonad/config.hs @@ -295,9 +295,9 @@ myKeys conf = mkKeymap conf $ , ("M4-l", spawn "bash ~/scripts/lock.sh") -- Change volume - , ("", spawn "amixer -qD pulse sset Master toggle") - , ("", spawn "amixer -qD pulse sset Master 5%+") - , ("", spawn "amixer -qD pulse sset Master 5%-") + , ("", spawn "amixer -q sset Master toggle") + , ("", spawn "amixer -q sset Master 5%+") + , ("", spawn "amixer -q sset Master 5%-") -- Keyboard apps , ("", spawn "gnome-calculator") diff --git a/scripts/get_volume.sh b/scripts/get_volume.sh index 2600f05..625c194 100755 --- a/scripts/get_volume.sh +++ b/scripts/get_volume.sh @@ -1,8 +1,8 @@ #!/bin/sh -enabled=$(amixer -D pulse sget Master | egrep -o "\[on\]" | wc -l) +enabled=$(amixer sget Master | egrep -o "\[on\]" | wc -l) if [[ $enabled == "0" ]]; then echo "off" else - echo $(amixer -D pulse sget Master | egrep -o "[0-9]+%" | head -n 1) + echo $(amixer sget Master | egrep -o "[0-9]+%" | head -n 1) fi exit 0 diff --git a/system/configuration.nix b/system/configuration.nix index 52f5508..b6a33d3 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -19,16 +19,24 @@ }; kernelPackages = pkgs.linuxPackages_latest; + extraModulePackages = with config.boot.kernelPackages; [ + rtl88x2bu + ]; }; networking = { - hostName = "nixos"; # Define your hostname. + hostName = "home"; # Define your hostname. networkmanager.enable = true; # The global useDHCP flag is deprecated, therefore explicitly set to false here. # Per-interface useDHCP will be mandatory in the future, so this generated config # replicates the default behaviour. useDHCP = false; + + interfaces = { + enp3s0.useDHCP = true; + wlp11s0f3u2.useDHCP = true; + }; }; # Select internationalisation properties. @@ -49,6 +57,11 @@ # Enable the X11 windowing system. services = { + # Enable the OpenSSH daemon. + openssh.enable = true; + + # Xmonad + dbus = { enable = true; packages = [ pkgs.dconf ]; @@ -69,20 +82,15 @@ }; }; - # Configure keymap in X11 - # services.xserver.xkbOptions = { - # "eurosign:e"; - # "caps:escape" # map caps to escape. - # }; - - # Enable CUPS to print documents. - # Enable sound. - sound.enable = true; - hardware.pulseaudio.enable = true; - - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; + sound = { + enable = true; + mediaKeys.enable = true; + }; + hardware.pulseaudio = { + enable = true; + package = pkgs.pulseaudioFull; + }; programs.zsh.enable = true; @@ -90,7 +98,11 @@ # Define a user account. Don't forget to set a password with ‘passwd’. users.users.janabhumi = { isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + extraGroups = [ + "wheel" # Enable ‘sudo’ for the user. + "networkmanager" + "audio" + ]; shell = pkgs.zsh; }; @@ -110,10 +122,28 @@ enableSSHSupport = true; }; - # List services that you want to enable: + nix = { + # Automate garbage collection + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; - # Enable the OpenSSH daemon. - services.openssh.enable = true; + # Flakes settings + package = pkgs.nixFlakes; + + extraOptions = '' + experimental-features = nix-command flakes + ''; + + settings = { + auto-optimise-store = true; + + trusted-users = [ "root" "janabhumi" ]; + }; + + }; # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ];