From 79cbf5400eb721619a5db8e3feaa3e45de093838 Mon Sep 17 00:00:00 2001 From: 4o1x5 <4o1x5@4o1x5.dev> Date: Sun, 28 Apr 2024 11:35:35 +0200 Subject: [PATCH] created files --- .gitignore | 1 + nixos/apps/communication.nix | 14 + nixos/apps/firefox.nix | 1 + nixos/apps/keepassxc.nix | 8 + nixos/apps/music.nix | 9 + nixos/apps/office.nix | 8 + nixos/apps/prod.nix | 9 + nixos/apps/syncthing.nix | 8 + nixos/configs/alacritty.nix | 18 + nixos/configs/btop.nix | 7 + nixos/configs/colors.nix | 19 + nixos/configs/firefox.nix | 108 ++ nixos/configs/gpu-screen-recorder.nix | 16 + nixos/configs/i3.nix | 100 ++ nixos/configs/kitty.nix | 16 + nixos/configs/ollama.nix | 9 + nixos/configs/picom.nix | 76 ++ nixos/configs/polybar.nix | 252 ++++ nixos/configs/rofi.nix | 9 + nixos/configs/st.nix | 14 + nixos/configs/vscode.nix | 72 ++ nixos/configuration.nix | 105 ++ nixos/desktop.nix | 68 ++ nixos/dev.nix | 29 + nixos/flake.lock | 120 ++ nixos/flake.nix | 55 + nixos/gaming.nix | 43 + nixos/opt/firefox/user.js | 1218 +++++++++++++++++++ nixos/opt/firefox/userChrome.css | 1396 ++++++++++++++++++++++ nixos/opt/firefox/userContent.css | 532 +++++++++ nixos/opt/st/st.h | 469 ++++++++ nixos/system/cursor.nix | 23 + nixos/system/display.nix | 23 + nixos/system/drivers/shitvidia-patch.nix | 40 + nixos/system/essentials.nix | 16 + nixos/system/remap.nix | 8 + nixos/system/security.nix | 20 + nixos/system/shell.nix | 56 + nixos/system/sound.nix | 19 + readme.md | 3 + rice.png | Bin 0 -> 1456635 bytes 41 files changed, 5017 insertions(+) create mode 100644 .gitignore create mode 100755 nixos/apps/communication.nix create mode 100755 nixos/apps/firefox.nix create mode 100755 nixos/apps/keepassxc.nix create mode 100755 nixos/apps/music.nix create mode 100755 nixos/apps/office.nix create mode 100755 nixos/apps/prod.nix create mode 100755 nixos/apps/syncthing.nix create mode 100644 nixos/configs/alacritty.nix create mode 100644 nixos/configs/btop.nix create mode 100755 nixos/configs/colors.nix create mode 100644 nixos/configs/firefox.nix create mode 100644 nixos/configs/gpu-screen-recorder.nix create mode 100755 nixos/configs/i3.nix create mode 100644 nixos/configs/kitty.nix create mode 100644 nixos/configs/ollama.nix create mode 100755 nixos/configs/picom.nix create mode 100755 nixos/configs/polybar.nix create mode 100755 nixos/configs/rofi.nix create mode 100644 nixos/configs/st.nix create mode 100644 nixos/configs/vscode.nix create mode 100755 nixos/configuration.nix create mode 100755 nixos/desktop.nix create mode 100755 nixos/dev.nix create mode 100755 nixos/flake.lock create mode 100755 nixos/flake.nix create mode 100755 nixos/gaming.nix create mode 100755 nixos/opt/firefox/user.js create mode 100755 nixos/opt/firefox/userChrome.css create mode 100755 nixos/opt/firefox/userContent.css create mode 100755 nixos/opt/st/st.h create mode 100755 nixos/system/cursor.nix create mode 100755 nixos/system/display.nix create mode 100755 nixos/system/drivers/shitvidia-patch.nix create mode 100755 nixos/system/essentials.nix create mode 100755 nixos/system/remap.nix create mode 100755 nixos/system/security.nix create mode 100755 nixos/system/shell.nix create mode 100755 nixos/system/sound.nix create mode 100644 readme.md create mode 100644 rice.png diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..236eff2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +nixos/hardware-configuration.nix \ No newline at end of file diff --git a/nixos/apps/communication.nix b/nixos/apps/communication.nix new file mode 100755 index 0000000..56da289 --- /dev/null +++ b/nixos/apps/communication.nix @@ -0,0 +1,14 @@ +{ pkgs, config, ... }: +{ + + programs.steam.enable = true; + + environment.systemPackages = with pkgs; [ + mumble # voip + element-desktop # fully featured matrix client + #gomuks # tui matrix client + ]; + + + +} diff --git a/nixos/apps/firefox.nix b/nixos/apps/firefox.nix new file mode 100755 index 0000000..8b13789 --- /dev/null +++ b/nixos/apps/firefox.nix @@ -0,0 +1 @@ + diff --git a/nixos/apps/keepassxc.nix b/nixos/apps/keepassxc.nix new file mode 100755 index 0000000..1b9de9f --- /dev/null +++ b/nixos/apps/keepassxc.nix @@ -0,0 +1,8 @@ +{ pkgs, config, ... }: +{ + + environment.systemPackages = with pkgs; [ + keepassxc + ]; +} + diff --git a/nixos/apps/music.nix b/nixos/apps/music.nix new file mode 100755 index 0000000..f7a17b8 --- /dev/null +++ b/nixos/apps/music.nix @@ -0,0 +1,9 @@ +{ pkgs, config, ... }: { + environment.systemPackages = with pkgs; [ + cmus + playerctl + jamesdsp + yt-dlp + picard # audio metadata + ]; +} diff --git a/nixos/apps/office.nix b/nixos/apps/office.nix new file mode 100755 index 0000000..d155c80 --- /dev/null +++ b/nixos/apps/office.nix @@ -0,0 +1,8 @@ +{ pkgs, config, ... }: +{ + environment.systemPackages = with pkgs; [ + libreoffice + ]; +} + + diff --git a/nixos/apps/prod.nix b/nixos/apps/prod.nix new file mode 100755 index 0000000..bd42887 --- /dev/null +++ b/nixos/apps/prod.nix @@ -0,0 +1,9 @@ +{ pkgs, config, ... }: { + environment.systemPackages = with pkgs; [ + taskwarrior + timewarrior + logseq + ]; +} + + diff --git a/nixos/apps/syncthing.nix b/nixos/apps/syncthing.nix new file mode 100755 index 0000000..5250b59 --- /dev/null +++ b/nixos/apps/syncthing.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: { + services.syncthing = { + enable = true; + user = "grape"; + dataDir = "/home/grape/Documents"; + configDir = "/home/grape/.syncthing"; + }; +} diff --git a/nixos/configs/alacritty.nix b/nixos/configs/alacritty.nix new file mode 100644 index 0000000..1280421 --- /dev/null +++ b/nixos/configs/alacritty.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: { + + home-manager.users.grape.programs.alacritty = + { + enable = true; + settings = { + font.normal = { + family = "Jetbrains Mono Nerd font"; + style = "Regular"; + }; + #shell.program = "${pkgs.zsh}"; + colors.primary = { + foreground = "#ffffff"; + background = "#191830"; + }; + }; + }; +} diff --git a/nixos/configs/btop.nix b/nixos/configs/btop.nix new file mode 100644 index 0000000..e802520 --- /dev/null +++ b/nixos/configs/btop.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + home-manager.users.grape = { + programs.btop.settings = { + theme_background = false; + }; + }; +} diff --git a/nixos/configs/colors.nix b/nixos/configs/colors.nix new file mode 100755 index 0000000..6daf93b --- /dev/null +++ b/nixos/configs/colors.nix @@ -0,0 +1,19 @@ +{ + + foreground = "#FFFFFF"; + foreground_alt = "#F72585"; + + background = "#191830"; + + border = "#F72585"; + warning = "#f00"; + + textHighlight = "#FAD000"; + selectedWindowHighlight = "#FAD000"; + + seperatorColor = "#FAD000"; + + + i3BorderColor = "#FAD000"; +} + diff --git a/nixos/configs/firefox.nix b/nixos/configs/firefox.nix new file mode 100644 index 0000000..f6cf1c5 --- /dev/null +++ b/nixos/configs/firefox.nix @@ -0,0 +1,108 @@ +{ pkgs, ... }: { + home-manager.users.grape = { + programs.firefox = { + enable = true; + profiles = { + "user" = { + isDefault = true; + id = 0; + # TODO fix impurity + extraConfig = builtins.readFile "/etc/nixos/opt/firefox/user.js"; # custom userjs config + userChrome = builtins.readFile "/etc/nixos/opt/firefox/userChrome.css"; # browser styles + userContent = builtins.readFile "/etc/nixos/opt/firefox/userContent.css"; # browser styles + + extensions = + [ + + pkgs.nur.repos.rycee.firefox-addons.ublock-origin + pkgs.nur.repos.rycee.firefox-addons.clearurls # clear tracking urls + pkgs.nur.repos.rycee.firefox-addons.stylus # cool styling for websites + pkgs.nur.repos.rycee.firefox-addons.localcdn # locally stores frameworks such as vue, tailwind ect.. + pkgs.nur.repos.rycee.firefox-addons.libredirect # redirects to libre version of spyware sites + pkgs.nur.repos.rycee.firefox-addons.tridactyl # vim like keybinds + pkgs.nur.repos.rycee.firefox-addons.istilldontcareaboutcookies # dismisses cookie banners + pkgs.nur.repos.rycee.firefox-addons.noscript # block js + pkgs.nur.repos.rycee.firefox-addons.tabliss # sexy new tab + ]; + search.force = true; + search.order = [ "Searxng" "DuckDuckGo" ]; + search.default = "Searxng"; + search.engines = { + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { name = "type"; value = "packages"; } + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + "Searxng" = { + urls = [{ + template = "https://search.rhscz.eu/"; + params = [ + { name = "q"; value = "{searchTerms}"; } + ]; + }]; + }; + "Home Manager" = { + definedAliases = [ "@hm" ]; + urls = [{ + template = "https://mipmip.github.io/home-manager-option-search/"; + params = [ + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + }; + "Nix Options" = { + definedAliases = [ "@no" ]; + urls = [{ + template = "https://search.nixos.org/options?type=packages"; + params = [ + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + "Stylus styles" = { + urls = [{ + template = " https://userstyles.world/search"; + params = [ + { + name = "q"; + value = "{searchTerms}"; + } + ]; + }]; + definedAliases = [ "@st" ]; + }; + "Twitch" = { + urls = [{ + template = " https://twitch.tv/search"; + params = [ + { + name = "term"; + value = "{searchTerms}"; + } + ]; + }]; + definedAliases = [ "@tw" ]; + }; + }; + }; + }; + }; + }; + }; + programs.firejail = { + wrappedBinaries = { + firefox = { + executable = "${pkgs.firefox}/bin/firefox"; + profile = "${pkgs.firejail}/etc/firejail/firefox.profile"; + desktop = "${pkgs.firefox}/share/applications/firefox.desktop"; + }; + }; + }; +} + + diff --git a/nixos/configs/gpu-screen-recorder.nix b/nixos/configs/gpu-screen-recorder.nix new file mode 100644 index 0000000..c36b40a --- /dev/null +++ b/nixos/configs/gpu-screen-recorder.nix @@ -0,0 +1,16 @@ +{ pkgs, config, ... }: +{ + + + environment.systemPackages = [ + (pkgs.runCommand "gpu-screen-recorder" + { + nativeBuildInputs = [ pkgs.makeWrapper ]; + } '' + mkdir -p $out/bin + makeWrapper ${pkgs.gpu-screen-recorder}/bin/gpu-screen-recorder $out/bin/gpu-screen-recorder \ + --prefix LD_LIBRARY_PATH : ${pkgs.libglvnd}/lib \ + --prefix LD_LIBRARY_PATH : ${config.boot.kernelPackages.nvidia_x11}/lib + '') + ]; +} diff --git a/nixos/configs/i3.nix b/nixos/configs/i3.nix new file mode 100755 index 0000000..53f51b2 --- /dev/null +++ b/nixos/configs/i3.nix @@ -0,0 +1,100 @@ +{ pkgs, lib, ... }: { + + + home-manager.users.grape.xsession.windowManager.i3 = { + enable = true; + config = { + + # disable i3 bar + bars = [ ]; + + # Starting compositor and adding background to xroot via nitrogen + startup = [ + { + command = "nitrogen --set-zoom-fill /home/grape/Pictures/bg.jpg"; + } + { + command = "picom -b --experimental-backends"; + } + { + command = "polybar --reload"; + } + ]; + # defining alt as modifier + modifier = "Mod1"; + gaps.inner = 12; + + # TODO add colors from variables + # colors for focused windows + colors.focused = { + background = "#FAD000"; + border = "#FAD000"; + childBorder = "#FFF"; + indicator = "#FAD000"; + text = "#FAD000"; + }; + colors.focusedInactive = { + background = "#FAD000"; + border = "#FAD000"; + childBorder = "#FFF"; + indicator = "#FAD000"; + text = "#FAD000"; + }; + + + keybindings = + lib.mkOptionDefault + { + + # application keybinds + "mod4+d" = "exec rofi -show drun"; + "mod4+e" = "exec rofi -show calc"; + "mod4+t" = "exec alacritty"; + "mod4+r" = "exec firefox"; + "mod4+w" = "exec ~/.config/scripts/save_replay.sh"; + + # power off + "mod4+Shift+Delete" = "exec shutdown now"; + + # language settings + "mod4+1" = "exec setxkbmap us"; + "mod4+2" = "exec setxkbmap hu"; + + # screenshot + # shit needs work + "Print" = "exec scrot '%Y-%m-%d_%H-%M-%S.png' -e 'mv $f ~/Pictures/screenshots && xclip -selection clipboard -t image/png -i ~/Pictures/screenshots/$f'"; + "mod4+Print" = "exec scrot '%Y-%m-%d_%H-%M-%S.png' -e -u 'mv $f ~/Pictures/screenshots && xclip -selection clipboard -t image/png -i ~/Pictures/screenshots/$f'"; + # select window to screenshot then saves it to /home/pictures/screenshots/date+random.png and copies to clipboard + "Shift+Print" = ''exec "NUM=$(echo $RANDOM) maim -s $HOME/Pictures/screenshots/$(date +%Y%m%d_%H%M)$NUM.png ; cat $HOME/Pictures/screenshots/$(date +%Y%m%d_%H%M)$NUM.png | xclip -selection clipboard -t image/png"''; + + + # Volume adjustment for current player + "shift+XF86AudioRaiseVolume" = "exec --no-startup-id playerctl volume 0.1+"; + "shift+XF86AudioLowerVolume" = "exec --no-startup-id playerctl volume 0.1-"; + # seeking for current player + "Control+XF86AudioRaiseVolume" = "exec --no-startup-id playerctl position 10+"; + "Control+XF86AudioLowerVolume" = "exec --no-startup-id playerctl position 10-"; + # track skipping n stuff + "XF86AudioNext" = "exec --no-startup-id playerctl next"; + "XF86AudioPlay" = "exec --no-startup-id playerctl play-pause"; + "XF86AudioPrev" = "exec --no-startup-id playerctl previous"; + + # adjusting system mvolume + "XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10%"; + "XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% "; + "XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle"; + "XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle"; + + + }; + }; + + # disable stupid and ugly title bars + # and for some reason client.active doesnt change the colors... + extraConfig = "default_border pixel 4\n default_floating_border pixel 1 \n client.focused #FAD000 #285577 #ffffff #FAD000 #FAD000 \n client.focused_inactive #063340 #141414 #000000 #121212 #063340"; + }; +} + + + + diff --git a/nixos/configs/kitty.nix b/nixos/configs/kitty.nix new file mode 100644 index 0000000..214ad1a --- /dev/null +++ b/nixos/configs/kitty.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: { + + home-manager.users.grape.programs.kitty = { + + enable = true; + font.name = "Jetbrains Mono Nerd font"; + + extraConfig = '' + enable_audio_bell no + window_alert_on_bell no + foreground #dddddd + background #191830 + ''; + + }; +} diff --git a/nixos/configs/ollama.nix b/nixos/configs/ollama.nix new file mode 100644 index 0000000..c4257b7 --- /dev/null +++ b/nixos/configs/ollama.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: { + + environment.systemPackages = with pkgs; [ + ollama + ]; + services.ollama.enable = true; + services.ollama.acceleration = "cuda"; + +} diff --git a/nixos/configs/picom.nix b/nixos/configs/picom.nix new file mode 100755 index 0000000..daad8b2 --- /dev/null +++ b/nixos/configs/picom.nix @@ -0,0 +1,76 @@ +{ pkgs, ... }: { + + home-manager.users.grape.services.picom = { + enable = true; + backend = "glx"; + vSync = false; # disable vsync to reduce input delay + extraArgs = [ "-b" "--experimental-backends" ]; # enable deamon mode and experimental backends for blur + package = + (pkgs.picom.overrideAttrs (oldAttrs: rec { + src = pkgs.fetchFromGitHub { + owner = "pijulius"; + repo = "picom"; + rev = "da21aa8ef70f9796bc8609fb495c3a1e02df93f9"; + hash = "sha256-rxGWAot+6FnXKjNZkMl1uHHHEMVSxm36G3VoV1vSXLA="; + }; + })); + + settings = { + blur-method = "dual_kawase"; + blur-size = 12; + blur-strength = 5; + blur-background = true; + blur-kern = "3x3box"; + + blur-background-exclude = [ + "window_type = 'dock'" + "window_type = 'desktop'" + "_GTK_FRAME_EXTENTS@:c" + "class_g ~= 'slop'" + ]; + + opacity-rule = [ + "80:class_g *= 'st'" + "80:class_g *= 'kitty'" + "80:class_g *= 'alacritty'" + "80:class_g *= 'Alacritty'" + "90:class_g *= 'jamesdsp'" + "90:class_g *= 'polybar'" + "80:class_g *= 'codium'" + "80:class_g *= 'rofi'" + "80:class_g *= 'lutris'" + "80:class_g *= 'Mumble'" + "85:class_g *= 'Logseq'" + "85:class_g *= 'Codium'" + ]; + + # rounding + corner-radius = 15; + use-damage = false; + + inactive-opacity = 1.0; + frame-opacity = 1.0; + inactive-opacity-override = false; + + + fading = true; + fade-in-step = 0.03; + fade-out-step = 0.03; + + animations = true; + animation-for-open-window = "squeeze"; + animation-for-transient-window = "zoom"; + animation-for-unmap-window = "squeeze"; + animation-for-workspace-switch-in = "zoom"; + animation-for-workspace-switch-out = "auto"; + + animation-stiffness = 500; + animation-dampening = 40; + animation-window-mass = 1; + animation-delta = 7; + animation-force-steps = true; + + }; + }; +} + diff --git a/nixos/configs/polybar.nix b/nixos/configs/polybar.nix new file mode 100755 index 0000000..6e04186 --- /dev/null +++ b/nixos/configs/polybar.nix @@ -0,0 +1,252 @@ +let + colors = { + fg = "#FFFFFF"; + bg = "#191830"; + border = "#F72585"; + warn = "#f00"; + altfg = "#F72585"; + + invisible = "#00400080"; + + currentWorkspace = "#FAD000"; + seperatorColor = "#FAD000"; + }; +in +{ + + home-manager.users.grape.services.polybar = { + enable = true; + script = "polybar --reload"; + # Nix is great and all.. but this is a bit too execsive + config = { + "module/date" = { + type = "internal/date"; + font-1 = "Jetbrains Mono Nerd font"; + interval = 1; + time = "%I:%M:%S"; + date = "%Y-%m-%d%"; + format = "