This commit is contained in:
Dragyx 2024-04-18 19:24:07 +02:00
commit 03d1716a1e
16 changed files with 195 additions and 35 deletions

View file

@ -1,5 +1,10 @@
{ config, inputs, pkgs, ... }: { config, inputs, pkgs, ... }:
{ {
imports = [
./hyprland.nix
./programs.nix
];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
time.timeZone = "Europe/Zurich"; time.timeZone = "Europe/Zurich";
security.sudo.package = pkgs.sudo.override { withInsults = true; }; security.sudo.package = pkgs.sudo.override { withInsults = true; };
@ -29,7 +34,8 @@
profiling = false; profiling = false;
extraAliases = { extraAliases = {
cls = "clear"; cls = "clear";
Hyprland = "dbus-run-session Hyprland"; Hyprland = "dbus-run-session Hyprland";
y = "yazi";
}; };
ohmyzsh = { ohmyzsh = {
enable = true; enable = true;
@ -55,6 +61,14 @@
install_url = "https://addons.mozilla.org/firefox/downloads/file/4231522/new_tab_override-16.0.0.xpi"; install_url = "https://addons.mozilla.org/firefox/downloads/file/4231522/new_tab_override-16.0.0.xpi";
installation_mode = "force_installed"; installation_mode = "force_installed";
}; };
"keepassxc-browser@keepassxc.org" = {
install_url = "https://addons.mozilla.org/firefox/downloads/file/4257616/keepassxc_browser-1.9.0.3.xpi";
installation_mode = "force_installed";
};
"{7be2ba16-0f1e-4d93-9ebc-5164397477a9}" = {
install_url = "https://addons.mozilla.org/firefox/downloads/file/3756025/videospeed-0.6.3.3.xpi";
installation_mode = "force_installed";
};
}; };
}; };
@ -62,6 +76,10 @@
enable = true; enable = true;
catppuccin = true; catppuccin = true;
}; };
neovim = {
enable = true;
};
}; };
services = { services = {
@ -99,6 +117,13 @@
console.keyMap = "sg"; console.keyMap = "sg";
# services.flatpak.enable = true; # services.flatpak.enable = true;
services = {
twingate.enable = true;
};
# SSH AGENT
programs.ssh.startAgent = true;
services.gnome3.gnome-keyring.enable = false;
system.stateVersion = "23.11"; system.stateVersion = "23.11";
nix.settings.experimental-features = ["nix-command" "flakes"]; nix.settings.experimental-features = ["nix-command" "flakes"];

View file

@ -10,6 +10,7 @@
hyprland = { hyprland = {
enable = true; enable = true;
monitor = [",preferred,auto,2"]; monitor = [",preferred,auto,2"];
wallpaper = "wallpaper/wave.jpg";
}; };
}; };
} }

View file

