This commit is contained in:
Varris 2022-10-04 00:21:40 +02:00
parent 9eefc46557
commit 4e4474f255
15 changed files with 300 additions and 322 deletions

View File

@ -1,5 +1,21 @@
{ {
"nodes": { "nodes": {
"bobthefish": {
"flake": false,
"locked": {
"lastModified": 1659411664,
"narHash": "sha256-jBbm0wTNZ7jSoGFxRkTz96QHpc5ViAw9RGsRBkCQEIU=",
"owner": "oh-my-fish",
"repo": "theme-bobthefish",
"rev": "2dcfcab653ae69ae95ab57217fe64c97ae05d8de",
"type": "github"
},
"original": {
"owner": "oh-my-fish",
"repo": "theme-bobthefish",
"type": "github"
}
},
"gamescope-git": { "gamescope-git": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -92,11 +108,11 @@
"mesa-git": { "mesa-git": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1664631406, "lastModified": 1664825548,
"narHash": "sha256-ouwR0GAYp/0BxSiI/KtcmiTuvPqfsF77pKemA0J0hbM=", "narHash": "sha256-bt3/6JLi+DeGLHJlteuViLUvP7lA1lyLLLhsCf43YqI=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "3246889fb047c54623795956a3b4890e672f05ef", "rev": "e577bb18c8da40905ab2d4d56b9c6f96c619d96c",
"revCount": 160795, "revCount": 160837,
"type": "git", "type": "git",
"url": "https://gitlab.freedesktop.org/mesa/mesa.git" "url": "https://gitlab.freedesktop.org/mesa/mesa.git"
}, },
@ -138,6 +154,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"bobthefish": "bobthefish",
"gamescope-git": "gamescope-git", "gamescope-git": "gamescope-git",
"grub2-themes": "grub2-themes", "grub2-themes": "grub2-themes",
"home-manager": "home-manager", "home-manager": "home-manager",

107
flake.nix
View File

@ -9,6 +9,12 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# Fish Plugins
bobthefish = {
url = "github:oh-my-fish/theme-bobthefish";
flake = false;
};
# Kakoune Plugins # Kakoune Plugins
kakoune-smarttab = { kakoune-smarttab = {
url = "github:andreyorst/smarttab.kak"; url = "github:andreyorst/smarttab.kak";
@ -56,14 +62,9 @@
url = "github:vinceliuice/grub2-themes"; url = "github:vinceliuice/grub2-themes";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
veloren = {
url = "github:veloren/veloren";
};
}; };
outputs = { self, nixpkgs, home-manager, veloren, ... }@inputs: outputs = { self, nixpkgs, home-manager, ... }@inputs:
let let
username = "manuel"; username = "manuel";
hostname = "terra"; hostname = "terra";
@ -80,34 +81,22 @@
}; };
in in
{ {
overlays.default = (final: prev: rec { overlays.default = final: prev: rec {
nerdfonts = prev.nerdfonts.override { fonts = [ "JetBrainsMono" ]; };
nerdfonts = prev.nerdfonts.override {
fonts = [
"JetBrainsMono"
];
};
wlroots-git = prev.wlroots.overrideAttrs (old: { wlroots-git = prev.wlroots.overrideAttrs (old: {
version = "0.16.0"; version = "git";
src = inputs.wlroots-git; src = inputs.wlroots-git;
}); });
sway-unwrapped = (prev.sway-unwrapped.overrideAttrs (old: { sway-unwrapped = (prev.sway-unwrapped.overrideAttrs (old: {
version = "1.8"; version = "git";
buildInputs = old.buildInputs ++ [ buildInputs = old.buildInputs ++ [ prev.xorg.xcbutilwm prev.pcre2 ];
prev.xorg.xcbutilwm nativeBuildInputs = old.nativeBuildInputs ++ [ prev.cmake ];
prev.pcre2
];
nativeBuildInputs = old.nativeBuildInputs ++ [
prev.cmake
];
src = inputs.sway-git; src = inputs.sway-git;
})).override { wlroots = wlroots-git; }; })).override { wlroots = wlroots-git; };
waybar = prev.waybar.override { waybar = prev.waybar.override { wlroots = wlroots-git; };
wlroots = wlroots-git;
};
# xwayland = prev.xwayland.overrideAttrs (old: { # xwayland = prev.xwayland.overrideAttrs (old: {
# version = "22.2"; # version = "22.2";
@ -128,58 +117,52 @@
}; };
gamescope = prev.gamescope.overrideAttrs (old: { gamescope = prev.gamescope.overrideAttrs (old: {
version = "3.11.45"; version = "git";
src = inputs.gamescope-git; src = inputs.gamescope-git;
}); });
mesa-git = (prev.mesa.overrideAttrs (old: { mesa-git = (prev.mesa.overrideAttrs (old: {
version = "23.0"; version = "git";
src = inputs.mesa-git; src = inputs.mesa-git;
buildInputs = old.buildInputs ++ [ buildInputs = old.buildInputs ++ [ pkgs.glslang ];
pkgs.glslang
];
patches = [ patches = [
./pkgs/mesa-git/opencl.patch ./pkgs/mesa-git/opencl.patch
./pkgs/mesa-git/disk_cache-include-dri-driver-path-in-cache-key.patch ./pkgs/mesa-git/disk_cache-include-dri-driver-path-in-cache-key.patch
]; ];
mesonFlags = pkgs.lib.lists.remove
"-Dxvmc-libs-path=${placeholder "drivers"}/lib"
old.mesonFlags; # xvmc was removed upstream
})).override { })).override {
galliumDrivers = [ "radeonsi" "swrast" ]; galliumDrivers = [ "radeonsi" "swrast" ];
vulkanDrivers = [ "amd" ]; vulkanDrivers = [ "amd" ];
enableGalliumNine = false; # Replaced by DXVK enableGalliumNine = false; # Replaced by DXVK
}; };
inherit (veloren.packages."${system}") veloren-voxygen; fzf = prev.fzf.overrideAttrs (old: { version = "0.33.0"; });
};
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt;
}); nixosConfigurations.${hostname} = nixpkgs.lib.nixosSystem {
inherit system;
nixosConfigurations.${hostname} = nixpkgs.lib.nixosSystem inherit pkgs;
{ specialArgs = { inherit inputs; };
inherit system; modules = [
inherit pkgs; {
specialArgs = { inherit inputs; }; #needed to get tools working that expect a nixpkgs channel to exist
modules = [ nix.nixPath = [ "nixpkgs=${nixpkgs}" ];
{ nix.registry = { nixpkgs.flake = nixpkgs; };
#needed to get tools working that expect a nixpkgs channel to exist }
nix.nixPath = [ "nixpkgs=${nixpkgs}" ]; ./system/configuration.nix
nix.registry = { home-manager.nixosModules.home-manager
nixpkgs.flake = nixpkgs; {
}; home-manager = {
} useUserPackages = true;
./system/configuration.nix users.${username} = import ./user/home.nix;
home-manager.nixosModules.home-manager extraSpecialArgs = { inherit inputs pkgs; };
{ };
home-manager = { }
#useGlobalPkgs = true; inputs.grub2-themes.nixosModule
useUserPackages = true; ];
users.${username} = import ./user/home.nix; };
extraSpecialArgs = {
inherit inputs pkgs;
};
};
}
inputs.grub2-themes.nixosModule
];
};
}; };
} }

