transition to using mainProgram defined in meta

This commit is contained in:
LordGrimmauld 2024-04-11 23:12:08 +02:00
parent d29fabb044
commit 639ddb7f88
10 changed files with 46 additions and 54 deletions

View file

@ -12,7 +12,7 @@ in
enable = true; enable = true;
nativeMessagingHosts.packages = [ ] nativeMessagingHosts.packages = [ ]
++ lib.optionals (cfg.tooling.enable && cfg.tooling.pass) [ pkgs.passff-host ]; ++ lib.optionals (cfg.tooling.enable && cfg.tooling.pass) [ pkgs.passff-host ];
languagePacks = [ "de" "en-US" ]; languagePacks = lib.optionals cfg.locale [ "de" "en-US" ];
policies = { policies = {
ExtensionSettings = lib.mkMerge [ ExtensionSettings = lib.mkMerge [
(lib.mkIf cfg.firefox.disableUserPlugins { (lib.mkIf cfg.firefox.disableUserPlugins {

View file

@ -20,8 +20,8 @@ in
renice = 10; renice = 10;
}; };
custom = { custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'"; start = "${lib.getExe pkgs.libnotify} 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'"; end = "${lib.getExe pkgs.libnotify} 'GameMode ended'";
}; };
}; };
}; };
@ -39,7 +39,7 @@ in
(pkgs.symlinkJoin { (pkgs.symlinkJoin {
name = "osu"; name = "osu";
paths = [ paths = [
(pkgs.writeShellScriptBin "osu!" ''exec gamemoderun ${pkgs.osu-lazer-bin}/bin/'osu!' (pkgs.writeShellScriptBin "osu!" ''exec gamemoderun ${lib.getExe pkgs.osu-lazer-bin}
'') '')
pkgs.osu-lazer-bin pkgs.osu-lazer-bin
]; ];

View file

@ -3,29 +3,25 @@ let
cfg = config.grimmShared; cfg = config.grimmShared;
in in
{ {
config = lib.mkMerge [ config = with cfg; lib.mkIf (enable && network) {
(with cfg; lib.mkIf (enable && network) { networking.networkmanager.enable = true;
networking.networkmanager.enable = true; networking.useDHCP = lib.mkDefault true;
networking.useDHCP = lib.mkDefault true; networking.firewall.enable = true;
networking.firewall.enable = true;
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wireguard-tools wireguard-tools
bluetuith bluetuith
]; ];
})
(with cfg; lib.mkIf (enable && network && graphical) { services.blueman.enable = graphical;
services.blueman.enable = true;
}) systemd.user.services.mpris-proxy = lib.mkIf sound {
(with cfg; lib.mkIf (enable && network && sound) { description = "Mpris proxy";
systemd.user.services.mpris-proxy = { after = [ "network.target" "sound.target" ];
description = "Mpris proxy"; wantedBy = [ "default.target" ];
after = [ "network.target" "sound.target" ]; serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
wantedBy = [ "default.target" ]; };
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; };
};
})
];
} }

View file

@ -13,18 +13,15 @@ in
pass pass
libsecret libsecret
(writeShellScriptBin "passw" "pass $@") (writeShellScriptBin "passw" "pass $@")
] ++ lib.optionals cfg.graphical [ ] ++ lib.optional graphical lxqt.lxqt-policykit;
lxqt.lxqt-policykit
];
services.passSecretService.enable = true; services.passSecretService.enable = true;
programs.gnupg.agent = { programs.gnupg.agent = {
settings = { settings = {
# default-cache-ttl = 6000; # default-cache-ttl = 6000;
}; };
pinentryPackage = lib.mkForce pkgs.pinentry; pinentryPackage = lib.mkForce pkgs.pinentry;
enable = true; enable = true;
# enableSSHSupport = true;
}; };
}; };
} }

View file

@ -6,19 +6,19 @@ in
config = with cfg; lib.mkIf (enable && portals) { config = with cfg; lib.mkIf (enable && portals) {
xdg.portal = { xdg.portal = {
enable = true; enable = true;
wlr.enable = true;
extraPortals = with pkgs; [ extraPortals = with pkgs; [
xdg-desktop-portal-wlr xdg-desktop-portal-wlr
xdg-desktop-portal-kde xdg-desktop-portal-kde
xdg-desktop-portal-gtk xdg-desktop-portal-gtk
]; ];
wlr.enable = true;
wlr.settings = lib.mapAttrs' wlr.settings = lib.mapAttrs'
(name: value: lib.nameValuePair ("screencast_" + name) { (name: value: lib.nameValuePair ("screencast_" + name) {
output_name = value.id; output_name = value.id;
max_fps = value.fps; max_fps = value.fps;
chooser_type = "simple"; chooser_type = "simple";
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or"; chooser_cmd = "${lib.getExe pkgs.slurp} -f %o -or";
}) })
cfg.screens; cfg.screens;
}; };
@ -28,6 +28,10 @@ in
FREETYPE_PROPERTIES = "cff:no-stem-darkening=0 autofitter:no-stem-darkening=0"; FREETYPE_PROPERTIES = "cff:no-stem-darkening=0 autofitter:no-stem-darkening=0";
}; };
environment.systemPackages = with pkgs; [
xwaylandvideobridge
];
fonts.fontDir.enable = true; fonts.fontDir.enable = true;
}; };
} }

