replace variant argument with modules
All checks were successful
/ build-all (push) Successful in 1m18s

This commit is contained in:
Antoine Vaure 2025-09-03 16:11:05 +02:00
parent f2608d0a82
commit 1a0086f941
13 changed files with 586 additions and 577 deletions

View file

@ -39,7 +39,6 @@
extraSpecialArgs = {
inherit pkgs-unstable;
variant = "allegro";
};
modules = [
@ -49,6 +48,10 @@
{ targets.genericLinux.enable = true; }
{ home.packages = [ inputs.st-flexipatch.packages.${system}.st ]; }
./home/syncthing.nix
./home/allegro.nix
./home/ui.nix
./home/gui-software.nix
];
};
@ -57,7 +60,6 @@
extraSpecialArgs = {
inherit pkgs-unstable;
variant = "hs";
};
modules = [
@ -71,7 +73,6 @@
extraSpecialArgs = {
inherit pkgs-unstable;
variant = "hs";
};
modules = [
@ -85,7 +86,6 @@
extraSpecialArgs = {
inherit pkgs-unstable;
variant = "default";
inherit inputs;
};
@ -94,6 +94,12 @@
./home/base.nix
{ home.packages = [ inputs.st-flexipatch.packages.${system}.st ]; }
./home/syncthing.nix
./home/basado.nix
./home/ui.nix
./home/gui-software.nix
./home/gaming.nix
{ services.kdeconnect.enable = true; }
];
};
@ -102,7 +108,6 @@
extraSpecialArgs = {
inherit pkgs-unstable;
variant = "moon";
inherit inputs;
};
@ -111,6 +116,11 @@
./home/base.nix
{ home.packages = [ inputs.st-flexipatch.packages.${system}.st ]; }
./home/syncthing.nix
./home/moon.nix
./home/ui.nix
./home/gui-software.nix
{ services.kdeconnect.enable = true; }
];
};

View file

@ -1,25 +0,0 @@
{ lib, config, pkgs, variant, ... }: {
config = {
home.packages =
if variant == "default" then
with pkgs; [
qbittorrent
pipewire
discord
feather # monero wallet
# litecoin
librewolf
spotify
ungoogled-chromium
immich-cli
vesktop
]
else if variant == "allegro" then
with pkgs; [
aria2
pipewire
teams-for-linux
]
else [];
};
}

115
home/allegro.nix Normal file
View file

