Compare commits
3 commits
d250dc13ef
...
f18784480e
Author | SHA1 | Date | |
---|---|---|---|
f18784480e | |||
7ab6e16fca | |||
e96da4ea8a |
14 changed files with 164 additions and 151 deletions
|
@ -39,6 +39,7 @@ in
|
|||
extraPackages = with pkgs; [ ];
|
||||
};
|
||||
|
||||
chaotic.mesa-git.enable = true;
|
||||
boot.kernelParams = [ "nouveau.config=NvGspRm=1" ];
|
||||
|
||||
environment.sessionVariables = {
|
||||
|
|
37
common/qt.nix
Normal file
37
common/qt.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
cfg = config.grimmShared;
|
||||
in
|
||||
{
|
||||
config = with cfg; lib.mkIf (enable && graphical) {
|
||||
qt = {
|
||||
enable = true;
|
||||
style = "kvantum";
|
||||
platformTheme = "qt5ct";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
libsForQt5.qtstyleplugin-kvantum
|
||||
catppuccin-kvantum
|
||||
catppuccin-sddm-corners
|
||||
libsForQt5.qtgraphicaleffects
|
||||
catppuccin-kvantum
|
||||
kdePackages.audiocd-kio
|
||||
xcb-util-cursor
|
||||
qt6ct
|
||||
libsForQt5.dolphin
|
||||
];
|
||||
|
||||
# environment.etc."kvantum".source = "${pkgs.catppuccin-kvantum}/share/Kvantum";
|
||||
|
||||
services.displayManager = {
|
||||
sddm = {
|
||||
enable = true;
|
||||
theme = "catppuccin-sddm-corners";
|
||||
wayland.enable = true;
|
||||
wayland.compositor = "weston";
|
||||
};
|
||||
defaultSession = lib.optionalString cfg.sway.enable "sway";
|
||||
};
|
||||
};
|
||||
}
|
24
common/spotify.nix
Normal file
24
common/spotify.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.grimmShared;
|
||||
in
|
||||
{
|
||||
config = with cfg; lib.mkIf (enable && spotify.enable) {
|
||||
environment.systemPackages = [
|
||||
pkgs.ncspot
|
||||
] ++ lib.optional graphical pkgs.spotify;
|
||||
|
||||
grimmShared = {
|
||||
sound = true;
|
||||
network = true;
|
||||
};
|
||||
};
|
||||
|
||||
options.grimmShared.spotify = {
|
||||
enable = lib.mkEnableOption "grimm-spotify";
|
||||
};
|
||||
|
||||
imports = [
|
||||
./spotifyd.nix
|
||||
];
|
||||
}
|
93
common/spotifyd.nix
Normal file
93
common/spotifyd.nix
Normal file
|
@ -0,0 +1,93 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
spotifyd_cache_dir = "/tmp/spotifyd";
|
||||
cfg = config.grimmShared;
|
||||
spotifyd-dbus = pkgs.writeTextDir "share/dbus-1/system.d/org.mpris.MediaPlayer2.spotifyd.conf" ''
|
||||
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->
|
||||
|
||||
<!DOCTYPE busconfig PUBLIC
|
||||
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
<busconfig>
|
||||
<policy user="spotifyd">
|
||||
<allow own_prefix="org.mpris.MediaPlayer2.spotifyd"/>
|
||||
<allow send_destination_prefix="org.mpris.MediaPlayer2.spotifyd"/>
|
||||
<allow receive_sender="org.mpris.MediaPlayer2"/>
|
||||
</policy>
|
||||
<policy context="default">
|
||||
<allow send_destination_prefix="org.mpris.MediaPlayer2.spotifyd"/>
|
||||
<allow receive_sender="org.mpris.MediaPlayer2"/>
|
||||
</policy>
|
||||
</busconfig>
|
||||
'';
|
||||
in
|
||||
{
|
||||
config = with cfg; lib.mkIf (enable && spotify.enable && spotify.spotifyd.enable) {
|
||||
environment.systemPackages = with pkgs; [
|
||||
spotifyd
|
||||
spotifyd-dbus
|
||||
];
|
||||
|
||||
systemd.services.init-spotifyd-cache-dir = {
|
||||
description = "Create the spotifyd cache dir";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = ''
|
||||
mkdir -p ${spotifyd_cache_dir}
|
||||
chown spotifyd:spotifyd -R ${spotifyd_cache_dir}
|
||||
'';
|
||||
};
|
||||
|
||||
# spotifyd config
|
||||
services.spotifyd = {
|
||||
enable = true;
|
||||
settings.global = {
|
||||
bitrate = 320;
|
||||
username = cfg.spotify.spotifyd.username;
|
||||
device_name = "grimm_laptop";
|
||||
password_cmd = let pass = cfg.spotify.spotifyd.pass; in with lib; if (lib.isPath pass || lib.isString pass) then "${pkgs.coreutils-full}/bin/cat ${pass}" else (getExe pass);
|
||||
device_type = "computer";
|
||||
dbus_type = "system";
|
||||
device = "default";
|
||||
control = "default";
|
||||
volume_controller = "softvol";
|
||||
# no_audio_cache = true;
|
||||
spotifyd_cache_dir = spotifyd_cache_dir;
|
||||
max_cache_size = 10000000000;
|
||||
initial_volume = "90";
|
||||
backend = "alsa"; # fixme
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
services.dbus.packages = with pkgs; [
|
||||
spotifyd-dbus
|
||||
];
|
||||
|
||||
# spotifyd has access to global pipewire
|
||||
users.users.spotifyd = {
|
||||
isSystemUser = true;
|
||||
group = "spotifyd";
|
||||
extraGroups = [ "audio" "pipewire" ];
|
||||
};
|
||||
|
||||
# spotifyd is also a group
|
||||
users.groups = { spotifyd = { }; };
|
||||
};
|
||||
|
||||
options.grimmShared.spotify.spotifyd = with lib; {
|
||||
enable = mkEnableOption "grimm-spotify-tui";
|
||||
|
||||
username = mkOption {
|
||||
type = types.nonEmptyStr;
|
||||
description = "spotify username";
|
||||
};
|
||||
|
||||
|
||||
pass = mkOption {
|
||||
type = types.either types.nonEmptyStr (types.either types.package types.path);
|
||||
description = "command to execute to obtain login information or readable path to a file containing them";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -10,7 +10,7 @@ let
|
|||
};
|
||||
|
||||
autolaunch = mkOption {
|
||||
type = types.listOf (types.either types.str types.package);
|
||||
type = types.listOf (types.either types.nonEmptyStr types.package);
|
||||
default = [ ];
|
||||
description = "set of commands to be run at sway startup";
|
||||
};
|
||||
|
@ -40,8 +40,8 @@ in
|
|||
let
|
||||
waybar_full = pkgs.writeShellScriptBin "waybar-full" (
|
||||
(lib.getExe config.programs.waybar.package)
|
||||
+ (if isNull cfg.sway.bar.config then "" else " -c ${cfg.sway.bar.config}")
|
||||
+ (if isNull cfg.sway.bar.style then "" else " -s ${cfg.sway.bar.style}")
|
||||
+ (lib.optionalString (!isNull cfg.sway.bar.config) " -c ${cfg.sway.bar.config}")
|
||||
+ (lib.optionalString (!isNull cfg.sway.bar.style) " -s ${cfg.sway.bar.style}")
|
||||
);
|
||||
|
||||
bar_config = ''
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
# Enable flatpaks
|
||||
|
||||
services.flatpak.enable = true;
|
||||
chaotic.mesa-git.enable = true;
|
||||
|
||||
services.ddccontrol.enable = true;
|
||||
powerManagement.scsiLinkPolicy = "min_power";
|
||||
hardware.i2c.enable = true;
|
||||
|
@ -58,30 +58,16 @@
|
|||
server = "cloud.grimmauld.de";
|
||||
passwordFile = config.age.secrets.nextcloud_pass.path;
|
||||
};
|
||||
|
||||
spotify.enable = true;
|
||||
};
|
||||
|
||||
age.identityPaths = [ "/home/grimmauld/.ssh/id_rsa" ];
|
||||
age.secrets.nextcloud_pass = {
|
||||
file = ./secrets/nextcloud_pass.age;
|
||||
mode = "777";
|
||||
};
|
||||
|
||||
qt = {
|
||||
enable = true;
|
||||
style = "kvantum";
|
||||
platformTheme = "qt5ct";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
libsForQt5.qtstyleplugin-kvantum
|
||||
catppuccin-kvantum
|
||||
catppuccin-sddm-corners
|
||||
libsForQt5.qtgraphicaleffects
|
||||
catppuccin-kvantum
|
||||
qt6ct
|
||||
];
|
||||
|
||||
# environment.etc."kvantum".source = "${pkgs.catppuccin-kvantum}/share/Kvantum";
|
||||
|
||||
environment.sessionVariables = {
|
||||
NIXPKGS_ALLOW_UNFREE = "1";
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
|
|
|
@ -38,11 +38,8 @@
|
|||
nix-gaming.nixosModules.pipewireLowLatency
|
||||
./load_common.nix
|
||||
./specific/grimm-nixos-laptop/configuration.nix
|
||||
|
||||
./configuration.nix
|
||||
./modules/users.nix
|
||||
./modules/spotify-tui.nix
|
||||
./modules/xserver.nix
|
||||
./modules/system-packages.nix
|
||||
./modules/kvm.nix
|
||||
{ environment.systemPackages = [ agenix.packages.${system}.default ]; }
|
||||
|
|
|
@ -18,5 +18,7 @@ with lib;
|
|||
./common/sway.nix
|
||||
./common/cloudsync.nix
|
||||
./common/security.nix
|
||||
./common/qt.nix
|
||||
./common/spotify.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,96 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
spotifyd_cache_dir = "/tmp/spotifyd";
|
||||
in
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
spotifyd = prev.spotifyd.overrideAttrs (old: {
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/dbus-1/system.d/
|
||||
tee $out/share/dbus-1/system.d/org.mpris.MediaPlayer2.spotifyd.conf <<END
|
||||
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->
|
||||
|
||||
<!DOCTYPE busconfig PUBLIC
|
||||
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
<busconfig>
|
||||
<policy user="spotifyd">
|
||||
<allow own_prefix="org.mpris.MediaPlayer2.spotifyd"/>
|
||||
<allow send_destination_prefix="org.mpris.MediaPlayer2.spotifyd"/>
|
||||
<allow receive_sender="org.mpris.MediaPlayer2"/>
|
||||
</policy>
|
||||
<policy context="default">
|
||||
<allow send_destination_prefix="org.mpris.MediaPlayer2.spotifyd"/>
|
||||
<allow receive_sender="org.mpris.MediaPlayer2"/>
|
||||
</policy>
|
||||
</busconfig>
|
||||
END
|
||||
'';
|
||||
});
|
||||
})
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
ncspot
|
||||
spotifyd
|
||||
];
|
||||
|
||||
# decrypt spotify password
|
||||
age.identityPaths = [ "/home/grimmauld/.ssh/id_rsa" ];
|
||||
|
||||
# spotify pass
|
||||
age.secrets.spotify_pass = {
|
||||
file = ../secrets/spotify_pass.age;
|
||||
owner = "spotifyd";
|
||||
group = "spotifyd";
|
||||
mode = "700";
|
||||
};
|
||||
|
||||
systemd.services.init-spotifyd-cache-dir = {
|
||||
description = "Create the spotifyd cache dir";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = ''
|
||||
mkdir -p ${spotifyd_cache_dir}
|
||||
chown spotifyd:spotifyd -R ${spotifyd_cache_dir}
|
||||
'';
|
||||
};
|
||||
|
||||
# spotifyd config
|
||||
services.spotifyd = {
|
||||
enable = true;
|
||||
settings.global = {
|
||||
bitrate = 320;
|
||||
username = "3tyhk4i01l54w7co7xm7jvu32";
|
||||
device_name = "grimm_laptop";
|
||||
password_cmd = "${pkgs.coreutils-full}/bin/cat ${config.age.secrets.spotify_pass.path}"; # read password secret
|
||||
device_type = "computer";
|
||||
dbus_type = "system";
|
||||
device = "default";
|
||||
control = "default";
|
||||
volume_controller = "softvol";
|
||||
# no_audio_cache = true;
|
||||
spotifyd_cache_dir = spotifyd_cache_dir;
|
||||
max_cache_size = 10000000000;
|
||||
initial_volume = "90";
|
||||
backend = "alsa"; # fixme
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
services.dbus.packages = with pkgs; [
|
||||
spotifyd # add above dbus code to the config
|
||||
];
|
||||
|
||||
# spotifyd has access to global pipewire
|
||||
users.users.spotifyd = {
|
||||
isSystemUser = true;
|
||||
group = "spotifyd";
|
||||
extraGroups = [ "audio" "pipewire" ];
|
||||
};
|
||||
|
||||
# spotifyd is also a group
|
||||
users.groups = { spotifyd = { }; };
|
||||
}
|
|
@ -1,9 +1,6 @@
|
|||
{ pkgs, ... }: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
oci-cli
|
||||
xcb-util-cursor
|
||||
krfb
|
||||
kdePackages.audiocd-kio
|
||||
(writeShellScriptBin "rebuild" "nixos-rebuild switch --flake .")
|
||||
];
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
rmview
|
||||
krita
|
||||
kicad
|
||||
spicetify-cli
|
||||
prusa-slicer
|
||||
freecad
|
||||
openscad
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
services.displayManager = {
|
||||
# lightdm.enable = true;
|
||||
sddm = {
|
||||
enable = true;
|
||||
theme = "catppuccin-sddm-corners";
|
||||
wayland.enable = true;
|
||||
wayland.compositor = "weston";
|
||||
};
|
||||
defaultSession = "sway";
|
||||
};
|
||||
|
||||
services.desktopManager = {
|
||||
# plasma6.enable = true;
|
||||
};
|
||||
}
|
|
@ -2,6 +2,5 @@ let
|
|||
laptop_pub = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCy7X5ByG4/9y2XkQSnXcpMGnV5WPGUd+B6FaYCDNmPQ7xIZEteS+kCpu9oiMP6C/H/FT+i9DZvCflkzgdFAyujYLKRYaZbZ3K6F60qN0rkJ0z/ZO5c6rqwIwR6BEoB7dq5inkyH9fZ8/SI+PXxELmeWF9ehT7kkQC+o9Ujpcjd7ZuZllbAz4UQZFRbbpwdVJCEDenu9/63yuYbvMupgGk0edaTiFT0Q9MSzs/3pNP8xlAxmmZ3HzSjeF7gUzBF7CaIroTeguiUjSVybUEx48P8fy878t7dUZf4anEno9MS0B3aqfZvCKuuPdAUdeBfCbFHRqN7GuCylFIXGPe95Mxl grimmauld@grimmauld-nixos";
|
||||
in
|
||||
{
|
||||
"spotify_pass.age".publicKeys = [ laptop_pub ];
|
||||
"nextcloud_pass.age".publicKeys = [ laptop_pub ];
|
||||
}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
age-encryption.org/v1
|
||||
-> ssh-rsa skhaxw
|
||||
PhR0Qi/St6DfuGcO3ffNYN7oq7FzIwHVTeEF+Fsub5n4eRXNpaQlBZjbtksWiRel
|
||||
pTsvX/raALr3UTfsGTIhPMEBhw2fZn6+Qh7y/INfobVFzE3iz0FIk+sb27xYdXcy
|
||||
ULB6V5gjYmiMpQ6D1WF25NTNBkdZg9hss/kdjcFUfrtptgWmqkO6rnjS57G1TUlO
|
||||
uOHAAfTPUPMNpE5i0QMyLZWi5H8ku7xqz6m7piAyz+uBb/L1hlfOjOL5sO7CDNL6
|
||||
vAlBK2mmVvglVTQ+7ImehD71YzkTvgccqWKs8IwA5ADprC0rnKIin0/ZrKoKTzho
|
||||
6/qo0YYYLYBKHeZ1cWlgjg
|
||||
--- VIhwPiuGDfbYLf2Uip3/sVBlK+zqs+2v9/A28kuw0TQ
|
||||
µ¯çdEÿ<v/â·9ÂYA_ô®WKx *‰]¬=ó9Ï8QÆwÌ!LtOûØ0“¯
|
Loading…
Reference in a new issue