View File

@ -1,26 +1,19 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, lib, inputs, ... }: {
{ config, pkgs, lib, ... }: imports = [
# Include the results of the hardware scan.
{ ./hardware-configuration.nix
imports = ];
[
# Include the results of the hardware scan.
./hardware-configuration.nix
];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
boot = { boot = {
consoleLogLevel = 3; consoleLogLevel = 3;
kernelParams = [ kernelParams =
"quiet" [ "quiet" "udev.log_level=3" "amdgpu.ppfeaturemask=0xffffffff" ];
"udev.log_level=3"
"amdgpu.ppfeaturemask=0xffffffff"
];
loader = { loader = {
efi = { efi = {
@ -45,14 +38,13 @@
initrd.availableKernelModules = [ "amdgpu" ]; initrd.availableKernelModules = [ "amdgpu" ];
kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.linuxPackages_latest;
kernelModules = [ "i2c-dev" "i2c-piix4" ]; kernelModules = [ "i2c-dev" "i2c-piix4" ];
}; };
powerManagement = { cpuFreqGovernor = "schedutil"; };
networking = { networking = {
hostName = "terra"; # Define your hostname. hostName = "terra"; # Define your hostname.
networkmanager = { networkmanager = { enable = true; };
enable = true;
};
firewall.checkReversePath = false; firewall.checkReversePath = false;
}; };
@ -80,9 +72,7 @@
enable = true; enable = true;
package = pkgs.mesa-git.drivers; package = pkgs.mesa-git.drivers;
package32 = pkgs.pkgsi686Linux.mesa-git.drivers; package32 = pkgs.pkgsi686Linux.mesa-git.drivers;
extraPackages = [ extraPackages = [ pkgs.libvdpau-va-gl ];
pkgs.libvdpau-va-gl
];
driSupport = true; driSupport = true;
driSupport32Bit = true; driSupport32Bit = true;
@ -105,8 +95,7 @@
enable = true; enable = true;
locate = pkgs.plocate; locate = pkgs.plocate;
localuser = null; localuser = null;
prunePaths = lib.mkOptionDefault [ prunePaths = lib.mkOptionDefault [ ];
];
interval = "hourly"; interval = "hourly";
}; };
@ -130,6 +119,11 @@
programs.fish.enable = true; programs.fish.enable = true;
programs.ccache = {
enable = true;
packageNames = [
];
};
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.manuel = { users.users.manuel = {
@ -189,9 +183,7 @@
]; ];
}; };
services.openssh = { services.openssh = { enable = true; };
enable = true;
};
services.printing = { services.printing = {
enable = true; enable = true;
@ -227,6 +219,4 @@
''; '';
system.stateVersion = "22.05"; # Did you read the comment? system.stateVersion = "22.05"; # Did you read the comment?
} }

View File

@ -1,42 +1,34 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }: {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
{ boot.initrd.availableKernelModules =
imports = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/5907e244-fda6-41d4-aff1-a2be7160a559";
device = "/dev/disk/by-uuid/5907e244-fda6-41d4-aff1-a2be7160a559"; fsType = "xfs";
fsType = "xfs"; };
};
fileSystems."/boot/efi" = fileSystems."/boot/efi" = {
{ device = "/dev/disk/by-uuid/D56E-61DC";
device = "/dev/disk/by-uuid/D56E-61DC"; fsType = "vfat";
fsType = "vfat"; };
};
fileSystems."/mnt/hdd" = fileSystems."/mnt/hdd" = {
{ device = "/dev/disk/by-uuid/ecbbfb05-ada8-4044-81a6-9a280f93802f";
device = "/dev/disk/by-uuid/ecbbfb05-ada8-4044-81a6-9a280f93802f"; fsType = "xfs";
fsType = "xfs"; };
};
fileSystems."/home" = fileSystems."/home" = {
{ device = "/dev/disk/by-uuid/4dd7a8ea-311a-458b-8839-1d92c7abab1f";
device = "/dev/disk/by-uuid/4dd7a8ea-311a-458b-8839-1d92c7abab1f"; fsType = "xfs";
fsType = "xfs"; };
};
swapDevices = swapDevices =
[{ device = "/dev/disk/by-uuid/e0d93baa-8a8f-4fb2-9a48-f37f5d397826"; }]; [{ device = "/dev/disk/by-uuid/e0d93baa-8a8f-4fb2-9a48-f37f5d397826"; }];
@ -49,5 +41,6 @@
# networking.interfaces.enp8s0.useDHCP = lib.mkDefault true; # networking.interfaces.enp8s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true; # networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

View File

@ -1,5 +1,4 @@
{ config, pkgs, ... }: { { config, pkgs, ... }: {
programs.beets = { programs.beets = {
enable = true; enable = true;
@ -16,22 +15,18 @@
}; };
paths = { paths = {
"default" = "%asciify{$albumartist}/$year - %asciify{$album}%aunique{}/$track %asciify{$title}"; "default" =
"%asciify{$albumartist}/$year - %asciify{$album}%aunique{}/$track %asciify{$title}";
"singleton" = "Non-Album/%asciify{$artist}/%asciify{$title}"; "singleton" = "Non-Album/%asciify{$artist}/%asciify{$title}";
"comp" = "Compilations/%asciify{$album}%aunique{}/$track %asciify{$title}"; "comp" =
"Compilations/%asciify{$album}%aunique{}/$track %asciify{$title}";
}; };
ftintitle = { ftintitle = { "auto" = true; };
"auto" = true;
};
fetchart = { fetchart = { "auto" = true; };
"auto" = true;
};
chroma = { chroma = { auto = true; };
auto = true;
};
replaygain = { replaygain = {
"backend" = "gstreamer"; "backend" = "gstreamer";
@ -40,4 +35,3 @@
}; };
}; };
} }