@ -1,8 +1,6 @@
_: { _: {
imports = [ imports = [
../. ../.
./../programs.nix
./../hyprland.nix
./programs.nix ./programs.nix
./configuration.nix ./configuration.nix
./hardware-configuration.nix ./hardware-configuration.nix

View file

@ -5,5 +5,6 @@ _: {
../../../options/common/networking.nix ../../../options/common/networking.nix
../../../options/common/pin-registry.nix ../../../options/common/pin-registry.nix
../../../options/common/preserve-system.nix ../../../options/common/preserve-system.nix
../../../options/common/bluetooth.nix
]; ];
} }

View file

@ -2,6 +2,7 @@
with lib; let with lib; let
username = config.modules.other.system.username; username = config.modules.other.system.username;
cfg = config.modules.hyprland; cfg = config.modules.hyprland;
gitPath = config.modules.other.system.gitPath;
in { in {
imports = [ imports = [
./waybar.nix ./waybar.nix
@ -20,6 +21,11 @@ in {
default = {}; default = {};
type = types.attrs; type = types.attrs;
}; };
wallpaper = mkOption {
description = "wallpaper relative from assets";
default = "";
type = types.str;
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -84,6 +90,10 @@ in {
exec-once = [ exec-once = [
"waybar" "waybar"
"swww init & swww img ${gitPath}/${cfg.wallpaper}"
"keepassxc"
"nextcloud"
"element-desktop --ozone-platform=wayland --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --enable-features=WebRTCPipeWireCpaturer --disable-gpu"
]; ];
bind = [ bind = [
@ -100,6 +110,7 @@ in {
"$mod, o, exec, obsidian --ozone-platform=wayland --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --enable-features=WebRTCPipeWireCpaturer --disable-gpu" "$mod, o, exec, obsidian --ozone-platform=wayland --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --enable-features=WebRTCPipeWireCpaturer --disable-gpu"
"$mod SHIFT, D, exec, webcord --ozone-platform=wayland --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --enable-features=WebRTCPipeWireCpaturer --disable-gpu" "$mod SHIFT, D, exec, webcord --ozone-platform=wayland --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --enable-features=WebRTCPipeWireCpaturer --disable-gpu"
"$mod SHIFT, L, exec, element-desktop --ozone-platform=wayland --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --enable-features=WebRTCPipeWireCpaturer --disable-gpu" "$mod SHIFT, L, exec, element-desktop --ozone-platform=wayland --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --enable-features=WebRTCPipeWireCpaturer --disable-gpu"
"$mod, v, exec, vivaldi --ozone-platform=wayland --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --enable-features=WebRTCPipeWireCpaturer --disable-gpu"
# Monitor management # Monitor management
"$mod SHIFT, k, movecurrentworkspacetomonitor, DP-2" "$mod SHIFT, k, movecurrentworkspacetomonitor, DP-2"
@ -112,8 +123,13 @@ in {
"$mod, down, movefocus, d" "$mod, down, movefocus, d"
"$mod, F, fullscreen" "$mod, F, fullscreen"
# Special Workspaces
"$mod SHIFT, F, movetoworkspacesilent, special"
"$mod, s, togglespecialworkspace,"
# Screenshot # Screenshot
"$mod SHIFT, s, exec, grim -g '$(slurp -d)' - | wl-copy" "$mod SHIFT, s, exec, grim -g \"$(slurp -d)\" - | wl-copy"
] ]
++ ( ++ (
builtins.concatLists (builtins.genList ( builtins.concatLists (builtins.genList (
@ -129,6 +145,11 @@ in {
) )
10) 10)
); );
# Mouse movement
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
} cfg.extra]; } cfg.extra];
}; };
}; };

View file

@ -13,6 +13,11 @@
opacity = 0.8; opacity = 0.8;
blur = true; blur = true;
}; };
steam = {
enable = true;
gamescope = true;
};
}; };
hyprland = { hyprland = {
@ -22,11 +27,12 @@
"DP-2,2560x1440@144,0x0,1" "DP-2,2560x1440@144,0x0,1"
"DP-1,1920x1080@60,2560x0,1" "DP-1,1920x1080@60,2560x0,1"
]; ];
extra = { extra = {
exec-once = [ exec-once = [
"hyprctl dispatch moveworkspacetomonitor 1 DP-2" "hyprctl dispatch moveworkspacetomonitor 1 DP-2"
]; ];
}; };
wallpaper = "wallpaper/wave.jpg";
}; };
}; };

View file

@ -1,8 +1,6 @@
_: { _: {
imports = [ imports = [
../. ../.
./../programs.nix
./../hyprland.nix
./programs.nix ./programs.nix
./configuration.nix ./configuration.nix
./hardware-configuration.nix ./hardware-configuration.nix

View file

@ -6,5 +6,6 @@ _: {
../../../options/common/gpu/nvidia.nix ../../../options/common/gpu/nvidia.nix
../../../options/common/pin-registry.nix ../../../options/common/pin-registry.nix
../../../options/common/preserve-system.nix ../../../options/common/preserve-system.nix
../../../options/common/bluetooth.nix
]; ];
} }

View file

@ -1,6 +1,30 @@
{ config, inputs, pkgs, ... }: { config, inputs, pkgs, lib, ... }:
let let
username = config.modules.other.system.username; username = config.modules.other.system.username;
# Fetch the GLFW with Wayland patches for Minecraft
customGLFW = let
mcWaylandPatchRepo = pkgs.fetchFromGitHub {
owner = "Admicos";
repo = "minecraft-wayland";
rev = "370ce5b95e3ae9bc4618fb45113bc641fbb13867";
sha256 = "sha256-RPRg6Gd7N8yyb305V607NTC1kUzvyKiWsh6QlfHW+JE=";
};
mcWaylandPatches = map (name: "${mcWaylandPatchRepo}/${name}")
(lib.naturalSort (builtins.attrNames (lib.filterAttrs
(name: type:
type == "regular" && lib.hasSuffix ".patch" name)
(builtins.readDir mcWaylandPatchRepo))));
in pkgs.glfw.overrideAttrs (previousAttrs: {
patches = previousAttrs.patches ++ mcWaylandPatches;
buildInputs = previousAttrs.buildInputs ++ [ pkgs.wayland ];
});
# Minecraft launcher with the custom GLFW
minecraftPrismLauncher = pkgs.prismlauncher.override {
glfw = customGLFW;
};
in { in {
home-manager.users.${username} = { home-manager.users.${username} = {
home.packages = let home.packages = let
@ -9,4 +33,9 @@ in {
in with pkgs; [ in with pkgs; [
]; ];
}; };
# System-wide installation of Minecraft PrismLauncher
environment.systemPackages = [
minecraftPrismLauncher
];
} }

View file

@ -43,7 +43,6 @@ in {
smartmontools smartmontools
python3 python3
rustdesk rustdesk
neovim
tmux tmux
kitty kitty
nextcloud-client nextcloud-client
@ -57,6 +56,15 @@ in {
xdg-utils # xdg-mime script xdg-utils # xdg-mime script
webcord webcord
element-desktop element-desktop
swww
toipe
keepassxc
vivaldi
yubikey-personalization-gui
yubikey-personalization
yubioath-flutter
fzf
nix-index
]; ];
}; };
} }

