Flake: Fix shells

This commit is contained in:
soraefir 2023-11-24 16:57:46 +01:00
parent 67fd69f9bc
commit b44e6d9e5b
6 changed files with 85 additions and 77 deletions

View File

@ -31,20 +31,10 @@
outputs = inputs: outputs = inputs:
let let gen = import ./generator.nix { inherit inputs; };
gen = import ./generator.nix { inherit inputs; };
forEachSystem =
inputs.nixpkgs.lib.genAttrs [ "aarch64-linux" "x86_64-linux" ];
in { in {
devShells = forEachSystem (system: devShells = import ./shells { inherit inputs; };
let
overlays = import ./pkgs/overlay.nix { inherit pkgs; };
overrides = { custom = import ./pkgs { inherit pkgs; }; };
pkgs = import inputs.nixpkgs { inherit system overlays; }
// overrides;
in { default = import ./shells/vevsh { inherit pkgs; }; });
nixosConfigurations = { nixosConfigurations = {
valinor = gen.generate { valinor = gen.generate {

View File

@ -12,7 +12,8 @@
width = "400"; width = "400";
scale = "0"; scale = "0";
origin = "top-right"; origin = "top-right";
offset = "${config.colorScheme.colors.gaps-bar}x${config.colorScheme.colors.gaps-screen}"; offset =
"${config.colorScheme.colors.gaps-bar}x${config.colorScheme.colors.gaps-screen}";
notification_limit = "0"; notification_limit = "0";
progress_bar = "true"; progress_bar = "true";
progress_bar_height = "10"; progress_bar_height = "10";

View File

@ -1,6 +1,10 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
let let
jsonOutput = name: { pre ? "", text ? "", tooltip ? "", alt ? "", class ? "", percentage ? "" }: "${pkgs.writeShellScriptBin "waybar-${name}" '' jsonOutput = name:
{ pre ? "", text ? "", tooltip ? "", alt ? "", class ? "", percentage ? ""
}:
"${
pkgs.writeShellScriptBin "waybar-${name}" ''
set -euo pipefail set -euo pipefail
${pre} ${pre}
${pkgs.jq}/bin/jq -cn \ ${pkgs.jq}/bin/jq -cn \
@ -10,7 +14,8 @@ let
--arg class "${class}" \ --arg class "${class}" \
--arg percentage "${percentage}" \ --arg percentage "${percentage}" \
'{text:$text,tooltip:$tooltip,alt:$alt,class:$class,percentage:$percentage}' '{text:$text,tooltip:$tooltip,alt:$alt,class:$class,percentage:$percentage}'
''}/bin/waybar-${name}"; ''
}/bin/waybar-${name}";
in { in {
config = lib.mkIf (config.homecfg.wm == "Wayland") { config = lib.mkIf (config.homecfg.wm == "Wayland") {
@ -105,11 +110,8 @@ in {
settings = [{ settings = [{
"layer" = "top"; "layer" = "top";
"position" = "right"; "position" = "right";
modules-left = [ modules-left = [ "hyprland/workspaces" ];
"hyprland/workspaces" modules-center = [ ];
];
modules-center = [
];
modules-right = [ modules-right = [
"pulseaudio" "pulseaudio"
"backlight" "backlight"
@ -163,7 +165,8 @@ in {
"on-click" = "amixer -D pulse sset Master toggle -q"; "on-click" = "amixer -D pulse sset Master toggle -q";
}; };
"battery" = { "battery" = {
"interval" = 30; "states" = { "interval" = 30;
"states" = {
"warning" = 20; "warning" = 20;
"critical" = 10; "critical" = 10;
}; };
@ -174,32 +177,41 @@ in {
}; };
"clock" = { "clock" = {
"interval" = 30; "interval" = 30;
"format" = "{:<b>%H</b>\n%M}"; "format" = ''
"tooltip-format" = "<big><b>{:%d/%m/%Y}</b></big>\n<tt><small>{calendar}</small></tt>"; {:<b>%H</b>
"calendar" = { %M}'';
"months"= ""; "tooltip-format" = ''
}; <big><b>{:%d/%m/%Y}</b></big>
<tt><small>{calendar}</small></tt>'';
"calendar" = { "months" = ""; };
}; };
"memory" = { "memory" = {
"interval" = 5; "interval" = 5;
"format" = "󰍛\n{icon}"; "format" = ''
󰍛
{icon}'';
"format-icons" = [ "󰝦" "󰪞" "󰪟" "󰪠" "󰪡" "󰪢" "󰪣" "󰪤" "󰪥" ]; "format-icons" = [ "󰝦" "󰪞" "󰪟" "󰪠" "󰪡" "󰪢" "󰪣" "󰪤" "󰪥" ];
"states" = { "warning" = 85; }; "states" = { "warning" = 85; };
}; };
"cpu" = { "cpu" = {
"interval" = 1; "interval" = 1;
"format-icons" = [ "󰝦" "󰪞" "󰪟" "󰪠" "󰪡" "󰪢" "󰪣" "󰪤" "󰪥" ]; "format-icons" = [ "󰝦" "󰪞" "󰪟" "󰪠" "󰪡" "󰪢" "󰪣" "󰪤" "󰪥" ];
"format" = "󱛠\n{icon}"; "format" = ''
󱛠
{icon}'';
}; };
"custom/gpu" = { "custom/gpu" = {
"exec" = jsonOutput "gpu" { "exec" = jsonOutput "gpu" {
tooltip = ''...''; tooltip = "...";
percentage = ''$(amdgpu_top -J -n 1 | jq -r '.devices[0].GRBM2."Command Processor - Graphics".value')''; percentage = ''
$(amdgpu_top -J -n 1 | jq -r '.devices[0].GRBM2."Command Processor - Graphics".value')'';
}; };
"return-type" = "json"; "return-type" = "json";
"interval" = 5; "interval" = 5;
"format-icons" = [ "󰝦" "󰪞" "󰪟" "󰪠" "󰪡" "󰪢" "󰪣" "󰪤" "󰪥" ]; "format-icons" = [ "󰝦" "󰪞" "󰪟" "󰪠" "󰪡" "󰪢" "󰪣" "󰪤" "󰪥" ];
"format" = "󰇞\n{icon}"; "format" = ''
󰇞
{icon}'';
}; };
"network" = { "network" = {
"format-disconnected" = "󰯡"; "format-disconnected" = "󰯡";

View File

@ -1,16 +1,5 @@
{ lib { lib, rustPlatform, fetchFromGitHub, libdrm, libX11, libGL, wayland
, rustPlatform , wayland-protocols, libxkbcommon, libXrandr, libXi, libXcursor }:
, fetchFromGitHub
, libdrm
, libX11
, libGL
, wayland
, wayland-protocols
, libxkbcommon
, libXrandr
, libXi
, libXcursor
}:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "amdgpu_top"; pname = "amdgpu_top";
@ -25,7 +14,8 @@ rustPlatform.buildRustPackage rec {
cargoLock = { cargoLock = {
lockFile = ./Cargo.lock; lockFile = ./Cargo.lock;
outputHashes = { outputHashes = {
"libdrm_amdgpu_sys-0.2.2" = "sha256-2QXT/6octEzokW8+0mHx02R8qQ3kCBDxZT4yyfDkM5A="; "libdrm_amdgpu_sys-0.2.2" =
"sha256-2QXT/6octEzokW8+0mHx02R8qQ3kCBDxZT4yyfDkM5A=";
}; };
}; };

15
shells/default.nix Normal file
View File

@ -0,0 +1,15 @@
{ ... }:
let
forEachSystem =
inputs.nixpkgs.lib.genAttrs [ "aarch64-linux" "x86_64-linux" ];
in
forEachSystem (system:
let
overlays = import ./pkgs/overlay.nix { inherit pkgs; };
overrides = { custom = import ./pkgs { inherit pkgs; }; };
pkgs = import inputs.nixpkgs { inherit system overlays; } // overrides;
in {
default = import ./shells/devsh { inherit pkgs; };
devsh = import ./shells/devsh { inherit pkgs; };
}
)