From 4b8372e4a595c0b2f08d7cce0486519b9ee6d7fc Mon Sep 17 00:00:00 2001 From: krizej Date: Thu, 13 Jun 2024 15:38:40 +0200 Subject: [PATCH] what --- .gitignore | 1 + configuration.nix | 114 ++++++++++++++++++++++++++++ files/prompt.fish | 64 ++++++++++++++++ flake.lock | 65 ++++++++++++++++ flake.nix | 31 ++++++++ home.nix | 140 ++++++++++++++++++++++++++++++++++ pkgs/default.nix | 11 +++ pkgs/e17gtk-revolved.nix | 30 ++++++++ pkgs/ezquake-fork.nix | 41 ++++++++++ pkgs/oxylite-icon-theme.nix | 50 ++++++++++++ pkgs/win7-cursors.nix | 26 +++++++ pkgs/winvista-cursors.nix | 26 +++++++ pkgs/winxp-cursors.nix | 41 ++++++++++ pkgs/winxp-icons.nix | 40 ++++++++++ programs/alacritty.nix | 42 +++++++++++ programs/autorandr.nix | 34 +++++++++ programs/default.nix | 12 +++ programs/firefox.nix | 95 +++++++++++++++++++++++ programs/fish.nix | 16 ++++ programs/i3.nix | 146 ++++++++++++++++++++++++++++++++++++ programs/rofi.nix | 52 +++++++++++++ readme.txt | 2 + services/default.nix | 6 ++ services/dunst.nix | 15 ++++ services/flameshot.nix | 10 +++ services/picom.nix | 4 + 26 files changed, 1114 insertions(+) create mode 100644 .gitignore create mode 100644 configuration.nix create mode 100644 files/prompt.fish create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 home.nix create mode 100644 pkgs/default.nix create mode 100644 pkgs/e17gtk-revolved.nix create mode 100644 pkgs/ezquake-fork.nix create mode 100644 pkgs/oxylite-icon-theme.nix create mode 100644 pkgs/win7-cursors.nix create mode 100644 pkgs/winvista-cursors.nix create mode 100644 pkgs/winxp-cursors.nix create mode 100644 pkgs/winxp-icons.nix create mode 100644 programs/alacritty.nix create mode 100644 programs/autorandr.nix create mode 100644 programs/default.nix create mode 100644 programs/firefox.nix create mode 100644 programs/fish.nix create mode 100644 programs/i3.nix create mode 100644 programs/rofi.nix create mode 100644 readme.txt create mode 100644 services/default.nix create mode 100644 services/dunst.nix create mode 100644 services/flameshot.nix create mode 100644 services/picom.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..577b0a0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +hardware-configuration.nix diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..7cb27fd --- /dev/null +++ b/configuration.nix @@ -0,0 +1,114 @@ +{ pkgs, ... }: { + imports = [ + ./hardware-configuration.nix + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + networking.hostName = "laptop"; + networking.networkmanager.enable = true; + + time.timeZone = "Europe/Warsaw"; + + services.xserver = { + enable = true; + windowManager.i3.enable = true; + + xkb.layout = "pl"; + + libinput = { + enable = true; + touchpad = { + naturalScrolling = false; # it's reversed on my laptop for some reason + tapping = true; + tappingButtonMap = "lmr"; + scrollMethod = "edge"; + }; + }; + # this shit doesn't actually work + autoRepeatDelay = 180; + autoRepeatInterval = 50; + # this does + displayManager.sessionCommands = "xset r rate 180 50\n"; + + }; + + fonts = { + enableDefaultPackages = true; + packages = with pkgs; [ + jetbrains-mono + ]; + fontconfig.defaultFonts = { + serif = [ "JetBrains Mono NL" ]; + sansSerif = [ "JetBrains Mono NL" ]; + monospace = [ "JetBrains Mono NL" ]; + }; + }; + + sound.enable = true; + hardware.pulseaudio.enable = true; + + # fucking stupid android shit man + users.groups.plugdev.members = [ "krizej" ]; + services.udev.extraRules = '' + SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="2e76", MODE="0666", GROUP="plugdev" + ''; + + users.users.krizej = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + shell = pkgs.fish; + }; + + qt = { + enable = true; + platformTheme = "gnome"; + style = "adwaita-dark"; + }; + + programs.nano.enable = false; + programs.dconf.enable = true; + + # any-nix-shell + programs.fish.enable = true; + programs.fish.promptInit = '' + ${pkgs.any-nix-shell}/bin/any-nix-shell fish --info-right | source + ''; + + environment.systemPackages = with pkgs; [ + ed # is the standard text editor. + vim + wget + btop + git + gcc + unzip + python312 + ripgrep + gnomeExtensions.user-themes + xdg-user-dirs + man-pages + man-pages-posix + ]; + + documentation.dev.enable = true; + + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + services.openssh.enable = true; + + security.sudo.extraConfig = '' + Defaults pwfeedback + ''; + + nixpkgs.overlays = import ./pkgs pkgs; + nixpkgs.config.allowUnfree = true; + system.stateVersion = "23.11"; +} + diff --git a/files/prompt.fish b/files/prompt.fish new file mode 100644 index 0000000..f01bd42 --- /dev/null +++ b/files/prompt.fish @@ -0,0 +1,64 @@ +# name: Informative Vcs +# author: Mariusz Smykula + +# function fish_prompt --description 'Write out the prompt' + set -l last_pipestatus $pipestatus + set -lx __fish_last_status $status # Export for __fish_print_pipestatus. + + if not set -q __fish_git_prompt_show_informative_status + set -g __fish_git_prompt_show_informative_status 1 + end + if not set -q __fish_git_prompt_hide_untrackedfiles + set -g __fish_git_prompt_hide_untrackedfiles 1 + end + if not set -q __fish_git_prompt_color_branch + set -g __fish_git_prompt_color_branch magenta --bold + end + if not set -q __fish_git_prompt_showupstream + set -g __fish_git_prompt_showupstream informative + end + if not set -q __fish_git_prompt_color_dirtystate + set -g __fish_git_prompt_color_dirtystate blue + end + if not set -q __fish_git_prompt_color_stagedstate + set -g __fish_git_prompt_color_stagedstate yellow + end + if not set -q __fish_git_prompt_color_invalidstate + set -g __fish_git_prompt_color_invalidstate red + end + if not set -q __fish_git_prompt_color_untrackedfiles + set -g __fish_git_prompt_color_untrackedfiles $fish_color_normal + end + if not set -q __fish_git_prompt_color_cleanstate + set -g __fish_git_prompt_color_cleanstate green --bold + end + + set -l color_cwd + set -l suffix + if functions -q fish_is_root_user; and fish_is_root_user + if set -q fish_color_cwd_root + set color_cwd $fish_color_cwd_root + else + set color_cwd $fish_color_cwd + end + set suffix '#' + else + set color_cwd $fish_color_cwd + set suffix '$' + end + + # PWD + set_color $color_cwd + echo -n (prompt_pwd) + set_color normal + + printf '%s ' (fish_vcs_prompt) + + set -l status_color (set_color $fish_color_status) + set -l statusb_color (set_color --bold $fish_color_status) + set -l prompt_status (__fish_print_pipestatus "[" "]" "|" "$status_color" "$statusb_color" $last_pipestatus) + echo -n $prompt_status + set_color normal + + echo -n "$suffix " +# end diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..51fd89d --- /dev/null +++ b/flake.lock @@ -0,0 +1,65 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714043624, + "narHash": "sha256-Xn2r0Jv95TswvPlvamCC46wwNo8ALjRCMBJbGykdhcM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "86853e31dc1b62c6eeed11c667e8cdd0285d4411", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-23.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1714531828, + "narHash": "sha256-ILsf3bdY/hNNI/Hu5bSt2/KbmHaAVhBbNUOdGztTHEg=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "0638fe2715d998fa81d173aad264eb671ce2ebc1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nur": { + "locked": { + "lastModified": 1715942738, + "narHash": "sha256-85fVkx0bFqblV89A/KLGuJd0IsxCT0wOTIFBQWM1p0o=", + "owner": "nix-community", + "repo": "NUR", + "rev": "cbe245e7ed40f92a6d40bb4a458f9003bbe612d7", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "nur": "nur" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..217cdb7 --- /dev/null +++ b/flake.nix @@ -0,0 +1,31 @@ +{ + description = ":-)"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; + home-manager = { + url = "github:nix-community/home-manager/release-23.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nur.url = "github:nix-community/NUR"; + }; + outputs = { nixpkgs, home-manager, nur, ... }: { + nixosConfigurations = { + laptop = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + { nixpkgs.overlays = [ nur.overlay ]; } + ./configuration.nix + nur.nixosModules.nur + home-manager.nixosModules.home-manager { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.krizej = import ./home.nix; + }; + } + ]; + }; + }; + }; +} + diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..c6fa1c4 --- /dev/null +++ b/home.nix @@ -0,0 +1,140 @@ +args @ { inputs, lib, config, pkgs, ... }: +let + importCfg = ({prefix, name}: + let + cfg_path = ./${prefix}/${name}.nix; + in ( + if builtins.pathExists cfg_path then ( + ((import cfg_path) args) + ) else ( + { enable = true; } + ) + ) + ); +in { + home.stateVersion = "23.11"; + home.username = "krizej"; + home.homeDirectory = "/home/krizej"; + + services = lib.genAttrs (import ./services) + (cfg_name: importCfg { prefix = "services"; name = cfg_name; }); + + programs = lib.genAttrs (import ./programs) + (cfg_name: importCfg { prefix = "programs"; name = cfg_name; }); + + home.packages = with pkgs; [ + xfce.thunar + xfce.tumbler # image previews in thunar + xfce.thunar-volman + xfce.thunar-archive-plugin + xfce.thunar-media-tags-plugin + xarchiver + fortune + vim-full + jetbrains.pycharm-professional + android-studio + android-tools + feh + element-desktop + lxappearance + pavucontrol + ezquake + discord + libreoffice-qt + wineWowPackages.stable + winetricks + # # It is sometimes useful to fine-tune packages, for example, by applying + # # overrides. You can do that directly here, just don't forget the + # # parentheses. Maybe you want to install Nerd Fonts with a limited number of + # # fonts? + # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) + + # # You can also create simple shell scripts directly inside your + # # configuration. For example, this adds a command 'my-hello' to your + # # environment: + # (pkgs.writeShellScriptBin "my-hello" '' + # echo "Hello, ${config.home.username}!" + # '') + ]; + + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; + + home.sessionVariables = { + EDITOR = "vim"; + MANSECT = "2:3:3p:3type:1:1p:n:l:8:0:0p:5:4:9:6:7"; + + # xdg crap thx poz + XDG_DATA_HOME = "$HOME/.local/share"; + XDG_CONFIG_HOME = "$HOME/.config"; + XDG_STATE_HOME = "$HOME/.local/state"; + XDG_CACHE_HOME = "$HOME/.cache"; + ANDROID_USER_HOME = "$XDG_DATA_HOME/android"; + ANDROID_HOME = "$XDG_DATA_HOME/android/sdk"; + GRADLE_USER_HOME = "$XDG_DATA_HOME/gradle"; + PYTHONSTARTUP = "$XDG_CONFIG_HOME/python/pythonrc"; + HISTFILE = "$XDG_CACHE_HOME/bash/history"; + CARGO_HOME = "$XDG_DATA_HOME/cargo"; + _JAVA_OPTIONS = "-Djava.utils.prefs.userRoot=$XDG_CONFIG_HOME/java"; + GNUPGHOME = "$XDG_DATA_HOME/cargo"; + WINEPREFIX = "$XDG_DATA_HOME/wine"; + RUSTUP_HOME = "$XDG_DATA_HOME/rustup"; + NUGET_PACKAGES = "$XDG_CACHE_HOME/NuGetPackages"; + FCEUX_HOME = "$XDG_CONFIG_HOME/fceux"; + DOTNET_CLI_HOME = "$XDG_CONFIG_HOME/dotnet"; + GTK2_RC_FILES = lib.mkForce "$XDG_CONFIG_HOME/gtk-2.0/gtkrc"; + }; + + xdg.userDirs = let + home = config.home.homeDirectory; + in { + enable = true; + desktop = "${home}/desktop"; + documents = "${home}/documents"; + download = "${home}/downloads"; + music = "${home}/music"; + pictures = "${home}/pictures"; + publicShare = "${home}/public"; + templates = "${home}/templates"; + videos = "${home}/videos"; + }; + + # xorg crap (incl. themes etc) + + xsession = { + enable = true; + # special case - i3 is not listed in ./programs/default.nix + windowManager.i3 = (import ./programs/i3.nix args); + }; + +# home.pointerCursor = { +# gtk.enable = true; +# x11.enable = true; +# name = "Windows-7-Aero-Cursors_Default"; +# package = pkgs.win7-cursors; +# }; + + gtk = { + enable = true; + iconTheme = { + name = "oxylite"; + package = pkgs.oxylite-icon-theme; + }; + theme = { + name = "Adwaita-dark"; + package = pkgs.gnome.gnome-themes-extra; + }; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..8fe14fa --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,11 @@ +pkgs: [ + (final: prev: { + winvista-cursors = pkgs.callPackage ./winvista-cursors.nix {}; + win7-cursors = pkgs.callPackage ./win7-cursors.nix {}; + winxp-cursors = pkgs.callPackage ./winxp-cursors.nix {}; + winxp-icons = pkgs.callPackage ./winxp-icons.nix {}; + oxylite-icon-theme = pkgs.callPackage ./oxylite-icon-theme.nix {}; + e17gtk-revolved = pkgs.callPackage ./e17gtk-revolved.nix {}; + }) +] + diff --git a/pkgs/e17gtk-revolved.nix b/pkgs/e17gtk-revolved.nix new file mode 100644 index 0000000..04949e1 --- /dev/null +++ b/pkgs/e17gtk-revolved.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchFromGitea }: +stdenv.mkDerivation { + pname = "e17gtk-revolved"; + version = "2023-06-13"; + + src = fetchFromGitea { + domain = "git.disroot.org"; + owner = "eudaimon"; + repo = "E17gtk-revolved"; + rev = "2217140ec82dc0cf10340d8490a3ca23d1567577"; + hash = "sha256-RiwraD7ou6MRQbP/BvwkV3djU+O+/wjwHjeV16AUotw="; + }; + + installPhase = '' + runHook preInstall + + install -d $out/share/themes/E17gtk-revolved + cp -r * $out/share/themes/E17gtk-revolved + + runHook postInstall + ''; + + meta = with lib; { + description = "E17GTK-Revolved Theme"; + homepage = "https://git.disroot.org/eudaimon/E17gtk-revolved"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + }; +} + diff --git a/pkgs/ezquake-fork.nix b/pkgs/ezquake-fork.nix new file mode 100644 index 0000000..dd945e4 --- /dev/null +++ b/pkgs/ezquake-fork.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchFromGitHub, curl, expat +, jansson, libpng, libjpeg, libGLU, libGL +, libsndfile, libXxf86vm, pcre, pkg-config, SDL2 +, vim, speex }: + +stdenv.mkDerivation rec { + pname = "ezquake"; + version = "3.6.5"; + + src = fetchFromGitHub { + owner = "krizej"; + repo = pname + "-source"; + rev = "bbfd27d33ef3781db9fc1b58cd0baa803acfdc69"; + fetchSubmodules = true; + hash = "sha256-Ldv//lsukn985IljXHXDClsYY+Sk1fh41s1NySWkvuE="; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ + expat curl jansson libpng libjpeg libGLU libGL libsndfile libXxf86vm pcre SDL2 vim speex + ]; + + installPhase = with lib; let + sys = last (splitString "-" stdenv.hostPlatform.system); + arch = head (splitString "-" stdenv.hostPlatform.system); + in '' + git branch + mkdir -p $out/bin + find . + mv ezquake-${sys}-${arch} $out/bin/ezquake + ''; + + enableParallelBuilding = true; + + meta = with lib; { + homepage = "https://ezquake.com/"; + description = "A modern QuakeWorld client focused on competitive online play"; + license = licenses.gpl2; + platforms = platforms.linux; + }; +} diff --git a/pkgs/oxylite-icon-theme.nix b/pkgs/oxylite-icon-theme.nix new file mode 100644 index 0000000..1282948 --- /dev/null +++ b/pkgs/oxylite-icon-theme.nix @@ -0,0 +1,50 @@ +{ lib, stdenv, fetchFromGitHub, gtk3, hicolor-icon-theme }: +stdenv.mkDerivation { + pname = "oxylite-icon-theme"; + version = "2024-04-22"; + + src = fetchFromGitHub { + owner = "mx-2"; + repo = "oxylite-icon-theme"; + rev = "3dec1990dddd4d51513ee1d2b1fb762c0ba80f50"; + hash = "sha256-syjFs2gkscdlpOmWgraj4l1+WwIaIVFZlhDY4nP99Oo="; + }; + +# propagatedBuildInputs = [ hicolor-icon-theme ]; + + nativeBuildInputs = [ gtk3 ]; +# dontDropIconThemeCache = true; + + buildPhase = '' + runHook preBuild + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + prefix="$out/share/icons/oxylite"; + mkdir -p "$prefix"; + for d in actions apps categories devices emblems emotes mimetypes places status ui; do + install -d "$prefix/$d"; + cp -ar "$d" "$prefix"; + chmod -R u=rwX,g=rX,o=rX "$prefix/$d"; + done; + + install -m 644 index.theme "$prefix/index.theme"; + install -m 644 licenses.yml "$prefix/licenses.yml"; + install -m 644 README.md "$prefix/README.md"; + + gtk-update-icon-cache --force "$prefix" + + runHook postInstall + ''; + + meta = with lib; { + description = "Oxylite Icon Theme"; + homepage = "https://github.com/mx-2/oxylite-icon-theme"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + }; +} + diff --git a/pkgs/win7-cursors.nix b/pkgs/win7-cursors.nix new file mode 100644 index 0000000..11d19ad --- /dev/null +++ b/pkgs/win7-cursors.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchFromGitHub }: +stdenv.mkDerivation { + pname = "win7-cursors"; + version = "1"; + + src = fetchFromGitHub { + owner = "lLexian"; + repo = "Windows-7-Aero-Cursors_Linux"; + rev = "f14c659082d38be7cbde2101ea5ab71987ead64e"; + hash = "sha256-aG+iHqwTZxgWLg0qkJtTIW+byxUszHR9HN3TDnR1i7Y="; + }; + + installPhase = '' + thedir="$out/share/icons/" + install -d $thedir + cp -r * $thedir + ''; + + meta = with lib; { + description = "Windows 7 Cursors"; + homepage = "https://github.com/lLexian/Windows-7-Aero-Cursors_Linux"; + license = licenses.gpl2Only; + platforms = platforms.linux; + }; +} + diff --git a/pkgs/winvista-cursors.nix b/pkgs/winvista-cursors.nix new file mode 100644 index 0000000..8553070 --- /dev/null +++ b/pkgs/winvista-cursors.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchFromGitHub }: +stdenv.mkDerivation { + pname = "winvista-cursors"; + version = "1"; + + src = fetchFromGitHub { + owner = "krizej"; + repo = "winvista-cursors"; + rev = "0ccde84ab0c6ec68470f59d8ec0f59045952381a"; + hash = "sha256-NeMTP7KHzCXh/PAk82P3tcf6XI4SOtmtlH+SCN9qsco="; + }; + + installPhase = '' + thedir="$out/share/icons/winvista-cursors" + install -d $thedir + cp -r * $thedir + ''; + + meta = with lib; { + description = "Windows Vista Cursors"; + homepage = "https://www.gnome-look.org/p/2061622"; + license = licenses.gpl2Only; + platforms = platforms.linux; + }; +} + diff --git a/pkgs/winxp-cursors.nix b/pkgs/winxp-cursors.nix new file mode 100644 index 0000000..c6b6590 --- /dev/null +++ b/pkgs/winxp-cursors.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchFromGitHub, cmake, python3, xorg, shadows ? false }: +stdenv.mkDerivation rec { + pname = "winxp-cursors"; + version = "2023-11-22"; + + src = fetchFromGitHub { + owner = "rozniak"; + repo = "xfce-winxp-tc"; + fetchSubmodules = true; + rev = "82243191359060a3c3c9e168e0e10fe2114caca3"; + hash = "sha256-bvkoe/L9KjMcCj5SlcNGoZKZtQwZHGYPFVSZbRfLztY="; + }; + + nativeBuildInputs = [ cmake python3 xorg.xcursorgen ]; + dontUseCmakeConfigure = true; + + cursor_variant = if shadows then "with-shadow" else "no-shadow"; + + buildPhase = '' + cd packaging + mkdir -p build + cd build + cmake ../../cursors/${cursor_variant}/standard -DWINTC_SKU="" + make + ''; + + installPhase = '' + mkdir -p $out/share/icons/winxp-cursors/cursors/res + cp -a xdg-compiled-maps/* $out/share/icons/winxp-cursors/cursors/ + cp compiled-cursors/* $out/share/icons/winxp-cursors/cursors/res/ + cp ../../cursors/${cursor_variant}/standard/index.theme $out/share/icons/winxp-cursors/ + ''; + + meta = with lib; { + description = "Windows XP Cursors"; + homepage = "https://github.com/rozniak/xfce-winxp-tc"; + license = with licenses; [ unfreeRedistributable gpl2Plus ]; + platforms = platforms.linux; + }; +} + diff --git a/pkgs/winxp-icons.nix b/pkgs/winxp-icons.nix new file mode 100644 index 0000000..74afe35 --- /dev/null +++ b/pkgs/winxp-icons.nix @@ -0,0 +1,40 @@ +{ lib, stdenv, fetchFromGitHub, cmake, python3, gtk3 }: +stdenv.mkDerivation { + pname = "winxp-icons"; + version = "2024-03-27"; + + src = fetchFromGitHub { + owner = "rozniak"; + repo = "xfce-winxp-tc"; + fetchSubmodules = true; + rev = "82243191359060a3c3c9e168e0e10fe2114caca3"; + hash = "sha256-bvkoe/L9KjMcCj5SlcNGoZKZtQwZHGYPFVSZbRfLztY="; + }; + + nativeBuildInputs = [ cmake python3 gtk3 ]; + dontUseCmakeConfigure = true; + + buildPhase = '' + cd packaging + mkdir -p build + cd build + cmake ../../icons/luna -DWINTC_SKU="" + make + ''; + + installPhase = '' + mkdir -p $out/share/icons/winxp-icons/res + cp -r xdg-compiled-maps/* $out/share/icons/winxp-icons/ + cp -r ../../icons/luna/res $out/share/icons/winxp-icons/ + cp ../../icons/luna/index.theme $out/share/icons/winxp-icons/ + gtk-update-icon-cache --force $out/share/icons/winxp-icons + ''; + + meta = with lib; { + description = "Windows XP Icons"; + homepage = "https://github.com/rozniak/xfce-winxp-tc"; + license = with licenses; [ unfreeRedistributable gpl2Plus ]; + platforms = platforms.linux; + }; +} + diff --git a/programs/alacritty.nix b/programs/alacritty.nix new file mode 100644 index 0000000..dfb4c0c --- /dev/null +++ b/programs/alacritty.nix @@ -0,0 +1,42 @@ +{...}: +{ + enable = true; + settings = { + font.size = 10; + window.padding = { x = 2; y = 2; }; + cursor = { + style = { + shape = "Beam"; + blinking = "On"; + }; + blink_timeout = 0; + unfocused_hollow = false; + }; + colors = { + primary = { + foreground = "#e4e4ef"; + background = "#181818"; + }; + normal = { + black = "#202020"; + red = "#f43841"; + green = "#73c936"; + yellow = "#ffdd33"; + blue = "#5a81ce"; + magenta = "#ae65b7"; + cyan = "#71afcf"; + white = "#dddddd"; + }; + bright = { + black = "#282828"; + red = "#ff4f58"; + green = "#91d956"; + yellow = "#ffee55"; + blue = "#71afe8"; + magenta = "#ce85e7"; + cyan = "#91dfef"; + white = "#f4f4ff"; + }; + }; + }; +} diff --git a/programs/autorandr.nix b/programs/autorandr.nix new file mode 100644 index 0000000..a71bab3 --- /dev/null +++ b/programs/autorandr.nix @@ -0,0 +1,34 @@ +{ pkgs, ...}: +{ + enable = true; + hooks.postswitch = { + "notify-i3" = "${pkgs.i3}/bin/i3-msg restart"; + }; + profiles = { + "main" = { + fingerprint = { + "HDMI-1" = "00ffffffffffff0026cd5861830600001d1f010380361e782a4c70a5574ea4260b5054a56b80710081408180a940b3009500950fd1c0023a801871382d40582c4500202f2100001e000000ff0031313737393132393031363637000000fd0038f01fff3c000a202020202020000000fc00504c3235393048530a2020202001b3020345f14c90040302011112131f203f40e200d5230907078301000067030c001000384467d85dc4017880006d1a0000020130f0e60000000000e305c301e60605016666005a8780a070384d4030203500202f2100001a23e88078703887401c40980c202f2100001a00000000000000000000000000000000000000000000e0"; + "eDP-1" = "00ffffffffffff003870400000000000011c01049522137803f285975c588f281d5054000000010101010101010101010101010101012e3680a070381f403020350058c21000001a182480a070381f403020350058c21000001a00000000000000000000000000000000000000000002000c42f90b3c6a0c13237d0000000034"; + }; + config = { + "HDMI-1" = { + enable = true; + mode = "1920x1080"; + rate = "239.76"; + position = "1920x0"; + }; + "eDP-1" = { + enable = true; + mode = "1920x1080"; + rate = "60.02"; + primary = true; + position = "0x0"; + }; + }; + }; + }; +} + + + + diff --git a/programs/default.nix b/programs/default.nix new file mode 100644 index 0000000..a71edab --- /dev/null +++ b/programs/default.nix @@ -0,0 +1,12 @@ +[ + # i3 is not here because it goes into xsession.windowManager instead of into programs + "home-manager" + "firefox" + "alacritty" + "fish" + "eza" + "yt-dlp" + "rofi" + "autorandr" +] + diff --git a/programs/firefox.nix b/programs/firefox.nix new file mode 100644 index 0000000..e6121bf --- /dev/null +++ b/programs/firefox.nix @@ -0,0 +1,95 @@ +{ pkgs, ... }: +{ + enable = true; + policies = { + DisableTelemetry = true; + DisableFirefoxStudies = true; + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableAccounts = true; + DisableFirefoxScreenshots = true; + OverridePostUpdatePage = ""; + DontCheckDefaultBrowser = true; + DisplayBookmarksToolbar = "always"; + DisplayMenuBar = "default-off"; + SearchBar = "unified"; + DefaultDownloadDirectory = "$HOME/downloads"; + ExtensionSettings = { + # ublock origin + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "force_installed"; + }; + # youtube redux + "{2d4c0962-e9ff-4cad-8039-9a8b80d9b8b6}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/file/4224361/latest.xpi"; + installation_mode = "force_installed"; + }; + # sponsorblock + "sponsorBlocker@ajay.app" = { + install_url = "https://addons.mozilla.org/firefox/downloads/file/4251917/latest.xpi"; + installation_mode = "force_installed"; + }; + }; + }; + profiles.krizej = { + id = 0; + isDefault = true; + search = { + default = "envs.net - SearXNG"; + force = true; + engines = { + "envs.net - SearXNG" = { + urls = [{ template = "https://searx.envs.net/searxng/search?q={searchTerms}"; }]; + icon = "https://envs.net/favicon.ico"; + iconUpdateURL = "https://envs.net/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = [ "@sx" ]; + }; + + "Wikipedia (en)".metaData.alias = "@w"; + # searx sometimes sucks + "Google".metaData.alias = "@g"; + + "Nix Packages" = { + urls = [{ template = "https://search.nixos.org/packages?query={searchTerms}"; }]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + "Nix Options" = { + urls = [{ template = "https://search.nixos.org/options?query={searchTerms}"; }]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@no" ]; + }; + "Home Manger" = { + urls = [{ template = "https://home-manager-options.extranix.com/?release=release-23.11&query={searchTerms}"; }]; + icon = "https://home-manager-options.extranix.com/images/favicon.png"; + iconUpdateURL = "https://home-manager-options.extranix.com/images/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = [ "@hm" ]; + }; + "Arch Wiki" = { + urls = [{ template = "https://wiki.archlinux.org/index.php?search={searchTerms}"; }]; + icon = "https://wiki.archlinux.org/favicon.ico"; + iconUpdateURL = "https://wiki.archlinux.org/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = [ "@aw" ]; + }; + + # the rest can fuck off + "Bing".metaData.hidden = true; + "DuckDuckGo".metaData.hidden = true; + }; + }; + settings = { + "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; + "services.sync.prefs.sync.extensions.activeThemeID" = "false"; + }; + }; +} diff --git a/programs/fish.nix b/programs/fish.nix new file mode 100644 index 0000000..cd5b3bc --- /dev/null +++ b/programs/fish.nix @@ -0,0 +1,16 @@ +{...}: +{ + enable = true; + shellAliases = { + "ls" = "eza -lhs type"; + "cp" = "cp -v"; + "mv" = "mv -v"; + "ytmp3" = "yt-dlp -o '%(title)s.%(ext)s' -x --audio-format mp3"; + "myip" = "curl ifconfig.me"; + }; + + functions = { + "fish_greeting" = "fortune"; + "fish_prompt" = builtins.readFile ../files/prompt.fish; + }; +} diff --git a/programs/i3.nix b/programs/i3.nix new file mode 100644 index 0000000..e461028 --- /dev/null +++ b/programs/i3.nix @@ -0,0 +1,146 @@ +{...}: +{ + enable = true; + config = rec { + modifier = "Mod4"; + floating.modifier = "Mod4"; + + assigns = { + "2" = [ + { class = "discord"; } + { class = "SchildiChat"; } + { class = "element"; } + ]; + }; + + window = { + titlebar = false; + border = 1; + }; + + gaps = { + inner = 0; + outer = 0; + }; + + floating.criteria = [ + { class = "zenity"; } + { class = "fceux"; } + { title = "Friends List"; } # steam + ]; + + fonts = { + names = ["JetBrains Mono NL"]; + size = 10.0; + }; + + workspaceOutputAssign = [ + { workspace = "1"; output = "DisplayPort-2"; } + { workspace = "2"; output = "HDMI-A-2"; } + ]; + + focus = { + followMouse = true; + mouseWarping = true; + }; + + modes = { + resize = { + "Left" = "resize shrink width 10 px or 10 ppt"; + "Right" = "resize grow width 10 px or 10 ppt"; + "Up" = "resize shrink height 10 px or 10 ppt"; + "Down" = "resize grow height 10 px or 10 ppt"; + "Escape" = "mode default"; + }; + }; + + startup = [ + { command = "picom &"; notification = false; } + { command = "mpd &"; notification = false; } + { command = "dunst &"; notification = false; } + { command = "flameshot &"; notification = false; } + + # { command = "lcd-bar startdaemon 192.168.1.12 &"; notification = false; } + # { command = "lcd-bar-status &"; notification = false; } + + { command = "i3bar-mouse &"; notification = false; } + + # { command = "hydration.sh &"; notification = false; } + + { command = "discord &"; notification = false; } + { command = "element-desktop &"; notification = false; } + ]; + + keybindings = + let + mod = modifier; + in { + # Program keybinds + "${mod}+Return" = "exec alacritty"; + "${mod}+Shift+s" = "exec flameshot gui"; + "${mod}+b" = "exec firefox"; + "${mod}+d" = "exec rofi -show drun"; + + # Volume control + "Ctrl+F9" = "pamixer --toggle-mute"; + "Ctrl+F10" = "pamixer --decrease 5"; + "Ctrl+F11" = "pamixer --increase 5"; + + # MPD controls + # "Ctrl+F5" = "exec ~/music/select_music.sh"; + # "Ctrl+F6" = "exec mpc prev"; + # "Ctrl+F7" = "exec mpc toggle"; + # "Ctrl+F8" = "exec mpc next"; + # "Ctrl+Shift+F6" = "exec mpc seek -3"; + # "Ctrl+Shift+F7" = "exec mpc clear"; + # "Ctrl+Shift+F8" = "exec mpc seek +3"; + # "Ctrl+Shift+F10" = ''exec mpc volume -5 && dunstify "mpc $(mpc volume)" -r 420''; + # "Ctrl+Shift+F11" = ''exec mpc volume +5 && dunstify "mpc $(mpc volume)" -r 420''; + + # General i3 keybindings + "${mod}+f" = "fullscreen toggle"; + "${mod}+r" = "mode resize"; + "${mod}+Shift+q" = "kill"; + "${mod}+Shift+r" = "restart"; + "${mod}+Shift+e" = "exec i3-nagbar -t warning -m 'exit?' -b 'yes' 'i3-msg exit'"; + + "${mod}+Left" = "focus left"; + "${mod}+Right" = "focus right"; + "${mod}+Up" = "focus up"; + "${mod}+Down" = "focus down"; + "${mod}+Shift+Left" = "move left"; + "${mod}+Shift+Right" = "move right"; + "${mod}+Shift+Up" = "move up"; + "${mod}+Shift+Down" = "move down"; + + "${mod}+q" = "layout stacking"; + "${mod}+w" = "layout tabbed"; + "${mod}+e" = "layout toggle split"; + + "${mod}+Shift+Space" = "floating toggle"; + "${mod}+Space" = "focus mode_toggle"; + + "${mod}+1" = "workspace number 1"; + "${mod}+2" = "workspace number 2"; + "${mod}+3" = "workspace number 3"; + "${mod}+4" = "workspace number 4"; + "${mod}+5" = "workspace number 5"; + "${mod}+6" = "workspace number 6"; + "${mod}+7" = "workspace number 7"; + "${mod}+8" = "workspace number 8"; + "${mod}+9" = "workspace number 9"; + "${mod}+0" = "workspace number 10"; + + "${mod}+Shift+1" = "move container to workspace number 1"; + "${mod}+Shift+2" = "move container to workspace number 2"; + "${mod}+Shift+3" = "move container to workspace number 3"; + "${mod}+Shift+4" = "move container to workspace number 4"; + "${mod}+Shift+5" = "move container to workspace number 5"; + "${mod}+Shift+6" = "move container to workspace number 6"; + "${mod}+Shift+7" = "move container to workspace number 7"; + "${mod}+Shift+8" = "move container to workspace number 8"; + "${mod}+Shift+9" = "move container to workspace number 9"; + "${mod}+Shift+0" = "move container to workspace number 10"; + }; + }; +} diff --git a/programs/rofi.nix b/programs/rofi.nix new file mode 100644 index 0000000..c1bf2bd --- /dev/null +++ b/programs/rofi.nix @@ -0,0 +1,52 @@ +{ config, ... }: +{ + enable = true; + theme = let + mkLiteral = config.lib.formats.rasi.mkLiteral; + Black = mkLiteral "Black"; + White = mkLiteral "White"; + north = mkLiteral "north"; + horizontal = mkLiteral "horizontal"; + in { + "*" = { + background-color = Black; + border-color = White; + text-color = White; + font = "JetBrains Mono NL 12"; + }; + window = { + anchor = north; + location = north; + width = mkLiteral "100%"; + padding = mkLiteral "4px"; + children = map mkLiteral [ "horibox" ]; + }; + horibox = { + orientation = horizontal; + children = map mkLiteral [ "prompt" "entry" "listview" ]; + }; + listview = { + layout = horizontal; + spacing = mkLiteral "5px"; + lines = 100; + }; + entry = { + expand = false; + width = mkLiteral "10em"; + }; + element = { + padding = mkLiteral "0px 2px"; + }; + "element selected" = { + background-color = mkLiteral "#333333"; + }; + prompt = { + text-color = mkLiteral "#00000000"; + }; + "element-text, element-icon" = { + background-color = mkLiteral "inherit"; + text-color = mkLiteral "inherit"; + }; + }; +} + diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..0af0634 --- /dev/null +++ b/readme.txt @@ -0,0 +1,2 @@ +i have no idea what i'm doing + diff --git a/services/default.nix b/services/default.nix new file mode 100644 index 0000000..27cebff --- /dev/null +++ b/services/default.nix @@ -0,0 +1,6 @@ +[ + "picom" + "flameshot" + "dunst" +] + diff --git a/services/dunst.nix b/services/dunst.nix new file mode 100644 index 0000000..d8936da --- /dev/null +++ b/services/dunst.nix @@ -0,0 +1,15 @@ +{...}: +{ + enable = true; + settings = { + global = { + origin = "bottom-right"; + frame_width = 1; + background = "#333333"; + foreground = "#feeeee"; + font = "JetBrains Mono NL 10"; + frame_color = "#4c7899"; + }; + }; +} + diff --git a/services/flameshot.nix b/services/flameshot.nix new file mode 100644 index 0000000..726e729 --- /dev/null +++ b/services/flameshot.nix @@ -0,0 +1,10 @@ +{...}: +{ + enable = true; + settings = { + General = { + disabledTrayIcon = true; + showStartupLaunchMessage = false; + }; + }; +} diff --git a/services/picom.nix b/services/picom.nix new file mode 100644 index 0000000..5ceb68b --- /dev/null +++ b/services/picom.nix @@ -0,0 +1,4 @@ +{...}: +{ + enable = true; +}