Merge branch 'main' into fix/neovim-cherry-picks

This commit is contained in:
Benjamin Bädorf 2022-08-12 20:52:57 +00:00
commit 6b396f0840
12 changed files with 66 additions and 63 deletions

View file

@ -76,7 +76,6 @@
overlays = [ overlays = [
nur.overlay nur.overlay
agenix.overlay agenix.overlay
nvfetcher.overlay
./pkgs/default.nix ./pkgs/default.nix
]; ];
}; };

View file

@ -12,4 +12,12 @@
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
fileSystems."/" = { device = "/dev/disk/by-label/nixos"; }; fileSystems."/" = { device = "/dev/disk/by-label/nixos"; };
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.05"; # Did you read the comment?
} }

View file

@ -18,4 +18,12 @@
# will be overridden by the bootstrapIso instrumentation # will be overridden by the bootstrapIso instrumentation
fileSystems."/" = { device = "/dev/disk/by-label/nixos"; }; fileSystems."/" = { device = "/dev/disk/by-label/nixos"; };
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.05"; # Did you read the comment?
} }

View file

@ -9,10 +9,21 @@ in
options.pub-solar.audio = { options.pub-solar.audio = {
enable = mkEnableOption "Life in highs and lows"; enable = mkEnableOption "Life in highs and lows";
mopidy.enable = mkEnableOption "Life with mopidy"; mopidy.enable = mkEnableOption "Life with mopidy";
spotify.enable = mkEnableOption "Life in DRM";
spotify.username = mkOption {
description = "Spotify login username or email";
type = types.str;
example = "yourname@example.com";
default = "";
};
bluetooth.enable = mkEnableOption "Life with bluetooth"; bluetooth.enable = mkEnableOption "Life with bluetooth";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
users.users = pkgs.lib.setAttrByPath [ psCfg.user.name ] {
extraGroups = [ "audio" ];
};
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] { home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
home.packages = [ home.packages = [
# easyeffects, e.g. for microphone noise filtering # easyeffects, e.g. for microphone noise filtering
@ -24,9 +35,23 @@ in
# Needed for pactl cmd, until pw-cli is more mature (vol up/down hotkeys?) # Needed for pactl cmd, until pw-cli is more mature (vol up/down hotkeys?)
pulseaudio pulseaudio
vimpc vimpc
]; ] ++ (if cfg.spotify.enable then [ pkgs.spotify-tui ] else [ ]);
xdg.configFile."vimpc/vimpcrc".source = ./.config/vimpc/vimpcrc; xdg.configFile."vimpc/vimpcrc".source = ./.config/vimpc/vimpcrc;
systemd.user.services.easyeffects = import ./easyeffects.service.nix pkgs; systemd.user.services.easyeffects = import ./easyeffects.service.nix pkgs;
services.spotifyd = mkIf cfg.spotify.enable {
enable = true;
settings = {
global = {
username = cfg.spotify.username;
password_cmd = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus ${pkgs.libsecret}/bin/secret-tool lookup spotify password";
bitrate = 320;
volume_normalisation = true;
no_audio_cache = false;
max_cache_size = 1000000000;
};
};
};
}; };
# Enable sound using pipewire-pulse # Enable sound using pipewire-pulse
@ -43,32 +68,19 @@ in
}; };
}; };
config.pipewire-pulse = builtins.fromJSON (builtins.readFile ./pipewire-pulse.conf.json); config.pipewire-pulse = builtins.fromJSON (builtins.readFile ./pipewire-pulse.conf.json);
};
# Bluetooth configuration for pipewire # Bluetooth configuration using wireplumber
media-session.config.bluez-monitor.rules = mkIf cfg.bluetooth.enable [ # https://nixos.wiki/wiki/PipeWire#Bluetooth_Configuration
{ environment.etc = mkIf cfg.bluetooth.enable {
# Matches all cards "wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = ''
matches = [{ "device.name" = "~bluez_card.*"; }]; bluez_monitor.properties = {
actions = { ["bluez5.enable-sbc-xq"] = true,
"update-props" = { ["bluez5.enable-msbc"] = true,
"bluez5.reconnect-profiles" = [ "hfp_hf" "hsp_hs" "a2dp_sink" ]; ["bluez5.enable-hw-volume"] = true,
# mSBC is not expected to work on all headset + adapter combinations. ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
"bluez5.msbc-support" = true;
};
};
} }
{ '';
matches = [
# Matches all sources
{ "node.name" = "~bluez_input.*"; }
# Matches all outputs
{ "node.name" = "~bluez_output.*"; }
];
actions = {
"node.pause-on-idle" = false;
};
}
];
}; };
# Enable bluetooth # Enable bluetooth

View file