View file

@ -6,14 +6,14 @@ in
config = config =
let let
waybar_full = pkgs.writeShellScriptBin "waybar-full" ( waybar_full = pkgs.writeShellScriptBin "waybar-full" (
"${config.programs.waybar.package}/bin/waybar" (lib.getExe config.programs.waybar.package)
+ (if isNull cfg.sway.bar.config then "" else " -c ${cfg.sway.bar.config}") + (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}") + (if isNull cfg.sway.bar.style then "" else " -s ${cfg.sway.bar.style}")
); );
bar_config = '' bar_config = ''
bar { bar {
swaybar_command ${waybar_full}/bin/waybar-full swaybar_command ${lib.getExe waybar_full}
} }
''; '';

View file

@ -58,7 +58,7 @@ in
config = { config = {
init.defaultBranch = "main"; init.defaultBranch = "main";
credential.username = cfg.tooling.git_user; credential.username = cfg.tooling.git_user;
core.editor = "${pkgs.neovim}/bin/nvim"; core.editor = lib.getExe pkgs.neovim;
user.name = cfg.tooling.git_user; user.name = cfg.tooling.git_user;
user.email = cfg.tooling.git_email; user.email = cfg.tooling.git_email;
}; };

View file

@ -1,15 +1,9 @@
{ pkgs, ... }: { { pkgs, ... }: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
spice-gtk
kate
oci-cli oci-cli
xcb-util-cursor xcb-util-cursor
krfb krfb
kdePackages.audiocd-kio kdePackages.audiocd-kio
(writeShellScriptBin "rebuild" "nixos-rebuild switch --flake .")
(writeShellScriptBin "rebuild" ''
pkexec nixos-rebuild switch --flake /home/grimmauld/grimm-nixos-laptop
'')
]; ];
} }

View file

@ -13,6 +13,7 @@
]; ];
packages = with pkgs; [ packages = with pkgs; [
geany
webcord webcord
discord discord
kwrited kwrited

View file

@ -19,16 +19,16 @@
style = ./bar/style.css; style = ./bar/style.css;
}; };
config = { config = with lib; {
definitions = { definitions = {
mod = "Mod4"; mod = "Mod4";
left = "h"; left = "h";
down = "j"; down = "j";
up = "k"; up = "k";
right = "l"; right = "l";
term = "alacritty"; term = getExe pkgs.alacritty;
menu = "rmenu -r drun | xargs swaymsg exec --"; menu = "${getExe pkgs.rmenu} -r drun | xargs swaymsg exec --";
menu_run = "rmenu -r run | xargs swaymsg exec --"; menu_run = "${getExe pkgs.rmenu} -r run | xargs swaymsg exec --";
primecol = "#8800FF"; primecol = "#8800FF";
accentcol = "#5700a0"; accentcol = "#5700a0";
@ -41,7 +41,7 @@
keybinds = { keybinds = {
"$mod+d" = "exec $menu"; "$mod+d" = "exec $menu";
"$mod+Shift+d" = "exec $menu_run"; "$mod+Shift+d" = "exec $menu_run";
"$mod+Shift+s" = ''exec grim -g "$(slurp -d)" - | wl-copy''; "$mod+Shift+s" = ''exec ${getExe pkgs.grim} -g "$(${getExe pkgs.slurp} -d)" - | wl-copy'';
"$mod+Return" = "exec $term"; "$mod+Return" = "exec $term";
"$mod+Shift+q" = "kill"; "$mod+Shift+q" = "kill";
"$mod+Shift+c" = "reload"; "$mod+Shift+c" = "reload";
@ -124,7 +124,7 @@
"$mod+Shift+minus" = "move scratchpad"; "$mod+Shift+minus" = "move scratchpad";
"$mod+minus" = "scratchpad show"; "$mod+minus" = "scratchpad show";
"$mod+r" = ''mode "resize"''; "$mod+r" = "mode \"resize\"";
XF86AudioRaiseVolume = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; XF86AudioRaiseVolume = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%";
XF86AudioLowerVolume = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; XF86AudioLowerVolume = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%";
@ -134,16 +134,16 @@
XF86AudioPlay = "exec playerctl play-pause"; XF86AudioPlay = "exec playerctl play-pause";
XF86AudioNext = "exec playerctl next"; XF86AudioNext = "exec playerctl next";
XF86AudioPrev = "exec playerctl previous"; XF86AudioPrev = "exec playerctl previous";
"$mod+c" = "exec swaymux"; "$mod+c" = "exec ${getExe pkgs.swaymux}";
XF86MonBrightnessUp = "exec brightnessctl s 10+%"; XF86MonBrightnessUp = "exec ${getExe pkgs.brightnessctl} s 10+%";
XF86MonBrightnessDown = "exec brightnessctl s 10-%"; XF86MonBrightnessDown = "exec ${getExe pkgs.brightnessctl} s 10-%";
}; };
autolaunch = [ autolaunch = [
# fixme: absolute paths # fixme: absolute paths
"blueman-applet" "blueman-applet"
"lxqt-policykit-agent" "lxqt-policykit-agent"
"otd-daemon" "otd-daemon"
"dunst" (getExe pkgs.dunst)
"systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP" "systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP"
]; ];
extraConfig = '' extraConfig = ''