View File

@ -4,4 +4,3 @@
enableFishIntegration = true; enableFishIntegration = true;
}; };
} }

View File

@ -1,7 +1 @@
{ config, pkgs, ... }: { config, pkgs, ... }: { programs.firefox = { enable = true; }; }
{
programs.firefox = {
enable = true;
};
}

View File

@ -1,5 +1,4 @@
{ config, pkgs, ... }: { config, pkgs, inputs, ... }: {
{
programs.exa = { programs.exa = {
enable = true; enable = true;
enableAliases = true; enableAliases = true;
@ -7,29 +6,38 @@
programs.fish = { programs.fish = {
enable = true; enable = true;
plugins = [
{
name = "bobthefish";
src = inputs.bobthefish;
}
];
interactiveShellInit = '' interactiveShellInit = ''
${pkgs.any-nix-shell}/bin/any-nix-shell fish --info-right | source ${pkgs.any-nix-shell}/bin/any-nix-shell fish --info-right | source
set theme_color_scheme gruvbox
''; '';
functions = { functions = {
fish_prompt = '' #fish_prompt = ''
set_color green # set_color green
printf (prompt_pwd) # printf (prompt_pwd)
set_color cyan # set_color cyan
printf " " # printf " ► "
set_color normal # set_color normal
''; #'';
fish_greeting = ""; fish_greeting = "";
ec = '' ec = ''
pushd &> /dev/null pushd &> /dev/null
cd "${config.home.homeDirectory}" cd "${config.home.homeDirectory}"
set "filename" (${pkgs.fd}/bin/fd -t f . ~/.dotfiles | \ set "filename" (${pkgs.fd}/bin/fd -t f . ~/.dotfiles | \
${pkgs.fzf}/bin/fzf -q "$argv[1]" \ ${pkgs.fzf}/bin/fzf -q "$argv[1]" \
--preview "${pkgs.python3Packages.pygments}/bin/pygmentize -g -O linenos=1 {}") --preview "${pkgs.python3Packages.pygments}/bin/pygmentize -g -O linenos=1 {}")
if test -f "$filename" if test -f "$filename"
$EDITOR $filename $EDITOR $filename
end end
popd &> /dev/null popd &> /dev/null
''; '';
nor = '' nor = ''
@ -53,4 +61,3 @@
}; };
}; };
} }

View File

@ -9,9 +9,7 @@ let
name = "sort-selections-kak"; name = "sort-selections-kak";
src = inputs.kakoune-sort-selections; src = inputs.kakoune-sort-selections;
}; };
in {
in
{
programs.kakoune = { programs.kakoune = {
enable = true; enable = true;
plugins = with pkgs.kakounePlugins; [ plugins = with pkgs.kakounePlugins; [
@ -27,26 +25,34 @@ in
tabStop = 4; tabStop = 4;
indentWidth = 4; indentWidth = 4;
showMatching = true; showMatching = true;
showWhitespace = { showWhitespace = { enable = false; };
enable = false;
};
numberLines.enable = true; numberLines.enable = true;
hooks = [ hooks = [
{ name = "WinSetOption"; option = "filetype=nix|sh"; commands = "hook window BufWritePre .* lsp-formatting-sync"; } {
name = "WinSetOption";
option = "filetype=nix|sh";
commands = "hook window BufWritePre .* lsp-formatting-sync";
}
{ name = "WinCreate"; option = ".*"; commands = "kakboard-enable"; } {
{ name = "InsertChar"; option = "\\t"; commands = "exec -draft -itersel h@"; } name = "WinCreate";
option = ".*";
commands = "kakboard-enable";
}
{
name = "InsertChar";
option = "\\t";
commands = "exec -draft -itersel h@";
}
]; ];
keyMappings = [ keyMappings = [ ];
];
ui = { ui = {
assistant = "none"; assistant = "none";
setTitle = true; setTitle = true;
}; };
}; };
extraConfig = '' extraConfig = ''
set global startup_info_version 99999999 set global startup_info_version 99999999
@ -64,8 +70,5 @@ in
''; '';
}; };
home.packages = [ home.packages = [ pkgs.rnix-lsp ];
pkgs.rnix-lsp
];
} }

