mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2024-11-15 05:13:10 +01:00
configured a spotify widget for waybar
This commit is contained in:
parent
b58ae611b6
commit
8f78e1f843
18
flake.lock
18
flake.lock
|
@ -185,11 +185,11 @@
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1685729674,
|
"lastModified": 1685808451,
|
||||||
"narHash": "sha256-i5+/bAZVmCbeIKmnwyd2DG3mGrP4LOJWbsU7nJ1lzuA=",
|
"narHash": "sha256-IxiTI9WDvhIM8ciAmBX+EARu/B4h+quWLo/8w86tXrc=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "Hyprland",
|
"repo": "Hyprland",
|
||||||
"rev": "871ab24c6e9d2fb6e48cbf990ddddf0c46a950af",
|
"rev": "df98db50924c05f0bd7a8c95cdab5d4ece13a1f1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -307,11 +307,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1683638468,
|
"lastModified": 1685764721,
|
||||||
"narHash": "sha256-tQEaGZfZ2Hpw+XIVEHaJ8FaF1yNQyMDDhUyIQ7LTIEg=",
|
"narHash": "sha256-CIy1iwQTEKfZRrid4gBLA+r/LPGA9IUFo0lKJVyECGI=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "nix-index-database",
|
"repo": "nix-index-database",
|
||||||
"rev": "219067a5e3cf4b9581c8b4fcfc59ecd5af953d07",
|
"rev": "669ca1f2e2bc401abab6b837ae9c51503edc9b49",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -618,11 +618,11 @@
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"host": "gitlab.freedesktop.org",
|
"host": "gitlab.freedesktop.org",
|
||||||
"lastModified": 1685723274,
|
"lastModified": 1685803001,
|
||||||
"narHash": "sha256-mjETVZbVheaSO0VRKQHWYAHcoKwYu0WZ0vhKVN7vyRo=",
|
"narHash": "sha256-yxq/U9zL1ssFZtgT27A96UKteCiKb3zSmbA/dokK76U=",
|
||||||
"owner": "wlroots",
|
"owner": "wlroots",
|
||||||
"repo": "wlroots",
|
"repo": "wlroots",
|
||||||
"rev": "6668c822b3bf58ca5af5d370ef03b075be3e4d27",
|
"rev": "b61d5922f1d0910a848deb100570ad8587aea38d",
|
||||||
"type": "gitlab"
|
"type": "gitlab"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -60,9 +60,12 @@
|
||||||
, simple-nixos-mailserver
|
, simple-nixos-mailserver
|
||||||
, ...
|
, ...
|
||||||
}@attrs: {
|
}@attrs: {
|
||||||
packages.x86_64-linux.iso = self.nixosConfigurations.iso.config.system.build.isoImage;
|
packages.x86_64-linux = {
|
||||||
packages.x86_64-linux.jmri = nixpkgs.legacyPackages.x86_64-linux.callPackage ./pkgs/jmri { };
|
iso = self.nixosConfigurations.iso.config.system.build.isoImage;
|
||||||
packages.x86_64-linux.adguardian-term = nixpkgs.legacyPackages.x86_64-linux.callPackage ./pkgs/adguardian-term { };
|
jmri = nixpkgs.legacyPackages.x86_64-linux.callPackage ./pkgs/jmri { };
|
||||||
|
adguardian-term = nixpkgs.legacyPackages.x86_64-linux.callPackage ./pkgs/adguardian-term { };
|
||||||
|
pww = nixpkgs.legacyPackages.x86_64-linux.callPackage ./pkgs/pww { };
|
||||||
|
};
|
||||||
hydraJobs = self.packages;
|
hydraJobs = self.packages;
|
||||||
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
|
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
|
|
|
@ -56,6 +56,10 @@
|
||||||
ports = [ 2222 ];
|
ports = [ 2222 ];
|
||||||
settings.PasswordAuthentication = false;
|
settings.PasswordAuthentication = false;
|
||||||
};
|
};
|
||||||
|
security = {
|
||||||
|
audit.enable = true;
|
||||||
|
auditd.enable = true;
|
||||||
|
};
|
||||||
users.users.root.openssh.authorizedKeys.keyFiles = [
|
users.users.root.openssh.authorizedKeys.keyFiles = [
|
||||||
../../keys/ssh/rouven-thinkpad
|
../../keys/ssh/rouven-thinkpad
|
||||||
../../keys/ssh/rouven-pixel
|
../../keys/ssh/rouven-pixel
|
||||||
|
|
|
@ -64,6 +64,11 @@
|
||||||
|
|
||||||
# Enable the OpenSSH daemon.
|
# Enable the OpenSSH daemon.
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
security = {
|
||||||
|
audit.enable = true;
|
||||||
|
auditd.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
# firmware updates
|
# firmware updates
|
||||||
services.fwupd.enable = true;
|
services.fwupd.enable = true;
|
||||||
|
|
|
@ -46,7 +46,6 @@
|
||||||
sops.age.sshKeyPaths = lib.mkForce [ "/nix/persist/system/etc/ssh/ssh_host_ed25519_key" ];
|
sops.age.sshKeyPaths = lib.mkForce [ "/nix/persist/system/etc/ssh/ssh_host_ed25519_key" ];
|
||||||
sops.gnupg.sshKeyPaths = lib.mkForce [ ];
|
sops.gnupg.sshKeyPaths = lib.mkForce [ ];
|
||||||
|
|
||||||
|
|
||||||
time.timeZone = "Europe/Berlin";
|
time.timeZone = "Europe/Berlin";
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
console = {
|
console = {
|
||||||
|
@ -87,7 +86,11 @@
|
||||||
#hardware.pulseaudio.enable = true;
|
#hardware.pulseaudio.enable = true;
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth.enable = true;
|
||||||
|
|
||||||
security.polkit.enable = true;
|
security = {
|
||||||
|
polkit.enable = true;
|
||||||
|
audit.enable = true;
|
||||||
|
auditd.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -120,7 +123,11 @@
|
||||||
nssmdns = true;
|
nssmdns = true;
|
||||||
};
|
};
|
||||||
fprintd.enable = true; # log in using fingerprint
|
fprintd.enable = true; # log in using fingerprint
|
||||||
openssh.enable = true; # enabled ssh to have the host keys
|
# enabled ssh to have the host keys
|
||||||
|
openssh = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = false;
|
||||||
|
};
|
||||||
btrfs.autoScrub.enable = true; # periodically check filesystem and repair it
|
btrfs.autoScrub.enable = true; # periodically check filesystem and repair it
|
||||||
fwupd.enable = true; # firmware updates
|
fwupd.enable = true; # firmware updates
|
||||||
};
|
};
|
||||||
|
|
26
pkgs/pww/default.nix
Normal file
26
pkgs/pww/default.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{ stdenv, lib, buildGoModule, path, pkgs, go, fetchFromGitHub, playerctl }:
|
||||||
|
buildGoModule rec {
|
||||||
|
pname = "pww";
|
||||||
|
version = "unstable-2023-04-06";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "abenz1267";
|
||||||
|
repo = "pww";
|
||||||
|
rev = "8c973e600052d1c94a0921ed10d0723c123187c6"; # unstable because 6.0.0 has some crashes
|
||||||
|
hash = "sha256-IqLo1MlPGaM0n0TEhptiM5FvqJ8bsEPn7N2EEL6iWK8=";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [ playerctl ];
|
||||||
|
|
||||||
|
outputs = [ "out" ];
|
||||||
|
|
||||||
|
vendorSha256 = "sha256-3PnXB8AfZtgmYEPJuh0fwvG38dtngoS/lxyx3H+rvFs=";
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Utility wrapper around playerctl";
|
||||||
|
homepage = "https://github.com/Mic92/sops-nix";
|
||||||
|
license = licenses.mit;
|
||||||
|
maintainers = with maintainers; [ therealr5 ];
|
||||||
|
platforms = platforms.all;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,5 +1,10 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
# open ports for kde connect
|
||||||
|
networking.firewall = rec {
|
||||||
|
allowedTCPPortRanges = [{ from = 1714; to = 1764; }];
|
||||||
|
allowedUDPPortRanges = allowedTCPPortRanges;
|
||||||
|
};
|
||||||
# fixes pam entries for swaylock
|
# fixes pam entries for swaylock
|
||||||
security.pam.services.swaylock.text = ''
|
security.pam.services.swaylock.text = ''
|
||||||
# Account management.
|
# Account management.
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{ config, pkgs, hyprland, ... }:
|
{ self, config, pkgs, hyprland, ... }:
|
||||||
{
|
{
|
||||||
# waybar needs hyprctl
|
systemd.user.services.waybar.Service.Environment = "PATH=${pkgs.hyprland}/bin:${pkgs.playerctl}/bin:${pkgs.pulseaudio}/bin";
|
||||||
systemd.user.services.waybar.Service.Environment = "PATH=${pkgs.hyprland}/bin";
|
|
||||||
programs.waybar = {
|
programs.waybar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
systemd.enable = true;
|
systemd.enable = true;
|
||||||
|
@ -11,7 +10,7 @@
|
||||||
layer = "top";
|
layer = "top";
|
||||||
position = "top";
|
position = "top";
|
||||||
height = 26;
|
height = 26;
|
||||||
modules-left = [ "wlr/workspaces" "hyprland/window" ];
|
modules-left = [ "wlr/workspaces" "hyprland/window" "custom/spotifytitle" ];
|
||||||
modules-right = [ "network" "cpu" "temperature" "pulseaudio" "battery" "tray" "clock" ];
|
modules-right = [ "network" "cpu" "temperature" "pulseaudio" "battery" "tray" "clock" ];
|
||||||
network = {
|
network = {
|
||||||
format-wifi = " {essid} ({signalStrength}%)";
|
format-wifi = " {essid} ({signalStrength}%)";
|
||||||
|
@ -29,6 +28,13 @@
|
||||||
format = " {}";
|
format = " {}";
|
||||||
separate-outputs = true;
|
separate-outputs = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
"custom/spotifytitle" = {
|
||||||
|
format = " {}";
|
||||||
|
max-length = 80;
|
||||||
|
return-type = "json";
|
||||||
|
exec = "${self.packages.x86_64-linux.pww}/bin/pww -w spotifyd:title -f '{{title}} - {{artist}}' -p None 2> /dev/null";
|
||||||
|
};
|
||||||
cpu = {
|
cpu = {
|
||||||
format = "{usage}% ";
|
format = "{usage}% ";
|
||||||
};
|
};
|
||||||
|
@ -101,6 +107,7 @@
|
||||||
background-color: #eb4d4b;
|
background-color: #eb4d4b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#custom-spotifytitle,
|
||||||
#clock,
|
#clock,
|
||||||
#battery,
|
#battery,
|
||||||
#cpu,
|
#cpu,
|
||||||
|
@ -129,6 +136,20 @@
|
||||||
background-color: #${config.colorScheme.colors.base00};
|
background-color: #${config.colorScheme.colors.base00};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#custom-spotifytitle {
|
||||||
|
background: #1db954;
|
||||||
|
color: #191414;
|
||||||
|
opacity: 1;
|
||||||
|
transition-property: opacity;
|
||||||
|
transition-duration: 0.25s;
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-spotifytitle.Paused,
|
||||||
|
#custom-spotifytitle.Stopped,
|
||||||
|
#custom-spotifytitle.Inactive {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
#battery {
|
#battery {
|
||||||
background-color: #${config.colorScheme.colors.base02};
|
background-color: #${config.colorScheme.colors.base02};
|
||||||
color: #${config.colorScheme.colors.base05};
|
color: #${config.colorScheme.colors.base05};
|
||||||
|
|
|
@ -69,6 +69,11 @@
|
||||||
# })
|
# })
|
||||||
];
|
];
|
||||||
|
|
||||||
|
services.kdeconnect = {
|
||||||
|
enable = true;
|
||||||
|
indicator = true;
|
||||||
|
};
|
||||||
|
|
||||||
xdg.mimeApps = {
|
xdg.mimeApps = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultApplications =
|
defaultApplications =
|
||||||
|
|
Loading…
Reference in a new issue