@ -0,0 +1,115 @@
{ config, lib, pkgs, ... }: {
programs.fish = {
loginShellInit = ''
source ${pkgs.nix}/etc/profile.d/nix.fish
if test $(tty) = /dev/tty2
nixGLIntel Hyprland
end
'';
};
xdg = {
configFile."systemd/user/dbus-broker.service".source =
"${pkgs.dbus-broker}/share/systemd/user/dbus-broker.service";
configFile."systemd/user/at-spi-dbus-bus.service".source =
"${pkgs.at-spi2-core}/lib/systemd/user/at-spi-dbus-bus.service";
dataFile."dbus-1/services/org.a11y.Bus.service".source =
"${pkgs.at-spi2-core}/share/dbus-1/services/org.a11y.Bus.service";
dataFile."dbus-1/accessibility-services/org.a11y.atspi.Registry.service".source =
"${pkgs.at-spi2-core}/share/dbus-1/accessibility-services/org.a11y.atspi.Registry.service";
configFile."systemd/user/xdg-desktop-portal.service".source =
"${pkgs.xdg-desktop-portal}/lib/systemd/user/xdg-desktop-portal.service";
configFile."systemd/user/xdg-desktop-portal-gtk.service".source =
"${pkgs.xdg-desktop-portal-gtk}/lib/systemd/user/xdg-desktop-portal-gtk.service";
configFile."systemd/user/xdg-desktop-portal-hyprland.service".source =
"${pkgs.xdg-desktop-portal-hyprland}/lib/systemd/user/xdg-desktop-portal-hyprland.service";
dataFile."share/dbus-1/services/org.freedesktop.impl.portal.desktop.hyprland.service".source =
"${pkgs.xdg-desktop-portal-hyprland}share/dbus-1/services/org.freedesktop.impl.portal.desktop.hyprland.service";
dataFile."systemd/user/pipewire.service".source =
"${pkgs.pipewire}/share/systemd/user/pipewire.service";
dataFile."systemd/user/pipewire-pulse.service".source =
"${pkgs.pipewire}/share/systemd/user/pipewire-pulse.service";
dataFile."systemd/user/filter-chain.service".source =
"${pkgs.pipewire}/share/systemd/user/filter-chain.service";
dataFile."systemd/user/pipewire.socket".source =
"${pkgs.pipewire}/share/systemd/user/pipewire.socket";
dataFile."systemd/user/pipewire-pulse.socket".source =
"${pkgs.pipewire}/share/systemd/user/pipewire-pulse.socket";
portal = {
enable = true;
# xdgOpenUsePortal = true;
extraPortals =
[ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-hyprland ];
configPackages =
[ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-hyprland ];
# config.common.default = "*";
config = {
hyprland = { default = [ "gtk,hyprland" ]; };
common = { default = [ "gtk,hyprland" ]; };
};
};
};
wayland.windowManager.hyprland = {
extraConfig = ''
monitor= DP-4, 1920x1200@75, 3840x0, 1
monitor= DP-3, 1920x1200@75, 1920x0, 1
monitor=eDP-1, 1920x1080, 0x0, 1
monitor=HDMI-1, 3440x1440, auto, 1
monitor=HDMI-A-1, 3440x1440, auto, 1
# monitor=HDMI-1, 1920x1080, auto, 1, mirror, eDP-1
# monitor=HDMI-A-1, 1920x1080, auto, 1, mirror, eDP-1
env = WLR_DRM_DEVICES,/dev/dri/card0
env = AQ_WLR_DEVICES,/dev/dri/card0
env = AQ_DRM_DEVICES,/dev/dri/card0
env = TERMINAL,st
env = NIXOS_OZONE_WL,1
env = GDK_BACKEND,wayland,x11
env = QT_QPA_PLATFORM,wayland;xcb
env = CLUTTER_BACKEND,wayland
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland
env = QT_AUTO_SCREEN_SCALE_FACTOR,1
env = WLR_NO_HARDWARE_CURSORS,1
env = XCURSOR_SIZE,24
'';
};
programs.waybar.settings.bar = {
"group/disks".modules = [
"disk#home"
];
"disk#home" = {
interval = 1;
format = "󰋊 {free}";
path = "/home/${config.home.username}";
"on-click" = "$TERMINAL -c floating -e ${pkgs.ncdu}/bin/ncdu -x /home/${config.home.username}";
};
};
home.file = {
".bin/shutdown".source = pkgs.writeShellScript "usr_sbin_shutdown" "/usr/sbin/shutdown $@";
".bin/reboot".source = pkgs.writeShellScript "usr_sbin_reboot" "/usr/sbin/reboot $@";
};
home.packages = with pkgs; [
aria2
pipewire
];
home.sessionVariables = {
TMPDIR = "/home/${config.home.username}/tmp";
GSETTINGS_SCHEMA_DIR = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/gsettings-desktop-schemas-47.1/glib-2.0/schemas";
};
swaylock-bin = "/usr/bin/swaylock";
}

View file