View File

@ -1,5 +1,4 @@
{ config, pkgs, ... }: { config, pkgs, ... }: {
{
services.mpd = { services.mpd = {
enable = true; enable = true;
musicDirectory = "/mnt/hdd/Music"; musicDirectory = "/mnt/hdd/Music";
@ -51,9 +50,7 @@
programs.ncmpcpp = { programs.ncmpcpp = {
enable = true; enable = true;
package = pkgs.ncmpcpp.override { package = pkgs.ncmpcpp.override { visualizerSupport = true; };
visualizerSupport = true;
};
settings = { settings = {
visualizer_data_source = "/tmp/mpd.fifo"; visualizer_data_source = "/tmp/mpd.fifo";
visualizer_output_name = "my_fifo"; visualizer_output_name = "my_fifo";
@ -70,7 +67,8 @@
alternative_header_second_line_format = "$7{%t}|{%f}$0"; alternative_header_second_line_format = "$7{%t}|{%f}$0";
progressbar_look = " "; progressbar_look = " ";
song_columns_list_format = "(25)[5]{a:artist} (3f)[5]{n: } (50)[cyan]{t|f:title} (5)[cyan]{lr:duration}"; song_columns_list_format =
"(25)[5]{a:artist} (3f)[5]{n: } (50)[cyan]{t|f:title} (5)[cyan]{lr:duration}";
playlist_display_mode = "columns"; playlist_display_mode = "columns";
browser_display_mode = "columns"; browser_display_mode = "columns";
search_engine_display_mode = "columns"; search_engine_display_mode = "columns";
@ -90,4 +88,3 @@
multimediaKeys = false; multimediaKeys = false;
}; };
} }

View File

@ -1,13 +1,12 @@
{ config, pkgs, ... }: { config, pkgs, ... }: {
{ programs.mpv = {
programs.mpv = { enable = true;
enable = true; config = {
config = { profile = "gpu-hq";
profile = "gpu-hq"; ytdl-format = "bestvideo+bestaudio";
ytdl-format = "bestvideo+bestaudio"; hwdec = "vaapi-copy";
hwdec = "vaapi-copy"; gpu-context = "wayland";
gpu-context = "wayland"; force-window = "yes";
force-window = "yes";
};
}; };
};
} }

View File

@ -1,8 +1,6 @@
{ configs, pkgs, ... }: { { configs, pkgs, ... }: {
programs.nnn = { programs.nnn = {
enable = true; enable = true;
package = pkgs.nnn.override ({ withNerdIcons = true; }); package = pkgs.nnn.override { withNerdIcons = true; };
}; };
} }

View File

@ -6,79 +6,74 @@ let
left_monitor = "HDMI-A-1"; left_monitor = "HDMI-A-1";
right_monitor = "DP-1"; right_monitor = "DP-1";
wob-voldaemon = pkgs.writeShellScriptBin "wob-volumedaemon.sh" wob-voldaemon = pkgs.writeShellScriptBin "wob-volumedaemon.sh" ''
'' if pgrep "wob"; then
if pgrep "wob"; then killall wob &> /dev/null
killall wob &> /dev/null fi
fi
if [[ -e "${wobsock}" ]]; then if [[ -e "${wobsock}" ]]; then
rm "${wobsock}" rm "${wobsock}"
fi fi
mkfifo "${wobsock}" mkfifo "${wobsock}"
tail -f "${wobsock}" | ${pkgs.wob}/bin/wob --border-color "#D65D0EFF" --background-color "#282828FF" --bar-color "#D65D0EFF" -b 2 -H 40 & tail -f "${wobsock}" | ${pkgs.wob}/bin/wob --border-color "#D65D0EFF" --background-color "#282828FF" --bar-color "#D65D0EFF" -b 2 -H 40 &
echo "wob: started" echo "wob: started"
''; '';
passmenu = pkgs.writeShellScriptBin "passmenu.sh" passmenu = pkgs.writeShellScriptBin "passmenu.sh" ''
'' shopt -s nullglob globstar
shopt -s nullglob globstar
prefix=''${PASSWORD_STORE_DIR-~/.password-store} prefix=''${PASSWORD_STORE_DIR-~/.password-store}
password_files=( "$prefix"/**/*.gpg ) password_files=( "$prefix"/**/*.gpg )
password_files=( "''${password_files[@]#"$prefix"/}" ) password_files=( "''${password_files[@]#"$prefix"/}" )
password_files=( "''${password_files[@]%.gpg}" ) password_files=( "''${password_files[@]%.gpg}" )
password=$(printf '%s\n' "''${password_files[@]}" | ${pkgs.rofi-wayland}/bin/rofi -dmenu -p "pass" "$@") password=$(printf '%s\n' "''${password_files[@]}" | ${pkgs.rofi-wayland}/bin/rofi -dmenu -p "pass" "$@")
[[ -n $password ]] || exit [[ -n $password ]] || exit
pass show -c "$password" 2>/dev/null pass show -c "$password" 2>/dev/null
''; '';
xwaylandSetPrimary = pkgs.writeShellScriptBin "xwayland-setprimary.sh" xwaylandSetPrimary = pkgs.writeShellScriptBin "xwayland-setprimary.sh" ''
'' DSP=$(${pkgs.xorg.xrandr}/bin/xrandr | awk '/2560x1440/ {print $1}' | head -n 1)
DSP=$(${pkgs.xorg.xrandr}/bin/xrandr | awk '/2560x1440/ {print $1}' | head -n 1)
${pkgs.xorg.xrandr}/bin/xrandr --output "$DSP" --primary ${pkgs.xorg.xrandr}/bin/xrandr --output "$DSP" --primary
echo "Xwayland: $DSP - Primary monitor set" echo "Xwayland: $DSP - Primary monitor set"
''; '';
rofi-theme = inputs.rofi-theme + "/gruvbox-dark.rasi"; rofi-theme = inputs.rofi-theme + "/gruvbox-dark.rasi";
killprocess = pkgs.writeShellScriptBin "killprocess.sh" killprocess = pkgs.writeShellScriptBin "killprocess.sh" ''
'' ps -x -o pid=,comm= | column -t -o " " | rofi -dmenu -p "kill process" | awk '{print $1}' | uniq | xargs -r kill -9
ps -x -o pid=,comm= | column -t -o " " | rofi -dmenu -p "kill process" | awk '{print $1}' | uniq | xargs -r kill -9 '';
''; in {
in
{
imports = [ ./waybar.nix ]; imports = [ ./waybar.nix ];
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
config = { config = {
modifier = "Mod4"; modifier = "Mod4";
terminal = "${pkgs.foot}/bin/foot"; terminal = "${pkgs.foot}/bin/foot";
gaps = { gaps = { inner = 20; };
inner = 20;
};
keybindings = keybindings =
let let modifier = config.wayland.windowManager.sway.config.modifier;
modifier = config.wayland.windowManager.sway.config.modifier; in lib.mkOptionDefault {
in "XF86AudioRaiseVolume" =
lib.mkOptionDefault { "exec ${pkgs.pamixer}/bin/pamixer -i 10 --get-volume > ${wobsock}";
"XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -i 10 --get-volume > ${wobsock}"; "XF86AudioLowerVolume" =
"XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -d 10 --get-volume > ${wobsock}"; "exec ${pkgs.pamixer}/bin/pamixer -d 10 --get-volume > ${wobsock}";
"Mod5+F9" = "exec ${pkgs.mpc-cli}/bin/mpc stop"; "Mod5+F9" = "exec ${pkgs.mpc-cli}/bin/mpc stop";
"Mod5+F11" = "exec ${pkgs.mpc-cli}/bin/mpc toggle"; "Mod5+F11" = "exec ${pkgs.mpc-cli}/bin/mpc toggle";
"Mod5+F10" = "exec ${pkgs.mpc-cli}/bin/mpc prev"; "Mod5+F10" = "exec ${pkgs.mpc-cli}/bin/mpc prev";
"Mod5+F12" = "exec ${pkgs.mpc-cli}/bin/mpc next"; "Mod5+F12" = "exec ${pkgs.mpc-cli}/bin/mpc next";
"XF86AudioMute" = "exec mpc toggle"; "XF86AudioMute" = "exec mpc toggle";
"Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot -c --notify copy screen"; "Print" =
"${modifier}+Shift+Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot -c --notify copy area"; "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot -c --notify copy screen";
"${modifier}+Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot -c --notify copy active"; "${modifier}+Shift+Print" =
"exec ${pkgs.sway-contrib.grimshot}/bin/grimshot -c --notify copy area";
"${modifier}+Print" =
"exec ${pkgs.sway-contrib.grimshot}/bin/grimshot -c --notify copy active";
"${modifier}+d" = "exec ${pkgs.rofi-wayland}/bin/rofi -show drun"; "${modifier}+d" = "exec ${pkgs.rofi-wayland}/bin/rofi -show drun";
"${modifier}+Shift+p" = "exec ${passmenu}/bin/passmenu.sh"; "${modifier}+Shift+p" = "exec ${passmenu}/bin/passmenu.sh";
@ -95,20 +90,15 @@ in
xkb_layout = "us"; xkb_layout = "us";
xkb_variant = "altgr-intl"; xkb_variant = "altgr-intl";
}; };
"type:pointer" = { "type:pointer" = { accel_profile = "flat"; };
accel_profile = "flat";
};
"type:touchpad" = { "type:touchpad" = {
events = "disabled"; #disable DualSense touchpad. Let Steam Input handle it events =
"disabled"; # disable DualSense touchpad. Let Steam Input handle it
}; };
}; };
output = { output = {
"*" = { "*" = { bg = "${wallpaper} stretch"; };
bg = "${wallpaper} stretch"; "${left_monitor}" = { position = "0 0"; };
};
"${left_monitor}" = {
position = "0 0";
};
"${right_monitor}" = { "${right_monitor}" = {
position = "1920 0"; position = "1920 0";
adaptive_sync = "on"; adaptive_sync = "on";
@ -116,26 +106,53 @@ in
}; };
workspaceOutputAssign = [ workspaceOutputAssign = [
{
workspace = "1";
output = "${right_monitor}";
}
{
workspace = "2";
output = "${right_monitor}";
}
{
workspace = "3";
output = "${right_monitor}";
}
{ workspace = "1"; output = "${right_monitor}"; } {
{ workspace = "2"; output = "${right_monitor}"; } workspace = "4";
{ workspace = "3"; output = "${right_monitor}"; } output = "${left_monitor}";
}
{ workspace = "4"; output = "${left_monitor}"; } {
{ workspace = "5"; output = "${left_monitor}"; } workspace = "5";
{ workspace = "6"; output = "${left_monitor}"; } output = "${left_monitor}";
}
{
workspace = "6";
output = "${left_monitor}";
}
]; ];
startup = [ startup = [
{ command = "${wob-voldaemon}/bin/wob-volumedaemon.sh"; always = true; } {
{ command = "${xwaylandSetPrimary}/bin/xwayland-setprimary.sh"; always = true; } command = "${wob-voldaemon}/bin/wob-volumedaemon.sh";
{ command = "${pkgs.autotiling}/bin/autotiling"; always = true; } always = true;
{ command = "${pkgs.openrgb}/bin/openrgb --server --profile autorun.orp"; } }
{
command = "${xwaylandSetPrimary}/bin/xwayland-setprimary.sh";
always = true;
}
{
command = "${pkgs.autotiling}/bin/autotiling";
always = true;
}
{
command =
"${pkgs.openrgb}/bin/openrgb --server --profile autorun.orp";
}
{ command = "${pkgs.networkmanagerapplet}/bin/nm-applet --indicator"; } { command = "${pkgs.networkmanagerapplet}/bin/nm-applet --indicator"; }
]; ];
bars = [{ bars = [{ command = "${pkgs.waybar}/bin/waybar"; }];
command = "${pkgs.waybar}/bin/waybar";
}];
colors = { colors = {
focused = { focused = {
border = "#d65d0e"; border = "#d65d0e";
@ -173,9 +190,7 @@ in
extraSessionCommands = '' extraSessionCommands = ''
export MOZ_ENABLE_WAYLAND=1 export MOZ_ENABLE_WAYLAND=1
''; '';
wrapperFeatures = { wrapperFeatures = { gtk = true; };
gtk = true;
};
}; };
programs.mako = { programs.mako = {
@ -238,8 +253,5 @@ in
}; };
}; };
home.packages = [ home.packages = [ pkgs.wl-clipboard ];
pkgs.wl-clipboard
];
} }

View File

@ -1,28 +1,24 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
ds-battery = pkgs.writeShellScriptBin "ds-battery.sh" ''
ds_capacity_file="/sys/class/power_supply/ps-controller-battery-4c:b9:9b:74:ae:31/capacity"
ds_status_file="/sys/class/power_supply/ps-controller-battery-4c:b9:9b:74:ae:31/status"
ds-battery = pkgs.writeShellScriptBin "ds-battery.sh" while true; do
'' if [[ -f $ds_capacity_file ]]; then
ds_capacity_file="/sys/class/power_supply/ps-controller-battery-4c:b9:9b:74:ae:31/capacity" charge=$(<"$ds_capacity_file")
ds_status_file="/sys/class/power_supply/ps-controller-battery-4c:b9:9b:74:ae:31/status" if [[ $(<"$ds_status_file") == "Charging" ]]; then
echo "{\"class\":\"charging\",\"text\":\" Charging: $charge%\",\"tooltip\":\"Charging:\n$charge%\"}"
while true; do else
if [[ -f $ds_capacity_file ]]; then echo "{\"class\":\"discharging\",\"text\":\" $charge%\",\"tooltip\":\"Battery:\\n$charge%\"}"
charge=$(<"$ds_capacity_file") fi
if [[ $(<"$ds_status_file") == "Charging" ]]; then else
echo "{\"class\":\"charging\",\"text\":\" Charging: $charge%\",\"tooltip\":\"Charging:\n$charge%\"}" echo "{\"class\":\"not_connected\",\"text\":\"\"}"
else fi
echo "{\"class\":\"discharging\",\"text\":\" $charge%\",\"tooltip\":\"Battery:\\n$charge%\"}" sleep 1
fi done
else '';
echo "{\"class\":\"not_connected\",\"text\":\"\"}" in {
fi
sleep 1
done
'';
in
{
programs.waybar = { programs.waybar = {
enable = true; enable = true;
settings = [{ settings = [{
@ -32,19 +28,23 @@ in
modules-left = [ "custom/blank" "sway/workspaces" "sway/mode" ]; modules-left = [ "custom/blank" "sway/workspaces" "sway/mode" ];
modules-center = [ "sway/window" ]; modules-center = [ "sway/window" ];
modules-right = [ "custom/ds-battery" "pulseaudio" "mpd" "tray" "custom/blank" "clock" "custom/blank" ]; modules-right = [
"custom/ds-battery"
"pulseaudio"
"mpd"
"tray"
"custom/blank"
"clock"
"custom/blank"
];
"sway/mode" = { "sway/mode" = { format = " {}"; };
format = " {}";
};
"sway/window" = { "sway/window" = {
icon = false; icon = false;
icon-size = 16; icon-size = 16;
}; };
"clock" = { "clock" = { format = "{:%a %d. %B %H:%M}"; };
format = "{:%a %d. %B %H:%M}";
};
"pulseaudio" = { "pulseaudio" = {
scroll-step = 5; scroll-step = 5;
@ -57,7 +57,8 @@ in
spacing = 10; spacing = 10;
}; };
"mpd" = { "mpd" = {
format = "{stateIcon} {artist} - {title} {elapsedTime:%M:%S}/{totalTime:%M:%S}"; format =
"{stateIcon} {artist} - {title} {elapsedTime:%M:%S}/{totalTime:%M:%S}";
format-stopped = " stopped"; format-stopped = " stopped";
state-icons = { state-icons = {
playing = ""; playing = "";
@ -70,10 +71,7 @@ in
exec = "${ds-battery}/bin/ds-battery.sh"; exec = "${ds-battery}/bin/ds-battery.sh";
escape = "true"; escape = "true";
}; };
"custom/blank" = { "custom/blank" = { format = " "; };
format = " ";
};
}]; }];
style = '' style = ''
@define-color foreground #EBDBB2; @define-color foreground #EBDBB2;

View File

@ -1,6 +1,4 @@
{ config, pkgs, inputs, ... }: { config, pkgs, inputs, ... }: {
{
imports = [ imports = [
./configs/beets/beets.nix ./configs/beets/beets.nix
./configs/kakoune/kakoune.nix ./configs/kakoune/kakoune.nix
@ -35,9 +33,9 @@
pkgs.sxiv pkgs.sxiv
pkgs.thunderbird pkgs.thunderbird
pkgs.twemoji-color-font pkgs.twemoji-color-font
pkgs.veloren-voxygen
pkgs.wineWowPackages.stagingFull pkgs.wineWowPackages.stagingFull
#pkgs.xivlauncher #pkgs.xivlauncher
pkgs.xarchiver
]; ];
home.sessionVariables = { home.sessionVariables = {
@ -48,9 +46,7 @@
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
services.gpg-agent = { services.gpg-agent = { enable = true; };
enable = true;
};
services.udiskie.enable = true; services.udiskie.enable = true;
@ -86,7 +82,6 @@
name = "capitaine-cursors-white"; name = "capitaine-cursors-white";
size = 32; size = 32;
}; };
}; };
programs.git = { programs.git = {
@ -129,4 +124,3 @@
# changes in each release. # changes in each release.
home.stateVersion = "22.05"; home.stateVersion = "22.05";
} }