Flake: Fix shells
This commit is contained in:
parent
67fd69f9bc
commit
b44e6d9e5b
14
flake.nix
14
flake.nix
@ -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 {
|
||||||
|
@ -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";
|
||||||
|
@ -1,20 +1,25 @@
|
|||||||
{ lib, config, pkgs, ... }:
|
{ lib, config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
jsonOutput = name: { pre ? "", text ? "", tooltip ? "", alt ? "", class ? "", percentage ? "" }: "${pkgs.writeShellScriptBin "waybar-${name}" ''
|
jsonOutput = name:
|
||||||
set -euo pipefail
|
{ pre ? "", text ? "", tooltip ? "", alt ? "", class ? "", percentage ? ""
|
||||||
${pre}
|
}:
|
||||||
${pkgs.jq}/bin/jq -cn \
|
"${
|
||||||
--arg text "${text}" \
|
pkgs.writeShellScriptBin "waybar-${name}" ''
|
||||||
--arg tooltip "${tooltip}" \
|
set -euo pipefail
|
||||||
--arg alt "${alt}" \
|
${pre}
|
||||||
--arg class "${class}" \
|
${pkgs.jq}/bin/jq -cn \
|
||||||
--arg percentage "${percentage}" \
|
--arg text "${text}" \
|
||||||
'{text:$text,tooltip:$tooltip,alt:$alt,class:$class,percentage:$percentage}'
|
--arg tooltip "${tooltip}" \
|
||||||
''}/bin/waybar-${name}";
|
--arg alt "${alt}" \
|
||||||
|
--arg class "${class}" \
|
||||||
|
--arg percentage "${percentage}" \
|
||||||
|
'{text:$text,tooltip:$tooltip,alt:$alt,class:$class,percentage:$percentage}'
|
||||||
|
''
|
||||||
|
}/bin/waybar-${name}";
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.homecfg.wm == "Wayland") {
|
config = lib.mkIf (config.homecfg.wm == "Wayland") {
|
||||||
|
|
||||||
home.packages = [pkgs.custom.amdgpu_top pkgs.jq];
|
home.packages = [ pkgs.custom.amdgpu_top pkgs.jq ];
|
||||||
|
|
||||||
programs.waybar = {
|
programs.waybar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -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"
|
||||||
@ -133,16 +135,16 @@ in {
|
|||||||
"focused" = "";
|
"focused" = "";
|
||||||
};
|
};
|
||||||
"persistent-workspaces" = {
|
"persistent-workspaces" = {
|
||||||
"1" = [];
|
"1" = [ ];
|
||||||
"2" = [];
|
"2" = [ ];
|
||||||
"3" = [];
|
"3" = [ ];
|
||||||
"4" = [];
|
"4" = [ ];
|
||||||
"5" = [];
|
"5" = [ ];
|
||||||
"6" = [];
|
"6" = [ ];
|
||||||
"7" = [];
|
"7" = [ ];
|
||||||
"8" = [];
|
"8" = [ ];
|
||||||
"9" = [];
|
"9" = [ ];
|
||||||
"10" = [];
|
"10" = [ ];
|
||||||
};
|
};
|
||||||
"on-scroll-up" = "hyprctl dispatch workspace r-1";
|
"on-scroll-up" = "hyprctl dispatch workspace r-1";
|
||||||
"on-scroll-down" = "hyprctl dispatch workspace r+1";
|
"on-scroll-down" = "hyprctl dispatch workspace r+1";
|
||||||
@ -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" = "";
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{ config, ... }: {
|
{ config, ... }: {
|
||||||
imports = [ ./sorahiro_soft.nix ];
|
imports = [ ./sorahiro_soft.nix ];
|
||||||
|
|
||||||
colorScheme.colors.border-radius = "#8";
|
colorScheme.colors.border-radius = "#8";
|
||||||
colorScheme.colors.border-width = "#2";
|
colorScheme.colors.border-width = "#2";
|
||||||
colorScheme.colors.gaps-screen = "#8";
|
colorScheme.colors.gaps-screen = "#8";
|
||||||
colorScheme.colors.gaps-window = "#4";
|
colorScheme.colors.gaps-window = "#4";
|
||||||
colorScheme.colors.gaps-bar = "#32";
|
colorScheme.colors.gaps-bar = "#32";
|
||||||
}
|
}
|
||||||
|
@ -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
15
shells/default.nix
Normal 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; };
|
||||||
|
}
|
||||||
|
)
|
Loading…
x
Reference in New Issue
Block a user