@ -1,4 +1,4 @@
{ lib, config, pkgs, variant, ... }: {
{ lib, config, pkgs, ... }: {
home.packages = with pkgs; [
material-design-icons
@ -71,15 +71,8 @@
"group/disks" = {
orientation = "inherit";
modules = [
"disk" # /
]
++
(if (variant == "default") then [
"disk#2"
"disk#3"
] else if (variant == "allegro") then [
"disk#home"
] else []);
"disk"
];
};
backlight = {
@ -130,27 +123,6 @@
};
"disk#2" = lib.attrsets.optionalAttrs (variant == "default") {
interval = 1;
format = "󰋊 {free}";
path = "/home/ant/disk1";
"on-click" = "$TERMINAL -c floating -e ${pkgs.ncdu}/bin/ncdu -x /home/${username}/disk1";
};
"disk#3" = lib.attrsets.optionalAttrs (variant == "default") {
interval = 1;
format = "󰋊 {free}";
path = "/home/ant/disk2";
"on-click" = "$TERMINAL -c floating -e ${pkgs.ncdu}/bin/ncdu -x /home/${username}/disk2";
};
"disk#home" = lib.attrsets.optionalAttrs (variant == "allegro") {
interval = 1;
format = "󰋊 {free}";
path = "/home/${username}";
"on-click" = "$TERMINAL -c floating -e ${pkgs.ncdu}/bin/ncdu -x /home/${username}";
};
memory = {
interval = 1;
format = "󰧑 {percentage:2}%";
@ -279,12 +251,6 @@
"scroll-step" = 5;
};
"custom/loopback" = lib.attrsets.optionalAttrs (variant == "default") {
exec = "journalctl --user -f -u loopback | exec_on_stdin_newline 'if systemctl --user is-active --quiet loopback; then echo loopback ON; else echo loopback; fi'";
on-click = "if systemctl --user is-active --quiet loopback; then systemctl --user stop loopback; else systemctl --user start loopback; fi";
format = "{}";
};
"hyprland/submap" = {
format = "(l)ock, (d)pms, (e)xit, (s)uspend, (h)ibernate, (r)eboot, (S)hutdown";
};

47
home/basado.nix Normal file
View file

@ -0,0 +1,47 @@
{ config, lib, pkgs, ... }: {
wayland.windowManager.hyprland = {
extraConfig = ''
monitor=,highrr,auto,1
'';
};
home.packages = with pkgs; [
qbittorrent
pipewire
discord
feather # monero wallet
# litecoin
librewolf
spotify
ungoogled-chromium
immich-cli
vesktop
];
programs.waybar.settings.bar = {
"group/disks".modules = [
"disk#2"
"disk#3"
];
"disk#2" = {
interval = 1;
format = "󰋊 {free}";
path = "/home/${config.home.username}/disk1";
"on-click" = "$TERMINAL -c floating -e ${pkgs.ncdu}/bin/ncdu -x /home/${config.home.username}/disk1";
};
"disk#3" = {
interval = 1;
format = "󰋊 {free}";
path = "/home/${config.home.username}/disk2";
"on-click" = "$TERMINAL -c floating -e ${pkgs.ncdu}/bin/ncdu -x /home/${config.home.username}/disk2";
};
"custom/loopback" = {
exec = "journalctl --user -f -u loopback | exec_on_stdin_newline 'if systemctl --user is-active --quiet loopback; then echo loopback ON; else echo loopback; fi'";
on-click = "if systemctl --user is-active --quiet loopback; then systemctl --user stop loopback; else systemctl --user start loopback; fi";
format = "{}";
};
};
}

View file

@ -1,18 +1,11 @@
{ inputs, config, lib, pkgs, variant, ... }:
{ inputs, config, lib, pkgs, ... }:
{
imports = [
./lf.nix
./fish.nix
./terminal-software.nix
] ++ (if variant != "hs" then
[
./ui.nix
./gui-software.nix
./gaming.nix
./additional-software.nix
]
else []);
];
# Home Manager needs a bit of information about you and the paths it should
# manage.
@ -56,12 +49,8 @@
home.sessionVariables = {
GOPATH = "${config.home.homeDirectory}/.local/share/go";
GOMODCACHE = "${config.home.homeDirectory}/.cache/go/pkg/mod";
CCACHE_MAXSIZE = "100Gi";
} // (if variant == "allegro" then {
TMPDIR = "/home/${config.home.username}/tmp";
GSETTINGS_SCHEMA_DIR = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/gsettings-desktop-schemas-47.1/glib-2.0/schemas";
} else {});
};
home.keyboard.options = [
"caps:escape"

View file

@ -1,16 +1,10 @@
{ lib, pkgs, variant, ... }:
{ lib, pkgs, ... }:
{
programs.fish = {
enable = true;
loginShellInit = ''
set -gx fish_greeting
'' +
(if variant == "allegro" then ''
source ${pkgs.nix}/etc/profile.d/nix.fish
if test $(tty) = /dev/tty2
nixGLIntel Hyprland
end
'' else "");
'';
interactiveShellInit = ''
set -gx fish_greeting
@ -118,8 +112,6 @@
gdb_asan = "gdb -tui -ex='break __asan::ReportGenericError'";
gdb_ubsan = "gdb -tui -ex='break __ubsan::ScopedReport::~ScopedReport'";
gdb_msan = "gdb -tui -ex='break __sanitizer::Die'";
} // lib.attrsets.optionalAttrs (variant == "allegro") {
d = "./run_in_container.sh docker/ci.Dockerfile.signature";
};
plugins = [

View file

@ -1,13 +1,12 @@
{ lib, config, pkgs, variant, ... }: {
{ lib, config, pkgs, ... }: {
nixpkgs.config = { allowUnfree = true; };
home.packages = if variant == "default" then with pkgs; [
home.packages = with pkgs; [
lutris
prismlauncher
gamemode
mangohud
heroic
steam
]
else [];
];
}

View file

@ -1,13 +1,13 @@
{ lib, config, variant, pkgs, pkgs-unstable, ... }:
{ lib, config, pkgs, pkgs-unstable, ... }:
{
home.packages = (with pkgs; [
home.packages = with pkgs; [
nsxiv
libreoffice
keepassxc
thunderbird
vieb
gimp
]) ++ (if variant != "allegro" then [ pkgs.warpinator ] else []);
];
programs.mpv = {
enable = true;

View file

@ -1,50 +1,4 @@
{ config, lib, pkgs, pkgs-unstable, pkgs-24_05, variant, ... }: {
xdg = lib.attrsets.optionalAttrs (variant == "allegro") {
configFile."systemd/user/dbus-broker.service".source =
"${pkgs.dbus-broker}/share/systemd/user/dbus-broker.service";
configFile."systemd/user/at-spi-dbus-bus.service".source =
"${pkgs.at-spi2-core}/lib/systemd/user/at-spi-dbus-bus.service";
dataFile."dbus-1/services/org.a11y.Bus.service".source =
"${pkgs.at-spi2-core}/share/dbus-1/services/org.a11y.Bus.service";
dataFile."dbus-1/accessibility-services/org.a11y.atspi.Registry.service".source =
"${pkgs.at-spi2-core}/share/dbus-1/accessibility-services/org.a11y.atspi.Registry.service";
configFile."systemd/user/xdg-desktop-portal.service".source =
"${pkgs.xdg-desktop-portal}/lib/systemd/user/xdg-desktop-portal.service";
configFile."systemd/user/xdg-desktop-portal-gtk.service".source =
"${pkgs.xdg-desktop-portal-gtk}/lib/systemd/user/xdg-desktop-portal-gtk.service";
configFile."systemd/user/xdg-desktop-portal-hyprland.service".source =
"${pkgs.xdg-desktop-portal-hyprland}/lib/systemd/user/xdg-desktop-portal-hyprland.service";
dataFile."share/dbus-1/services/org.freedesktop.impl.portal.desktop.hyprland.service".source =
"${pkgs.xdg-desktop-portal-hyprland}share/dbus-1/services/org.freedesktop.impl.portal.desktop.hyprland.service";
dataFile."systemd/user/pipewire.service".source =
"${pkgs.pipewire}/share/systemd/user/pipewire.service";
dataFile."systemd/user/pipewire-pulse.service".source =
"${pkgs.pipewire}/share/systemd/user/pipewire-pulse.service";
dataFile."systemd/user/filter-chain.service".source =
"${pkgs.pipewire}/share/systemd/user/filter-chain.service";
dataFile."systemd/user/pipewire.socket".source =
"${pkgs.pipewire}/share/systemd/user/pipewire.socket";
dataFile."systemd/user/pipewire-pulse.socket".source =
"${pkgs.pipewire}/share/systemd/user/pipewire-pulse.socket";
portal = {
enable = true;
# xdgOpenUsePortal = true;
extraPortals =
[ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-hyprland ];
configPackages =
[ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-hyprland ];
# config.common.default = "*";
config = {
hyprland = { default = [ "gtk,hyprland" ]; };
common = { default = [ "gtk,hyprland" ]; };
};
};
};
{ config, lib, pkgs, ... }: {
home.sessionVariables = {
NIXOS_OZONE_WL = "1";
GDK_BACKEND = "wayland,x11";
@ -342,57 +296,8 @@
# -p pkgs.rubyPackages.gdk_pixbuf2 \
# --run "${pkgs.swaybg}/bin/swaybg -m fill -i $bg"
'');
monitors = if (variant == "default") then ''
monitor=,highrr,auto,1
''
else if variant == "moon" then ''
monitor=,preferred,auto,1
monitor=HDMI-1, 1920x1080, auto, 1, mirror, eDP-1
monitor=HDMI-A-1, 1920x1080, auto, 1, mirror, eDP-1
''
else if variant == "allegro" then ''
monitor= DP-4, 1920x1200@75, 3840x0, 1
monitor= DP-3, 1920x1200@75, 1920x0, 1
monitor=eDP-1, 1920x1080, 0x0, 1
monitor=HDMI-1, 3440x1440, auto, 1
monitor=HDMI-A-1, 3440x1440, auto, 1
# monitor=HDMI-1, 1920x1080, auto, 1, mirror, eDP-1
# monitor=HDMI-A-1, 1920x1080, auto, 1, mirror, eDP-1
''
else ''
'';
in
''
${monitors}
${ # system specific configs
if variant == "default" then ''
#env = GBM_BACKEND,nvidia-drm
#env = __GLX_VENDOR_LIBRARY_NAME,nvidia
# env = WLR_DRM_DEVICES,/dev/dri/card1
# env = AQ_WLR_DEVICES,/dev/dri/card1
# env = AQ_DRM_DEVICES,/dev/dri/card1
''
else if variant == "allegro" then ''
env = WLR_DRM_DEVICES,/dev/dri/card0
env = AQ_WLR_DEVICES,/dev/dri/card0
env = AQ_DRM_DEVICES,/dev/dri/card0
env = TERMINAL,st
env = NIXOS_OZONE_WL,1
env = GDK_BACKEND,wayland,x11
env = QT_QPA_PLATFORM,wayland;xcb
env = CLUTTER_BACKEND,wayland
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland
env = QT_AUTO_SCREEN_SCALE_FACTOR,1
env = WLR_NO_HARDWARE_CURSORS,1
env = XCURSOR_SIZE,24
'' else ''
''
}
env = HYPRCURSOR_THEME,Hackneyed
env = HYPRCURSOR_SIZE,24
@ -425,7 +330,7 @@
bind = ,s, exec, systemctl suspend
bind = ,s, submap, reset
bind = SHIFT,S,exec, ${if variant == "allegro" then "/usr/sbin/shutdown" else "shutdown"} now
bind = SHIFT,S,exec, shutdown now
bind = ,S, submap, reset
bind = ,h, exec, systemctl hibernate
@ -434,7 +339,7 @@
bind = ,e, exit
bind = ,e, submap, reset
bind = ,r, exec, ${if variant == "allegro" then "/usr/sbin/reboot" else "reboot"}
bind = ,r, exec, reboot
bind = ,r, submap, reset
bind = ,l, exec, swaylock

9
home/moon.nix Normal file
View file

@ -0,0 +1,9 @@
{ config, lib, pkgs, ... }: {
wayland.windowManager.hyprland = {
extraConfig = ''
monitor=,preferred,auto,1
monitor=HDMI-1, 1920x1080, auto, 1, mirror, eDP-1
monitor=HDMI-A-1, 1920x1080, auto, 1, mirror, eDP-1
'';
};
}

View file

@ -1,4 +1,4 @@
{ lib, config, pkgs, variant, pkgs-unstable, ... }: {
{ lib, config, pkgs, pkgs-unstable, ... }: {
home.packages = with pkgs; [
entr
trash-cli
@ -21,7 +21,7 @@
viAlias = true;
defaultEditor = true;
package = pkgs-unstable.neovim-unwrapped;
extraPackages = (with pkgs; [
extraPackages = with pkgs; [
nodejs_24
ocamlPackages.lsp
ocamlPackages.ocamlformat
@ -33,7 +33,8 @@
ocamlPackages.ocaml-lsp
pyright
ripgrep
]) ++ (if variant != "allegro" then [ pkgs.gcc ] else [] );
gcc
];
};
xdg.mimeApps.defaultApplications = { "text/plain" = "nvim.desktop"; };

View file

@ -1,4 +1,4 @@
{ lib, config, pkgs, variant, ... }:
{ lib, config, options, pkgs, ... }:
let
defaultTerminal = "st";
alacrittyLightTheme = "${pkgs.alacritty-theme}/night_owlish_light.toml";
@ -11,6 +11,13 @@ in
./gui-software.nix
];
options = {
swaylock-bin = lib.mkOption {
default = "${config.programs.swaylock.package}/bin/swaylock";
};
};
config = {
home.file = {
".config/kitty/light.conf".source = dotfiles/kitty/light.conf;
".config/kitty/dark.conf".source = dotfiles/kitty/dark.conf;
@ -149,8 +156,6 @@ in
services.gnome-keyring.enable = true;
services.kdeconnect.enable = variant != "allegro";
programs.kitty = {
enable = true;
font.name = "CaskaydiaCove NFM Regular";
@ -205,16 +210,12 @@ in
};
services.swayidle =
let swaylock-bin = (if variant == "allegro"
then "/usr/bin/swaylock"
else "${config.programs.swaylock.package}/bin/swaylock");
in
{
enable = true;
events = [
{
event = "before-sleep";
command = "${swaylock-bin} -defF";
command = "${config.swaylock-bin} -defF";
}
{
event = "after-resume";
@ -222,14 +223,14 @@ in
}
{
event = "lock";
command = "${swaylock-bin} -defF";
command = "${config.swaylock-bin} -defF";
}
];
timeouts = [
{
timeout = 900;
command = "${swaylock-bin} -defF";
command = "${config.swaylock-bin} -defF";
}
{
timeout = 900;
@ -239,7 +240,7 @@ in
};
programs.swaylock = {
enable = (variant != "allegro");
enable = (config.swaylock-bin == options.swaylock-bin.default);
package = pkgs.swaylock-effects;
settings = {
screenshots = true;
@ -428,5 +429,5 @@ in
};
};
};
};
}