@ -1,7 +1,6 @@
pkgs: { pkgs: {
enable = true; enable = true;
extensionPackages = with pkgs; [ extensionPackages = with pkgs; [
mopidy-spotify
mopidy-mpd mopidy-mpd
mopidy-soundcloud mopidy-soundcloud
mopidy-youtube mopidy-youtube

View file

@ -12,7 +12,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] { home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
home.packages = [ home.packages = [
ps-signal-desktop signal-desktop
tdesktop tdesktop
element-desktop element-desktop
irssi irssi

View file

@ -18,7 +18,7 @@ bindsym $mod+F2 exec firefox
bindsym $mod+F3 exec $term -e vifm bindsym $mod+F3 exec $term -e vifm
bindsym $mod+Shift+F3 exec gksu $term -e vifm bindsym $mod+Shift+F3 exec gksu $term -e vifm
bindsym $mod+F4 exec nautilus -w bindsym $mod+F4 exec nautilus -w
bindsym $mod+Shift+F4 exec signal-desktop bindsym $mod+Shift+F4 exec signal-desktop --use-tray-icon
bindsym $mod+F5 exec $term -e 'mocp -C $XDG_CONFIG_DIR/mocp/config' bindsym $mod+F5 exec $term -e 'mocp -C $XDG_CONFIG_DIR/mocp/config'
bindsym $mod+Shift+m exec mu bindsym $mod+Shift+m exec mu
bindsym $mod+Shift+h exec xdg-open /usr/share/doc/manjaro/i3_help.pdf bindsym $mod+Shift+h exec xdg-open /usr/share/doc/manjaro/i3_help.pdf

View file

@ -1,19 +0,0 @@
pkgs:
{
enable = true;
wantedBy = [ "multi-user.target" ];
unitConfig = {
Description = "Scream IVSHMEM pulse reciever";
BindsTo = [ "pipewire-pulse.service" ];
After = [ "pipewire-pulse.service" ];
Wants = [ "pipewire-pulse.service" ];
};
serviceConfig = {
Type = "simple";
ExecStartPre = [
"${pkgs.coreutils-full}/bin/truncate -s 0 /dev/shm/scream-ivshmem"
"${pkgs.coreutils-full}/bin/dd if=/dev/zero of=/dev/shm/scream-ivshmem bs=1M count=2"
];
ExecStart = "${pkgs.scream}/bin/scream -m /dev/shm/scream-ivshmem";
};
}

View file

@ -19,5 +19,4 @@ with final; {
drone-docker-runner = writeShellScriptBin "drone-docker-runner" (import ./drone-docker-runner.nix final); drone-docker-runner = writeShellScriptBin "drone-docker-runner" (import ./drone-docker-runner.nix final);
# ps-fixes # ps-fixes
ps-signal-desktop = writeShellScriptBin "signal-desktop" (import ./ps-signal-desktop.nix final);
} }

View file

@ -1,9 +0,0 @@
self: with self;
let
signal-desktop = self.signal-desktop.overrideAttrs (old: {
meta.platforms = [ "x86_64-linux" "aarch64-linux" ];
});
in
''
exec ${signal-desktop}/bin/signal-desktop --disable-gpu -- "$@"
''

View file

@ -16,7 +16,13 @@ in
# home to /home/username, useDefaultShell to true, and isSystemUser to false. # home to /home/username, useDefaultShell to true, and isSystemUser to false.
isNormalUser = true; isNormalUser = true;
description = psCfg.user.description; description = psCfg.user.description;
extraGroups = [ "wheel" "docker" "input" "audio" "networkmanager" "lp" "scanner" ]; extraGroups = [
"wheel"
"input"
"networkmanager"
"lp"
"scanner"
];
initialHashedPassword = if psCfg.user.password != null then psCfg.user.password else ""; initialHashedPassword = if psCfg.user.password != null then psCfg.user.password else "";
shell = pkgs.zsh; shell = pkgs.zsh;
openssh.authorizedKeys.keyFiles = if psCfg.user.publicKeys != null then psCfg.user.publicKeys else [ ]; openssh.authorizedKeys.keyFiles = if psCfg.user.publicKeys != null then psCfg.user.publicKeys else [ ];

View file

@ -38,15 +38,15 @@ in
(devos agenix) (devos agenix)
{ {
category = "devos"; category = "devos";
name = pkgs.nvfetcher-bin.pname; name = pkgs.nvfetcher.pname;
help = pkgs.nvfetcher-bin.meta.description; help = pkgs.nvfetcher.meta.description;
command = "cd $PRJ_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml $@"; command = "cd $PRJ_ROOT/pkgs; ${pkgs.nvfetcher}/bin/nvfetcher -c ./sources.toml $@";
} }
(linter nixpkgs-fmt) (linter nixpkgs-fmt)
(linter editorconfig-checker) (linter editorconfig-checker)
# (docs python3Packages.grip) too many deps # (docs python3Packages.grip) too many deps
(docs mdbook) (docs mdbook)
(devos inputs.deploy.packages.${pkgs.system}.deploy-rs) (devos deploy-rs)
] ]
++ lib.optional ++ lib.optional
(system != "i686-linux") (system != "i686-linux")