refactor(nixGL): extract 'nixGL' wrapper
This commit is contained in:
@@ -11,6 +11,7 @@ in
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
|
../../modules/lib.nix
|
||||||
../../modules/ai-tools.nix
|
../../modules/ai-tools.nix
|
||||||
../../modules/cloud
|
../../modules/cloud
|
||||||
../../modules/comms
|
../../modules/comms
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
useNixGL = config.lib ? nixGL;
|
needsNixGL = config.lib ? nixGL;
|
||||||
brunoBase =
|
bruno =
|
||||||
if useNixGL then
|
if needsNixGL then
|
||||||
pkgs.bruno.overrideAttrs (old: {
|
pkgs.bruno.overrideAttrs (old: {
|
||||||
postInstall = (old.postInstall or "") + ''
|
postInstall = (old.postInstall or "") + ''
|
||||||
wrapProgram $out/bin/bruno --add-flags "--no-sandbox"
|
wrapProgram $out/bin/bruno --add-flags "--no-sandbox"
|
||||||
@@ -11,10 +11,9 @@ let
|
|||||||
})
|
})
|
||||||
else
|
else
|
||||||
pkgs.bruno;
|
pkgs.bruno;
|
||||||
brunoFinal = if useNixGL then config.lib.nixGL.wrap brunoBase else brunoBase;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
home.packages = [ brunoFinal ];
|
home.packages = [ (config.nixgl.wrap bruno) ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,6 @@
|
|||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
config = lib.mkIf config.comms.signal.enable {
|
config = lib.mkIf config.comms.signal.enable {
|
||||||
home.packages = with pkgs; [
|
home.packages = [ (config.nixgl.wrap pkgs.signal-desktop) ];
|
||||||
(if config.lib ? nixGL then config.lib.nixGL.wrap signal-desktop else signal-desktop)
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
config = lib.mkIf config.comms.teams.enable {
|
config = lib.mkIf config.comms.teams.enable {
|
||||||
home.packages = with pkgs; [
|
home.packages = [ (config.nixgl.wrap pkgs.teams-for-linux) ];
|
||||||
(if config.lib ? nixGL then config.lib.nixGL.wrap teams-for-linux else teams-for-linux)
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
{ pkgs, config, lib, dotsPath, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
dotsPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
home.packages = [
|
home.packages = [ (config.nixgl.wrap pkgs.kitty) ];
|
||||||
(if config.lib ? nixGL
|
|
||||||
then config.lib.nixGL.wrap pkgs.kitty
|
|
||||||
else pkgs.kitty)
|
|
||||||
];
|
|
||||||
programs.bash.shellAliases = {
|
programs.bash.shellAliases = {
|
||||||
icat = "kitty +kitten icat";
|
icat = "kitty +kitten icat";
|
||||||
};
|
};
|
||||||
|
|||||||
9
home/modules/lib.nix
Normal file
9
home/modules/lib.nix
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
options.nixgl.wrap = lib.mkOption {
|
||||||
|
type = lib.types.functionTo lib.types.package;
|
||||||
|
default = if config.lib ? nixGL then config.lib.nixGL.wrap else lib.id;
|
||||||
|
readOnly = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -4,10 +4,21 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
spotifyWithWayland = pkgs.symlinkJoin {
|
||||||
|
name = "spotify";
|
||||||
|
paths = [ pkgs.spotify ];
|
||||||
|
buildInputs = [ pkgs.makeWrapper ];
|
||||||
|
postBuild = ''
|
||||||
|
wrapProgram $out/bin/spotify \
|
||||||
|
--add-flags "--enable-features=UseOzonePlatform --ozone-platform=wayland"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
ncspot
|
ncspot
|
||||||
# (if config.lib ? nixGL then config.lib.nixGL.wrap spotify else spotify)
|
spotifyWithWayland
|
||||||
];
|
];
|
||||||
|
|
||||||
home.file = {
|
home.file = {
|
||||||
|
|||||||
Reference in New Issue
Block a user