View file

@ -26,6 +26,7 @@ in {
ffmpeg_6-full ffmpeg_6-full
flameshot flameshot
foot foot
img2pdf
gcc gcc
gdb gdb
gnumake gnumake
@ -47,6 +48,7 @@ in {
pamixer pamixer
pavucontrol pavucontrol
pcmanfm pcmanfm
pdfarranger
pfetch pfetch
playerctl playerctl
polkit polkit

View file

@ -14,5 +14,6 @@ _: {
./WM ./WM
./alacritty.nix ./alacritty.nix
./firefox.nix ./firefox.nix
./steam.nix
]; ];
} }

View file

@ -18,7 +18,7 @@ in {
enable = true; enable = true;
policies = { policies = {
DisableTelemetry = true; DisableTelemetry = true;
DisableFirefoxStudies = true; DisableFirefoxStudies = true;
EnableTrackingProtection = { EnableTrackingProtection = {
Value= true; Value= true;
@ -36,28 +36,30 @@ in {
DisplayBookmarksToolbar = "never"; # alternatives: "always" or "newtab" DisplayBookmarksToolbar = "never"; # alternatives: "always" or "newtab"
DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on"
SearchBar = "unified"; # alternative: "separate" SearchBar = "unified"; # alternative: "separate"
FirefoxSuggest = { FirefoxSuggest = {
WebSuggestions = true; WebSuggestions = true;
ImproveSuggest = true; ImproveSuggest = true;
Locked = true; Locked = true;
}; };
SearchSuggestEnabled = true; SearchSuggestEnabled = true;
theme = { theme = {
colors = { colors = {
background-darker = "181825"; background-darker = "181825";
background = "1e1e2e"; background = "1e1e2e";
foreground = "cdd6f4"; foreground = "cdd6f4";
}; };
}; };
font = "Lexend"; OfferToSaveLogins = false;
ExtensionSettings = lib.mkMerge [{
"uBlock0@raymondhill.net" = { font = "Lexend";
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; ExtensionSettings = lib.mkMerge [{
installation_mode = "force_installed"; "uBlock0@raymondhill.net" = {
}; install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
} cfg.extensions]; installation_mode = "force_installed";
}; };
} cfg.extensions];
};
}; };
}; };
}; };

22
modules/gui/steam.nix Normal file
View file

@ -0,0 +1,22 @@
{ config, lib, inputs, pkgs, ... }:
with lib; let
username = config.modules.other.system.username;
cfg = config.modules.programs.steam;
in {
options.modules.programs.steam = {
enable = mkEnableOption "steam";
gamescope = mkEnableOption "gamescope";
};
config = mkIf cfg.enable {
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
gamescopeSession.enable = mkIf cfg.gamescope true;
};
home-manager.users.${username} = {
};
};
}

View file

@ -82,6 +82,7 @@ in {
java-language-server.enable = true; java-language-server.enable = true;
#pylyzer.enable = true; #pylyzer.enable = true;
rnix-lsp.enable = true; rnix-lsp.enable = true;
pyright.enable = true;
}; };
#onAttach = '' #onAttach = ''
# vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') # vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
@ -159,11 +160,36 @@ in {
enable = true; enable = true;
settings.theme = "dark"; settings.theme = "dark";
}; };
}; };
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
zen-mode-nvim zen-mode-nvim
lazygit-nvim
]; ];
keymaps = [
{
mode = "n";
key = "<leader>pv";
action = "<cmd>Explore<CR>";
}
{
mode = "n";
key = "<leader>w";
action = "<cmd>w<CR>";
}
{
mode = "n";
key = "<leader>qw";
action = "<cmd>q<CR>";
}
{
mode = "n";
key = "<leader>gg";
action = "<cmd>LazyGit<CR>";
}
];
}; };
}; };
}; };

View file

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
let
username = config.modules.other.system.username;
in {
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
services.blueman.enable = true;
# Bluetooth headset media control buttons
systemd.user.services.mpris-proxy = {
description = "Mpris proxy";
after = [ "network.target" "sound.target" ];
wantedBy = [ "default.target" ];
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
};
}