├── .Rhistory ├── .gitignore ├── LICENSE ├── README.org ├── contrib.org ├── darwin.org ├── darwin ├── .DS_Store ├── darwin-configuration.nix ├── default.nix ├── intel.nix ├── m1.nix ├── modules │ ├── aerospace.nix │ ├── alacritty.nix │ ├── default.nix │ ├── kitty.nix │ ├── p10k.zsh │ ├── skhd.nix │ ├── yabai.nix │ └── zsh.nix └── work.nix ├── flake.lock ├── flake.nix ├── hosts ├── beelink │ ├── default.nix │ └── hardware-configuration.nix ├── configuration.nix ├── default.nix ├── h310m │ ├── default.nix │ └── hardware-configuration.nix ├── probook │ ├── default.nix │ └── hardware-configuration.nix ├── vm │ ├── default.nix │ └── hardware-configuration.nix ├── work │ ├── default.nix │ └── hardware-configuration.nix └── xps │ ├── default.nix │ └── hardware-configuration.nix ├── modules ├── desktops │ ├── bspwm.nix │ ├── default.nix │ ├── gnome.nix │ ├── hyprland.nix │ ├── kde.nix │ ├── options.nix │ ├── river.nix │ ├── sway.nix │ └── virtualisation │ │ ├── default.nix │ │ ├── docker.nix │ │ ├── qemu.nix │ │ └── x11vnc.nix ├── editors │ ├── default.nix │ ├── emacs │ │ ├── default.nix │ │ └── doom-emacs │ │ │ ├── alt │ │ │ ├── doom.sh │ │ │ ├── home.nix │ │ │ └── nix-community.nix │ │ │ ├── default.nix │ │ │ └── doom.d │ │ │ ├── config.el │ │ │ ├── custom.el │ │ │ ├── init.el │ │ │ └── packages.el │ └── nvim.nix ├── hardware │ ├── beelink │ │ ├── ax101.nix │ │ └── default.nix │ ├── bluetooth.nix │ ├── default.nix │ ├── dslr.nix │ ├── power.nix │ ├── work │ │ ├── default.nix │ │ ├── eduroam.patch │ │ ├── intel.nix │ │ ├── nvidia.nix │ │ └── wpa.nix │ └── xps │ │ ├── default.nix │ │ └── nvidia.nix ├── programs │ ├── accounts.nix │ ├── alacritty.nix │ ├── default.nix │ ├── eww.nix │ ├── eww │ │ ├── css │ │ │ ├── calendar.scss │ │ │ ├── menu.scss │ │ │ ├── sink.scss │ │ │ ├── system.scss │ │ │ ├── volume.scss │ │ │ └── workspaces.scss │ │ ├── eww.scss │ │ ├── eww.yuck │ │ ├── modules │ │ │ ├── clock.yuck │ │ │ ├── hover.yuck │ │ │ ├── icon.yuck │ │ │ ├── peripheral.yuck │ │ │ ├── slider.yuck │ │ │ ├── space.yuck │ │ │ ├── system.yuck │ │ │ ├── volume.yuck │ │ │ └── workspace.yuck │ │ ├── scripts │ │ │ ├── eww │ │ │ ├── get-audio-devices │ │ │ ├── peripheral │ │ │ ├── set-audio-device │ │ │ ├── sink │ │ │ └── workspace │ │ ├── var.yuck │ │ └── windows │ │ │ ├── calendar.yuck │ │ │ ├── menu.yuck │ │ │ └── sink.yuck │ ├── flatpak.nix │ ├── games.nix │ ├── kitty.nix │ ├── obs.nix │ ├── rofi.nix │ ├── thunar.nix │ ├── waybar.nix │ └── wofi.nix ├── services │ ├── avahi.nix │ ├── default.nix │ ├── dunst.nix │ ├── flameshot.nix │ ├── media.nix │ ├── picom.nix │ ├── polybar.nix │ ├── redshift.nix │ ├── samba.nix │ ├── swaync.nix │ ├── sxhkd.nix │ ├── udiskie.nix │ └── x11vnc.nix ├── shell │ ├── default.nix │ ├── direnv.nix │ ├── git.nix │ └── zsh.nix └── theming │ ├── colors.nix │ ├── default.nix │ ├── theming.nix │ ├── wall.mp4 │ └── wall.png ├── nix.org ├── nix ├── default.nix └── pacman.nix ├── nixos.org ├── rsc ├── Header.svg ├── Nix-Darwin.svg ├── Nix.svg ├── NixOS.svg ├── archive │ ├── dwm │ │ ├── hyprland.nix │ │ └── waybar.nix │ └── original │ │ ├── hyprland.nix │ │ ├── waybar.nix │ │ └── wofi.nix └── config │ ├── alacritty │ └── alacritty.yml │ ├── bspwm │ └── bspwmrc │ ├── dunst │ └── dunstrc │ ├── eww │ ├── hypr │ └── hyprland.conf │ ├── kitty │ └── kitty.conf │ ├── nvim │ └── init.vim │ ├── picom │ └── picom.conf │ ├── polybar │ ├── config.ini │ └── script │ │ ├── mic.sh │ │ └── sink.sh │ ├── rofi │ ├── old │ │ └── theme.rasi │ └── theme.rasi │ ├── sway │ └── config │ ├── swaylock │ └── config │ ├── sxhkd │ └── sxhkdrc │ ├── waybar │ ├── config │ ├── script │ │ └── sink.sh │ └── style.css │ └── wofi │ ├── config │ ├── power.sh │ └── style.css ├── shell.org └── shells ├── archive ├── appimage.nix └── etcher.nix ├── js ├── electron │ ├── .envrc │ └── shell.nix └── npm │ ├── .envrc │ └── shell.nix ├── phoenix ├── .envrc └── shell.nix ├── python ├── .envrc ├── flake.lock ├── flake.nix └── shell.nix └── unstable ├── .envrc ├── flake.lock ├── flake.nix └── shell.nix /.Rhistory: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthiasBenaets/nix-config/bdbae3000fcc8bf8c19dd65f51c437de21cbc739/.Rhistory -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | result 2 | ./darwin/result 3 | **/.direnv 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022-present Matthias Benaets 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /contrib.org: -------------------------------------------------------------------------------- 1 | #+title: Contributing to nixpkgs 2 | #+description: Just a few personal notes on how to contribute to the NixOS/nixpkgs repository 3 | #+author: Matthias Benaets 4 | 5 | * Table of Content 6 | :PROPERTIES: 7 | :TOC: :include all :depth 1 :force (nothing) :ignore (this) 8 | :END: 9 | :CONTENTS: 10 | - [[#initial-setup][Initial setup]] 11 | - [[#packaging][Packaging]] 12 | - [[#pull-request][Pull request]] 13 | - [[#review-process][Review process]] 14 | :END: 15 | 16 | * Initial setup 17 | ** Forking 18 | - Fork http://github.com/NixOS/nixpkgs 19 | - ~$ git clone --depth 1 https://github.com//nixpkgs~ 20 | 21 | ** Branching 22 | - ~$ git branch -c ~ 23 | - ~$ git checkout ~ 24 | 25 | * Packaging 26 | ** Maintainers 27 | - Not yet a maintainer? 28 | - Add yourself to ~nixpkgs/maintainers/maintainer-list.nix~ 29 | - This will be a seperate commit from the packages 30 | - ~$ git commit -m "maintainers: add "~ 31 | 32 | ** Creating 33 | *** Package 34 | - Find an appropriate location in ~nixpkgs/pkgs/~ 35 | - ~$ mkdir ~ 36 | - ~$ touch /default.nix~ 37 | 38 | - Add the package to ~nixpkgs/pkgs/top-level/~ 39 | - Generic: ~all-packages.nix~ 40 | - Kernel: ~linux-kernels.nix~ 41 | - etc.. 42 | 43 | *** module 44 | - In these modules you will create the options to set up the package in a system 45 | - ~$ touch nixpkgs/nixos//.nix~ 46 | 47 | - Add module to ~nixpkgs/nixos/modules/module-list.nix~ 48 | 49 | ** Testing on system 50 | *** Package 51 | *Inside nixpkgs* 52 | - ~$ nix-build -A ~ 53 | - ~$ ./result/bin/~ 54 | 55 | *** Module 56 | *Recommended to do in virtual machine* 57 | - Add new package and/or module to general config ~/etc/nixos/configuration.nix~ 58 | - ~$ sudo nixos-rebuild -I nixpkgs=$PWD switch~ 59 | 60 | ** Editing an existing packages 61 | - Just find the package in the repo and edit 62 | - Personally I use ~$ grep -Frwl ~ to quickly find the package in ~nixpkgs/pkgs/~ 63 | 64 | * Pull request 65 | ** Commit 66 | - See paragraph packaging-maintainer. If you are not a maintainer yet, add yourself to the list and commit. 67 | - Before committing, read https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md. Make needed changes. 68 | - New package 69 | - ~$ git commit -m ": init at "~ 70 | 71 | ** Push 72 | - ~$ git push origin ~ 73 | 74 | ** Pull 75 | - Move to your github repo 76 | - Create pull-request 77 | 78 | * Review process 79 | - If changes are required, add new commits. 80 | - When done, squash commits. 81 | - ~$ git rebase -i HEAD~<# prev commits>~ 82 | - change ~pick~ to ~squash~ on all commits that need to be squash to initial commit. 83 | - change title at the top of next menu if needed. You can uncomment all other commit titles. 84 | - ~$ git push -f origin 31 | ranger # File Manager 32 | tldr # Help 33 | wget # Download 34 | zsh-powerlevel10k # Prompt 35 | ]; 36 | }; 37 | 38 | programs = { 39 | zsh.enable = true; 40 | direnv = { 41 | enable = true; 42 | loadInNixShell = true; 43 | nix-direnv.enable = true; 44 | }; 45 | }; 46 | 47 | homebrew = { 48 | enable = true; 49 | onActivation = { 50 | upgrade = false; 51 | cleanup = "zap"; 52 | }; 53 | casks = [ 54 | "aldente" 55 | "appcleaner" 56 | "firefox" 57 | "jellyfin-media-player" 58 | "moonlight" 59 | "obs" 60 | "prusaslicer" 61 | "raycast" 62 | "stremio" 63 | "vlc" 64 | # "canon-eos-utility" 65 | ]; 66 | masApps = { 67 | "wireguard" = 1451685025; 68 | }; 69 | }; 70 | 71 | home-manager.users.${vars.user} = { 72 | home.stateVersion = "22.05"; 73 | }; 74 | 75 | nix = { 76 | package = pkgs.nix; 77 | gc = { 78 | automatic = true; 79 | interval.Day = 7; 80 | options = "--delete-older-than 7d"; 81 | }; 82 | extraOptions = '' 83 | # auto-optimise-store = true 84 | experimental-features = nix-command flakes 85 | ''; 86 | }; 87 | 88 | system = { 89 | primaryUser = vars.user; 90 | stateVersion = 4; 91 | }; 92 | } 93 | -------------------------------------------------------------------------------- /darwin/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # These are the different profiles that can be used when building on MacOS 3 | # 4 | # flake.nix 5 | # └─ ./darwin 6 | # ├─ default.nix * 7 | # ├─ darwin-configuraiton.nix 8 | # └─ .nix 9 | # 10 | 11 | { inputs, nixpkgs, nixpkgs-stable, darwin, home-manager, nixvim, vars, ... }: 12 | 13 | let 14 | systemConfig = system: { 15 | system = system; 16 | pkgs = import nixpkgs { 17 | inherit system; 18 | config.allowUnfree = true; 19 | }; 20 | stable = import nixpkgs-stable { 21 | inherit system; 22 | config.allowUnfree = true; 23 | }; 24 | }; 25 | in 26 | { 27 | # MacBook8,1 "Core M" 1.2 12" (2015) A1534 28 | MacBookIntel = 29 | let 30 | inherit (systemConfig "x86_64-darwin") system pkgs stable; 31 | in 32 | darwin.lib.darwinSystem { 33 | inherit system; 34 | specialArgs = { inherit inputs system pkgs stable vars; }; 35 | modules = [ 36 | ./darwin-configuration.nix 37 | ./intel.nix 38 | ../modules/programs/kitty.nix 39 | nixvim.nixDarwinModules.nixvim 40 | home-manager.darwinModules.home-manager 41 | { 42 | home-manager.useGlobalPkgs = true; 43 | home-manager.useUserPackages = true; 44 | } 45 | ]; 46 | }; 47 | 48 | # MacBookAir10,1 M1 13" (2020) 49 | MacBookAirM1 = 50 | let 51 | inherit (systemConfig "aarch64-darwin") system pkgs stable; 52 | in 53 | darwin.lib.darwinSystem { 54 | inherit system; 55 | specialArgs = { inherit inputs system pkgs stable vars; }; 56 | modules = [ 57 | ./darwin-configuration.nix 58 | ./m1.nix 59 | nixvim.nixDarwinModules.nixvim 60 | home-manager.darwinModules.home-manager 61 | { 62 | home-manager.useGlobalPkgs = true; 63 | home-manager.useUserPackages = true; 64 | } 65 | ]; 66 | }; 67 | 68 | # MacBookAir15,12 M3 13" (2024) 69 | MacBookAirM3 = 70 | let 71 | inherit (systemConfig "aarch64-darwin") system pkgs stable; 72 | in 73 | darwin.lib.darwinSystem { 74 | inherit system; 75 | specialArgs = { 76 | inherit inputs system pkgs stable; 77 | vars = { 78 | user = "lucp10771"; 79 | location = "$HOME/.setup"; 80 | terminal = "kitty"; 81 | editor = "nvim"; 82 | }; 83 | }; 84 | modules = [ 85 | ./work.nix 86 | nixvim.nixDarwinModules.nixvim 87 | home-manager.darwinModules.home-manager 88 | { 89 | home-manager.useGlobalPkgs = true; 90 | home-manager.useUserPackages = true; 91 | } 92 | ]; 93 | }; 94 | } 95 | -------------------------------------------------------------------------------- /darwin/intel.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Specific system configuration settings for MacBook 8,1 3 | # 4 | # flake.nix 5 | # └─ ./darwin 6 | # ├─ default.nix 7 | # └─ ./intel.nix * 8 | # 9 | 10 | { pkgs, ... }: 11 | 12 | { 13 | imports = import (./modules); 14 | 15 | networking = { 16 | computerName = "MacBook"; 17 | hostName = "MacBook"; 18 | }; 19 | 20 | skhd.enable = false; 21 | yabai.enable = false; 22 | 23 | homebrew = { 24 | brews = [ 25 | # "wireguard-tools" 26 | ]; 27 | casks = [ 28 | "docker" 29 | "virtualbox" # sudo codesign --force --deep --sign - /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app 30 | ]; 31 | }; 32 | 33 | system = { 34 | defaults = { 35 | NSGlobalDomain = { 36 | KeyRepeat = 1; 37 | NSAutomaticCapitalizationEnabled = false; 38 | NSAutomaticSpellingCorrectionEnabled = false; 39 | "com.apple.keyboard.fnState" = true; 40 | "com.apple.mouse.tapBehavior" = 1; 41 | "com.apple.trackpad.enableSecondaryClick" = true; 42 | }; 43 | dock = { 44 | autohide = false; 45 | largesize = 36; 46 | tilesize = 24; 47 | magnification = true; 48 | mineffect = "genie"; 49 | orientation = "bottom"; 50 | showhidden = false; 51 | show-recents = false; 52 | minimize-to-application = true; 53 | }; 54 | finder = { 55 | AppleShowAllFiles = false; 56 | ShowPathbar = true; 57 | QuitMenuItem = false; 58 | }; 59 | # keyboard = { 60 | # remapCapsLockToEscape = true; 61 | # }; 62 | trackpad = { 63 | Clicking = true; 64 | TrackpadRightClick = true; 65 | }; 66 | magicmouse = { 67 | MouseButtonMode = "TwoButton"; 68 | }; 69 | # CustomUserPreferences = { 70 | # # /Users/${vars.user}/Library/Preferences/ 71 | # } 72 | # CustomSystemPreferences = { 73 | # # /Users/${vars.user}/Library/Preferences/ 74 | # } 75 | }; 76 | activationScripts.postActivation.text = ''sudo chsh -s ${pkgs.zsh}/bin/zsh''; 77 | # # Reload all settings without relog/reboot 78 | # activationScripts.postUserActivation.text = '' 79 | # /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u 80 | # ''; 81 | }; 82 | } 83 | -------------------------------------------------------------------------------- /darwin/m1.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Specific system configuration settings for MacBook Air M1 10,1 3 | # 4 | # flake.nix 5 | # └─ ./darwin 6 | # ├─ default.nix 7 | # └─ ./m1.nix * 8 | # 9 | 10 | { config, lib, pkgs, vars, ... }: 11 | 12 | { 13 | imports = import (./modules); 14 | 15 | aerospace.enable = true; 16 | 17 | environment = { 18 | systemPackages = with pkgs; [ 19 | ]; 20 | }; 21 | 22 | homebrew = { 23 | casks = [ 24 | "adobe-creative-cloud" 25 | "autodesk-fusion" 26 | # "bettertouchtool" 27 | "blender" 28 | # "connectiq" 29 | # "darktable" 30 | "dbeaver-community" 31 | "deluge" 32 | "docker" 33 | "docker-toolbox" 34 | "garmin-express" 35 | "google-chrome" 36 | "love" 37 | "linearmouse" 38 | # "obsidian" 39 | "openmtp" 40 | "orcaslicer" 41 | "postman" 42 | "r" 43 | "rstudio" 44 | "visual-studio-code" 45 | "upscayl" 46 | "xnviewmp" 47 | ]; 48 | masApps = { 49 | "Adguard for Safari" = 1440147259; # Safari 50 | "Bitwarden" = 1352778147; # Safari 51 | # "FileZilla Pro - FTP and Client" = 1298486723; 52 | # "FileZilla Pro RemoteDrive" = -2087754162; 53 | "Keynote" = 409183694; 54 | "LanguageTool - Grammer Checker" = 1534275760; # Safari 55 | "Microsoft Remote Desktop" = 1295203466; 56 | "Numbers" = 409203825; 57 | "Pages" = 409201541; 58 | "Sauce for Strava™" = 1570922521; # Safari 59 | "Userscripts" = 1463298887; # Safari 60 | "Xcode" = 497799835; 61 | }; 62 | }; 63 | 64 | system = { 65 | defaults = { 66 | NSGlobalDomain = { 67 | AppleShowAllExtensions = true; 68 | NSAutomaticCapitalizationEnabled = false; 69 | NSAutomaticSpellingCorrectionEnabled = false; 70 | "com.apple.mouse.tapBehavior" = 1; 71 | "com.apple.trackpad.enableSecondaryClick" = true; 72 | # "com.apple.keyboard.fnState" = true; 73 | }; 74 | dock = { 75 | autohide = true; 76 | autohide-delay = 0.2; 77 | autohide-time-modifier = 0.1; 78 | magnification = true; 79 | mineffect = "scale"; 80 | # minimize-to-application = true; 81 | orientation = "bottom"; 82 | showhidden = false; 83 | show-recents = false; 84 | tilesize = 20; 85 | }; 86 | finder = { 87 | ShowPathbar = true; 88 | ShowStatusBar = true; 89 | }; 90 | trackpad = { 91 | Clicking = true; 92 | TrackpadRightClick = true; 93 | }; 94 | magicmouse = { 95 | MouseButtonMode = "TwoButton"; 96 | }; 97 | 98 | CustomUserPreferences = { 99 | # Settings of plist in /Users/${vars.user}/Library/Preferences/ 100 | "com.apple.finder" = { 101 | # Set home directory as startup window 102 | NewWindowTargetPath = "file:///Users/${vars.user}/"; 103 | NewWindowTarget = "PfHm"; 104 | # Set search scope to directory 105 | FXDefaultSearchScope = "SCcf"; 106 | # Multi-file tab view 107 | FinderSpawnTab = true; 108 | }; 109 | "com.apple.desktopservices" = { 110 | # Disable creating .DS_Store files in network an USB volumes 111 | DSDontWriteNetworkStores = true; 112 | DSDontWriteUSBStores = true; 113 | }; 114 | # Show battery percentage 115 | "/Users/${vars.user}/Library/Preferences/ByHost/com.apple.controlcenter".BatteryShowPercentage = true; 116 | # Privacy 117 | "com.apple.AdLib".allowApplePersonalizedAdvertising = false; 118 | }; 119 | CustomSystemPreferences = { 120 | # /Users/${vars.user}/Library/Preferences/ 121 | }; 122 | }; 123 | }; 124 | 125 | home-manager.users.${vars.user} = { 126 | programs = lib.mkIf (config.programs.zsh.enable) { 127 | zsh = { 128 | initContent = '' 129 | export PATH=$PATH:`cat $HOME/Library/Application\ Support/Garmin/ConnectIQ/current-sdk.cfg`/bin 130 | ''; 131 | }; 132 | }; 133 | }; 134 | } 135 | -------------------------------------------------------------------------------- /darwin/modules/aerospace.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Tiling Window Manager for MacOS 3 | # Enable with "aerospace.enable = true;" 4 | # 5 | # Fix tiny mission control windows: System settings -> Desktop & Dock -> Mission Control -> Enable "Group Windows By Application" 6 | # Navigate workspaces using gestures: Install BetterTouchTool -> Create 2 and 3-finger gestures for trackpad and magic mouse -> 7 | # Use "Execute Terminal Command": "/etc/profiles/per-user/${username}/bin/aerospace workspace "$(/etc/profiles/per-user/${username}/bin/aerospace list-workspaces --monitor mouse --visible)" && /etc/profiles/per-user/${username}/bin/aerospace workspace next" (use next or prev) 8 | # 9 | 10 | { config, lib, pkgs, vars, ... }: 11 | 12 | with lib; 13 | { 14 | options.aerospace = { 15 | enable = mkOption { 16 | type = types.bool; 17 | default = false; 18 | description = mdDoc '' 19 | Tiling Window Manager for MacOS 20 | ''; 21 | }; 22 | }; 23 | 24 | config = mkIf config.aerospace.enable { 25 | home-manager.users.${vars.user} = { 26 | home.packages = with pkgs; [ aerospace jankyborders ]; 27 | xdg.configFile."aerospace/aerospace.toml".text = '' 28 | start-at-login = true 29 | accordion-padding = 30 30 | default-root-container-layout = "tiles" 31 | default-root-container-orientation = "auto" 32 | key-mapping.preset = "qwerty" 33 | 34 | after-startup-command = [ 35 | 'exec-and-forget ${pkgs.jankyborders}/bin/borders active_color=0xffa6a6a6 inactive_color=0x00a6a6a6 style=round width=5.0' 36 | ] 37 | 38 | [gaps] 39 | inner.horizontal = 8 40 | inner.vertical = 8 41 | outer.left = 8 42 | outer.bottom = 8 43 | outer.top = 8 44 | outer.right = 8 45 | 46 | [mode.main.binding] 47 | # alt = General and Node Focus 48 | # alt-shift = Move Node 49 | # ctrl-alt = Workspace Focus 50 | # ctrl-alt-shift = Move Node to Workspace 51 | 52 | alt-slash = "layout tiles horizontal vertical" 53 | alt-comma = "layout accordion horizontal vertical" 54 | alt-f = "layout floating tiling" 55 | alt-shift-f = "fullscreen" 56 | 57 | alt-tab = "workspace-back-and-forth" 58 | alt-m = [ "move-node-to-monitor --wrap-around next", "focus-monitor --wrap-around next" ] 59 | 60 | alt-minus = "resize smart -50" 61 | alt-equal = "resize smart +50" 62 | 63 | alt-q = "close --quit-if-last-window" 64 | 65 | alt-left = "focus --boundaries all-monitors-outer-frame left" 66 | alt-down = "focus --boundaries all-monitors-outer-frame down" 67 | alt-up = "focus --boundaries all-monitors-outer-frame up" 68 | alt-right = "focus --boundaries all-monitors-outer-frame right" 69 | alt-h = "focus --boundaries all-monitors-outer-frame left" 70 | alt-j = "focus --boundaries all-monitors-outer-frame down" 71 | alt-k = "focus --boundaries all-monitors-outer-frame up" 72 | alt-l = "focus --boundaries all-monitors-outer-frame right" 73 | 74 | alt-shift-left = "move left" 75 | alt-shift-down = "move down" 76 | alt-shift-up = "move up" 77 | alt-shift-right = "move right" 78 | alt-shift-h = "move left" 79 | alt-shift-j = "move down" 80 | alt-shift-k = "move up" 81 | alt-shift-l = "move right" 82 | 83 | ctrl-alt-left = "workspace prev" 84 | ctrl-alt-right = "workspace next" 85 | # ctrl-alt-left = "workspace --wrap-around prev" 86 | # ctrl-alt-right = "workspace --wrap-around next" 87 | ctrl-alt-1 = "workspace 1" 88 | ctrl-alt-2 = "workspace 2" 89 | ctrl-alt-3 = "workspace 3" 90 | ctrl-alt-4 = "workspace 4" 91 | ctrl-alt-5 = "workspace 5" 92 | ctrl-alt-6 = "workspace 6" 93 | ctrl-alt-7 = "workspace 7" 94 | ctrl-alt-8 = "workspace 8" 95 | ctrl-alt-9 = "workspace 9" 96 | ctrl-alt-0 = "workspace 10" 97 | 98 | ctrl-alt-shift-left = [ "move-node-to-workspace prev", "workspace prev" ] 99 | ctrl-alt-shift-right = [ "move-node-to-workspace next", "workspace next" ] 100 | # ctrl-alt-shift-left = [ "move-node-to-workspace --wrap-around prev", "workspace --wrap-around prev" ] 101 | # ctrl-alt-shift-right = [ "move-node-to-workspace --wrap-around next", "workspace --wrap-around next" ] 102 | ctrl-alt-shift-1 = "move-node-to-workspace 1" 103 | ctrl-alt-shift-2 = "move-node-to-workspace 2" 104 | ctrl-alt-shift-3 = "move-node-to-workspace 3" 105 | ctrl-alt-shift-4 = "move-node-to-workspace 4" 106 | ctrl-alt-shift-5 = "move-node-to-workspace 5" 107 | ctrl-alt-shift-6 = "move-node-to-workspace 6" 108 | ctrl-alt-shift-7 = "move-node-to-workspace 7" 109 | ctrl-alt-shift-8 = "move-node-to-workspace 8" 110 | ctrl-alt-shift-9 = "move-node-to-workspace 9" 111 | ctrl-alt-shift-0 = "move-node-to-workspace 10" 112 | ctrl-alt-shift-z = "move-node-to-monitor --wrap-around --focus-follows-window next" 113 | 114 | alt-enter = "exec-and-forget /Applications/kitty.app/Contents/MacOS/kitty ~" 115 | alt-e = "exec-and-forget open ~" 116 | 117 | alt-shift-semicolon = "mode service" 118 | 119 | [mode.service.binding] 120 | esc = [ "reload-config", "mode main" ] 121 | r = [ "flatten-workspace-tree", "mode main" ] 122 | f = [ "layout floating tiling", "mode main" ] 123 | backspace = [ "close-all-windows-but-current", "mode main" ] 124 | 125 | alt-shift-left = [ "join-with left", "mode main" ] 126 | alt-shift-down = [ "join-with down", "mode main" ] 127 | alt-shift-up = [ "join-with up", "mode main" ] 128 | alt-shift-right = [ "join-with right", "mode main" ] 129 | alt-shift-h = [ "join-with left", "mode main" ] 130 | alt-shift-j = [ "join-with down", "mode main" ] 131 | alt-shift-k = [ "join-with up", "mode main" ] 132 | alt-shift-l = [ "join-with right", "mode main" ] 133 | 134 | [workspace-to-monitor-force-assignment] 135 | "1" = "main" 136 | "2" = "main" 137 | "3" = "main" 138 | "4" = "main" 139 | "5" = "main" 140 | "6" = "secondary" 141 | "7" = "secondary" 142 | "8" = "secondary" 143 | "9" = "secondary" 144 | "10" = "secondary" 145 | 146 | [[on-window-detected]] 147 | if.app-id = "org.mozilla.firefox" 148 | if.window-title-regex-substring = "Picture-in-Picture" 149 | run = "layout floating" 150 | 151 | [[on-window-detected]] 152 | if.app-id = 'com.google.Chrome' 153 | if.window-title-regex-substring = 'Picture in Picture' 154 | run = 'layout floating' 155 | check-further-callbacks = true 156 | ''; 157 | }; 158 | }; 159 | } 160 | -------------------------------------------------------------------------------- /darwin/modules/alacritty.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Terminal Configuration 3 | # 4 | 5 | { vars, ... }: 6 | 7 | { 8 | homebrew.casks = [ 9 | "alacritty" 10 | "font-meslo-lg-nerd-font" 11 | ]; 12 | 13 | home-manager.users.${vars.user} = { 14 | home.file = { 15 | ".config/alacritty/alacritty.toml" = { 16 | text = '' 17 | [env] 18 | TERM = "xterm-256color" 19 | 20 | [window] 21 | padding.x = 10 22 | padding.y = 10 23 | 24 | decorations = "Buttonless" 25 | 26 | opacity = 0.85 27 | blur = true 28 | 29 | option_as_alt = "Both" 30 | 31 | [font] 32 | normal.family = "MesloLGS Nerd Font Mono" 33 | 34 | size=13 35 | 36 | # Default colors 37 | [colors.primary] 38 | background = '#2c2c2c' 39 | foreground = '#d6d6d6' 40 | 41 | dim_foreground = '#dbdbdb' 42 | bright_foreground = '#d9d9d9' 43 | 44 | # Cursor colors 45 | [colors.cursor] 46 | text = '#2c2c2c' 47 | cursor = '#d9d9d9' 48 | 49 | # Normal colors 50 | [colors.normal] 51 | black = '#1c1c1c' 52 | red = '#bc5653' 53 | green = '#909d63' 54 | yellow = '#ebc17a' 55 | blue = '#7eaac7' 56 | magenta = '#aa6292' 57 | cyan = '#86d3ce' 58 | white = '#cacaca' 59 | 60 | # Bright colors 61 | [colors.bright] 62 | black = '#636363' 63 | red = '#bc5653' 64 | green = '#909d63' 65 | yellow = '#ebc17a' 66 | blue = '#7eaac7' 67 | magenta = '#aa6292' 68 | cyan = '#86d3ce' 69 | white = '#f7f7f7' 70 | 71 | # Dim colors 72 | [colors.dim] 73 | black = '#232323' 74 | red = '#74423f' 75 | green = '#5e6547' 76 | yellow = '#8b7653' 77 | blue = '#556b79' 78 | magenta = '#6e4962' 79 | cyan = '#5c8482' 80 | white = '#828282' 81 | ''; 82 | }; 83 | }; 84 | }; 85 | } 86 | -------------------------------------------------------------------------------- /darwin/modules/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # MacOS Modules 3 | # 4 | # flake.nix 5 | # └─ ./darwin 6 | # ├─ .nix 7 | # └─ ./modules 8 | # ├─ default.nix * 9 | # └─ ... 10 | # 11 | 12 | [ 13 | ./aerospace.nix 14 | # ./alacritty.nix 15 | ./kitty.nix 16 | ./skhd.nix 17 | ./yabai.nix 18 | ./zsh.nix 19 | ../../modules/editors/nvim.nix 20 | ] 21 | -------------------------------------------------------------------------------- /darwin/modules/kitty.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Terminal Emulator 3 | # 4 | 5 | { vars, ... }: 6 | 7 | { 8 | homebrew.casks = [ 9 | "kitty" 10 | "font-meslo-lg-nerd-font" # MesloLGS Nerd Font Mono 11 | "font-fira-code-nerd-font" # FiraCode Nerd Font Mono 12 | ]; 13 | 14 | home-manager.users.${vars.user} = { 15 | home.file = { 16 | ".ssh/config" = { 17 | text = '' 18 | Host * 19 | UseKeychain yes 20 | AddKeysToAgent yes 21 | SetEnv TERM=xterm-256color 22 | ''; 23 | }; 24 | ".config/kitty/kitty.conf" = { 25 | text = '' 26 | font_family FiraCode Nerd Font Mono 27 | font_size 13 28 | 29 | background_opacity 0.8 30 | background_blur 16 31 | 32 | window_margin_width 4 33 | single_window_margin_width 0 34 | active_border_color #d0d0d0 35 | inactive_border_color #202020 36 | 37 | hide_window_decorations titlebar-only 38 | 39 | tab_bar_style powerline 40 | tab_powerline_style slanted 41 | 42 | confirm_os_window_close 0 43 | 44 | background #202020 45 | foreground #d0d0d0 46 | cursor #d0d0d0 47 | selection_background #303030 48 | color0 #151515 49 | color8 #505050 50 | color1 #ac4142 51 | color9 #ac4142 52 | color2 #7e8d50 53 | color10 #7e8d50 54 | color3 #e5b566 55 | color11 #e5b566 56 | color4 #6c99ba 57 | color12 #6c99ba 58 | color5 #9e4e85 59 | color13 #9e4e85 60 | color6 #7dd5cf 61 | color14 #7dd5cf 62 | color7 #d0d0d0 63 | color15 #f5f5f5 64 | selection_foreground #202020 65 | 66 | map f1 new_window_with_cwd 67 | map cmd+t new_tab_with_cwd 68 | startup_session ~/.config/kitty/startup.conf 69 | 70 | shell_integration no-sudo 71 | ''; 72 | }; 73 | }; 74 | }; 75 | } 76 | -------------------------------------------------------------------------------- /darwin/modules/skhd.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Hotkey Daemon 3 | # Enable with "skhd.enable = true;" 4 | # 5 | 6 | { config, lib, pkgs, vars, ... }: 7 | 8 | with lib; 9 | { 10 | options.skhd = { 11 | enable = mkOption { 12 | type = types.bool; 13 | default = false; 14 | description = mdDoc '' 15 | Simple Hotkey Daemon for MacOS 16 | ''; 17 | }; 18 | }; 19 | 20 | config = mkIf config.skhd.enable { 21 | services = { 22 | skhd = { 23 | enable = true; 24 | package = pkgs.skhd; 25 | }; 26 | }; 27 | 28 | home-manager.users.${vars.user} = { 29 | xdg.configFile."skhd/kill.sh" = { 30 | executable = true; 31 | text = '' 32 | #!/usr/bin/env bash 33 | 34 | window_pid=$(yabai -m query --windows --window | jq -r '.pid') 35 | count_pid=$(yabai -m query --windows | jq "[.[] | select(.pid == ''${window_pid})] | length") 36 | if [ "$count_pid" -gt 1 ]; then 37 | yabai -m window --close 38 | else 39 | kill "''${window_pid}" 40 | fi 41 | ''; 42 | }; 43 | xdg.configFile."skhd/skhdrc".text = '' 44 | # Open Applications 45 | alt - return : /Applications/kitty.app/Contents/MacOS/kitty ~ 46 | alt - e : open ~ 47 | 48 | # Toggle Window 49 | #lalt - t : yabai -m window --toggle float && yabai -m window --grid 4:4:1:1:2:2 50 | lalt - t : yabai -m window --toggle float 51 | lalt - f : yabai -m window --toggle zoom-fullscreen 52 | lalt - q : $HOME/.config/skhd/kill.sh 53 | 54 | # Focus Window 55 | lalt - up : yabai -m window --focus north || yabai -m display --focus north 56 | lalt - down : yabai -m window --focus south || yabai -m display --focus south 57 | lalt - left : yabai -m window --focus west || yabai -m display --focus west 58 | lalt - right : yabai -m window --focus east || yabai -m display --focus east 59 | 60 | # Swap Window 61 | alt + shift - left : yabai -m window --swap west || $(yabai -m window --display west; yabai -m display --focus west) 62 | alt + shift - down : yabai -m window --swap south || $(yabai -m window --display south; yabai -m display --focus south) 63 | alt + shift - up : yabai -m window --swap north || $(yabai -m window --display north; yabai -m display --focus north) 64 | alt + shift - right : yabai -m window --swap east || $(yabai -m window --display east; yabai -m display --focus east) 65 | 66 | # Resize Window 67 | cmd - left : yabai -m window --resize left:-50:0 && yabai -m window --resize right:-50:0 68 | cmd - right : yabai -m window --resize left:50:0 && yabai -m window --resize right:50:0 69 | cmd - up : yabai -m window --resize up:-50:0 && yabai -m window --resize down:-50:0 70 | cmd - down : yabai -m window --resize up:-50:0 && yabai -m window --resize down:-50:0 71 | 72 | # Focus Space 73 | ctrl + lalt - 1 : yabai -m space --focus 1 74 | ctrl + lalt - 2 : yabai -m space --focus 2 75 | ctrl + lalt - 3 : yabai -m space --focus 3 76 | ctrl + lalt - 4 : yabai -m space --focus 4 77 | ctrl + lalt - 5 : yabai -m space --focus 5 78 | ctrl + lalt - 6 : yabai -m space --focus 6 79 | ctrl + lalt - left : yabai -m space --focus prev 80 | ctrl + lalt - right: yabai -m space --focus next 81 | 82 | # Send to Space 83 | ctrl + shift + lalt - 1 : yabai -m window --space 1 84 | ctrl + shift + lalt - 2 : yabai -m window --space 2 85 | ctrl + shift + lalt - 3 : yabai -m window --space 3 86 | ctrl + shift + lalt - 4 : yabai -m window --space 4 87 | ctrl + shift + lalt - 5 : yabai -m window --space 5 88 | ctrl + shift + lalt - 6 : yabai -m window --space 6 89 | ctrl + shift + lalt - left : WIN_ID=$(yabai -m query --windows --window | jq '.id'); yabai -m window --space prev && yabai -m space --focus prev; yabai -m window --focus $WIN_ID; 90 | ctrl + shift + lalt - right : WIN_ID=$(yabai -m query --windows --window | jq '.id'); yabai -m window --space next && yabai -m space --focus next; yabai -m window --focus $WIN_ID; 91 | ''; 92 | # fixes skhd not reloading after rebuild 93 | home.activation = { 94 | skhd-reloader = '' 95 | run skhd -r 96 | ''; 97 | }; 98 | }; 99 | 100 | # required for key mapping to work 101 | system = { 102 | keyboard = { 103 | enableKeyMapping = true; 104 | }; 105 | }; 106 | }; 107 | } 108 | -------------------------------------------------------------------------------- /darwin/modules/yabai.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Tiling Window Manager for MacOS 3 | # Enable with "yabai.enable = true;" 4 | # 5 | 6 | { config, lib, pkgs, vars, ... }: 7 | 8 | with lib; 9 | { 10 | options.yabai = { 11 | enable = mkOption { 12 | type = types.bool; 13 | default = false; 14 | description = mdDoc '' 15 | Tiling Window Manager for MacOS 16 | ''; 17 | }; 18 | }; 19 | 20 | config = mkIf config.yabai.enable { 21 | services = { 22 | yabai = { 23 | enable = true; 24 | # csrutils disable 25 | # sudo nvram boot-args=-arm64e_preview_abi 26 | enableScriptingAddition = true; 27 | package = pkgs.yabai; 28 | }; 29 | jankyborders = { 30 | enable = true; 31 | active_color = "0xffa6a6a6"; 32 | inactive_color = "0x00a6a6a6"; 33 | style = "round"; 34 | width = 5.0; 35 | }; 36 | }; 37 | 38 | homebrew = { 39 | casks = [ 40 | "spaceid" 41 | ]; 42 | }; 43 | 44 | home-manager.users.${vars.user} = { 45 | # fixes yabai not reloading after rebuild (with scripting additions) 46 | home.activation = { 47 | yabai-reloader = '' 48 | run yabai --restart-service 49 | run sudo yabai --load-sa 50 | ''; 51 | }; 52 | 53 | xdg.configFile."yabai/yabairc".text = '' 54 | sudo yabai --load-sa 55 | yabai -m config auto_balance off 56 | yabai -m config bottom_padding 10 57 | yabai -m config layout bsp 58 | yabai -m config left_padding 10 59 | yabai -m config mouse_follows_focus off 60 | yabai -m config right_padding 10 61 | yabai -m config split_ratio 0.50 62 | yabai -m config top_padding 10 63 | yabai -m config window_border on 64 | yabai -m config window_border_width 2 65 | yabai -m config window_gap 10 66 | yabai -m config window_placement second_child 67 | 68 | 69 | yabai -m rule --add title='^(Opening)' manage=off 70 | yabai -m rule --add app="^System Settings$" manage=off 71 | yabai -m rule --add app="^Calculator$" manage=off 72 | yabai -m rule --add app="^App Store$" manage=off 73 | yabai -m rule --add app="^Disk Utility$" manage=off 74 | yabai -m rule --add app="^Calendar$" manage=off 75 | yabai -m rule --add app="^Activity Monitor$" manage=off 76 | yabai -m rule --add app="^Weather$" manage=off 77 | # yabai -m rule --add app="^Finder$" manage=off 78 | yabai -m rule --add app="^Garmin Express$" manage=off 79 | yabai -m rule --add app="^Creative Cloud$" manage=off 80 | ''; 81 | }; 82 | }; 83 | } 84 | -------------------------------------------------------------------------------- /darwin/modules/zsh.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Shell 3 | # 4 | 5 | { pkgs, vars, ... }: 6 | 7 | { 8 | environment = { 9 | systemPackages = with pkgs; [ 10 | eza # Ls 11 | zsh-powerlevel10k # Prompt 12 | ]; 13 | }; 14 | 15 | home-manager.users.${vars.user} = { 16 | home.file.".p10k.zsh".source = ./p10k.zsh; 17 | 18 | programs = { 19 | zsh = { 20 | enable = true; 21 | autosuggestion.enable = true; 22 | syntaxHighlighting.enable = true; 23 | enableCompletion = true; 24 | history.size = 10000; 25 | oh-my-zsh = { 26 | enable = true; 27 | plugins = [ 28 | "macos" 29 | ]; 30 | }; 31 | initContent = '' 32 | source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme 33 | [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh 34 | 35 | ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=#757575' 36 | 37 | alias ls="${pkgs.eza}/bin/eza --icons=always --color=always" 38 | alias finder="ofd" # open find in current path. 39 | #cdf will change directory to active finder directory 40 | 41 | ssh-add --apple-load-keychain &>/dev/null 42 | ''; 43 | }; 44 | }; 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /darwin/work.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Work MacOS system configuration. 3 | # 4 | # flake.nix 5 | # └─ ./darwin 6 | # ├─ default.nix 7 | # ├─ work.nix * 8 | # └─ ./modules 9 | # └─ default.nix 10 | # 11 | 12 | { pkgs, vars, ... }: 13 | 14 | { 15 | imports = import (./modules); 16 | 17 | aerospace.enable = true; 18 | 19 | users.users.${vars.user} = { 20 | home = "/Users/${vars.user}"; 21 | shell = pkgs.zsh; 22 | }; 23 | 24 | environment = { 25 | variables = { 26 | EDITOR = "${vars.editor}"; 27 | VISUAL = "${vars.editor}"; 28 | }; 29 | systemPackages = with pkgs; [ 30 | eza # Ls 31 | git # Version Control 32 | mas # Mac App Store $ mas search 33 | ranger # File Manager 34 | tldr # Help 35 | wget # Download 36 | zsh-powerlevel10k # Prompt 37 | ]; 38 | }; 39 | 40 | programs.zsh.enable = true; 41 | 42 | homebrew = { 43 | enable = true; 44 | onActivation = { 45 | upgrade = false; 46 | cleanup = "zap"; 47 | }; 48 | casks = [ 49 | # "adobe-creative-cloud" 50 | # "bettertouchtool" 51 | "cyberduck" 52 | "dbeaver-community" 53 | "docker" 54 | "firefox" 55 | "jordanbaird-ice" 56 | "linearmouse" 57 | "moonlight" 58 | "obs" 59 | "postman" 60 | "raycast" 61 | ]; 62 | masApps = { 63 | "wireguard" = 1451685025; 64 | }; 65 | }; 66 | 67 | system = { 68 | primaryUser = vars.user; 69 | defaults = { 70 | NSGlobalDomain = { 71 | AppleShowAllExtensions = true; 72 | NSAutomaticCapitalizationEnabled = false; 73 | NSAutomaticSpellingCorrectionEnabled = false; 74 | "com.apple.mouse.tapBehavior" = 1; 75 | "com.apple.trackpad.enableSecondaryClick" = true; 76 | # "com.apple.keyboard.fnState" = true; 77 | }; 78 | dock = { 79 | autohide = true; 80 | autohide-delay = 0.2; 81 | autohide-time-modifier = 0.1; 82 | magnification = true; 83 | mineffect = "scale"; 84 | # minimize-to-application = true; 85 | orientation = "bottom"; 86 | showhidden = false; 87 | show-recents = false; 88 | tilesize = 20; 89 | }; 90 | finder = { 91 | ShowPathbar = true; 92 | ShowStatusBar = true; 93 | }; 94 | trackpad = { 95 | Clicking = true; 96 | TrackpadRightClick = true; 97 | }; 98 | magicmouse = { 99 | MouseButtonMode = "TwoButton"; 100 | }; 101 | 102 | CustomUserPreferences = { 103 | # Settings of plist in /Users/${vars.user}/Library/Preferences/ 104 | "com.apple.finder" = { 105 | # Set home directory as startup window 106 | NewWindowTargetPath = "file:///Users/${vars.user}/"; 107 | NewWindowTarget = "PfHm"; 108 | # Set search scope to directory 109 | FXDefaultSearchScope = "SCcf"; 110 | # Multi-file tab view 111 | FinderSpawnTab = true; 112 | }; 113 | "com.apple.desktopservices" = { 114 | # Disable creating .DS_Store files in network an USB volumes 115 | DSDontWriteNetworkStores = true; 116 | DSDontWriteUSBStores = true; 117 | }; 118 | # Show battery percentage 119 | "/Users/${vars.user}/Library/Preferences/ByHost/com.apple.controlcenter".BatteryShowPercentage = true; 120 | # Privacy 121 | "com.apple.AdLib".allowApplePersonalizedAdvertising = false; 122 | }; 123 | CustomSystemPreferences = { 124 | # /Users/${vars.user}/Library/Preferences/ 125 | }; 126 | }; 127 | }; 128 | 129 | home-manager.users.${vars.user} = { 130 | home.stateVersion = "22.05"; 131 | }; 132 | 133 | nix = { 134 | package = pkgs.nix; 135 | gc = { 136 | automatic = true; 137 | interval.Day = 7; 138 | options = "--delete-older-than 7d"; 139 | }; 140 | extraOptions = '' 141 | # auto-optimise-store = true 142 | experimental-features = nix-command flakes 143 | ''; 144 | }; 145 | 146 | system = { 147 | stateVersion = 5; 148 | }; 149 | } 150 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | # 2 | # flake.nix * 3 | # ├─ ./hosts 4 | # │ └─ default.nix 5 | # ├─ ./darwin 6 | # │ └─ default.nix 7 | # └─ ./nix 8 | # └─ default.nix 9 | # 10 | 11 | { 12 | description = "Nix, NixOS and Nix Darwin System Flake Configuration"; 13 | 14 | inputs = 15 | { 16 | nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # Nix Packages (Default) 17 | # nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; # Unstable Nix Packages 18 | nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.05"; # Unstable Nix Packages 19 | nixos-hardware.url = "github:nixos/nixos-hardware/master"; # Hardware Specific Configurations 20 | 21 | # User Environment Manager 22 | home-manager = { 23 | url = "github:nix-community/home-manager"; 24 | inputs.nixpkgs.follows = "nixpkgs"; 25 | }; 26 | 27 | # Unstable User Environment Manager 28 | # home-manager-unstable = { 29 | # url = "github:nix-community/home-manager"; 30 | # inputs.nixpkgs.follows = "nixpkgs-unstable"; 31 | # }; 32 | 33 | # Stable User Environment Manager 34 | home-manager-stable = { 35 | url = "github:nix-community/home-manager/release-25.05"; 36 | inputs.nixpkgs.follows = "nixpkgs-stable"; 37 | }; 38 | 39 | # MacOS Package Management 40 | darwin = { 41 | url = "github:lnl7/nix-darwin/master"; 42 | inputs.nixpkgs.follows = "nixpkgs"; 43 | }; 44 | 45 | # NUR Community Packages 46 | nur = { 47 | url = "github:nix-community/NUR"; 48 | # Requires "nur.modules.nixos.default" to be added to the host modules 49 | }; 50 | 51 | # Fixes OpenGL With Other Distros. 52 | nixgl = { 53 | url = "github:guibou/nixGL"; 54 | inputs.nixpkgs.follows = "nixpkgs"; 55 | }; 56 | 57 | # Neovim 58 | nixvim = { 59 | url = "github:nix-community/nixvim"; 60 | inputs.nixpkgs.follows = "nixpkgs"; 61 | }; 62 | 63 | # Neovim 64 | nixvim-stable = { 65 | url = "github:nix-community/nixvim/nixos-25.05"; 66 | inputs.nixpkgs.follows = "nixpkgs-stable"; 67 | }; 68 | 69 | # Emacs Overlays 70 | emacs-overlay = { 71 | url = "github:nix-community/emacs-overlay"; 72 | flake = false; 73 | }; 74 | 75 | # Nix-Community Doom Emacs 76 | doom-emacs = { 77 | url = "github:nix-community/nix-doom-emacs"; 78 | inputs.nixpkgs.follows = "nixpkgs"; 79 | inputs.emacs-overlay.follows = "emacs-overlay"; 80 | }; 81 | 82 | # Official Hyprland Flake 83 | hyprland = { 84 | url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; 85 | }; 86 | 87 | # Hyprspace 88 | hyprspace = { 89 | url = "github:KZDKM/Hyprspace"; 90 | inputs.hyprland.follows = "hyprland"; 91 | }; 92 | 93 | # KDE Plasma User Settings Generator 94 | plasma-manager = { 95 | url = "github:pjones/plasma-manager"; 96 | inputs.nixpkgs.follows = "nixpkgs"; 97 | inputs.home-manager.follows = "nixpkgs"; 98 | }; 99 | }; 100 | 101 | outputs = inputs @ { self, nixpkgs, nixpkgs-stable, nixos-hardware, home-manager, home-manager-stable, darwin, nur, nixgl, nixvim, nixvim-stable, doom-emacs, hyprland, hyprspace, plasma-manager, ... }: # Function telling flake which inputs to use 102 | let 103 | # Variables Used In Flake 104 | vars = { 105 | user = "matthias"; 106 | location = "$HOME/.setup"; 107 | terminal = "kitty"; 108 | editor = "nvim"; 109 | }; 110 | in 111 | { 112 | nixosConfigurations = ( 113 | import ./hosts { 114 | inherit (nixpkgs) lib; 115 | inherit inputs nixpkgs nixpkgs-stable nixos-hardware home-manager nur nixvim doom-emacs hyprland hyprspace plasma-manager vars; # Inherit inputs 116 | } 117 | ); 118 | 119 | darwinConfigurations = ( 120 | import ./darwin { 121 | inherit (nixpkgs) lib; 122 | inherit inputs nixpkgs nixpkgs-stable home-manager darwin nixvim vars; 123 | } 124 | ); 125 | 126 | homeConfigurations = ( 127 | import ./nix { 128 | inherit (nixpkgs) lib; 129 | inherit inputs nixpkgs nixpkgs-stable home-manager nixgl vars; 130 | } 131 | ); 132 | }; 133 | } 134 | -------------------------------------------------------------------------------- /hosts/beelink/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Specific system configuration settings for beelink 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ ├─ default.nix 7 | # │ └─ ./beelink 8 | # │ ├─ default.nix * 9 | # │ └─ hardware-configuration.nix 10 | # └─ ./modules 11 | # └─ ./desktops 12 | # ├─ hyprland.nix 13 | # └─ ./virtualisation 14 | # └─ default.nix 15 | # 16 | # NOTE: Dual booted with windows 11. Disable fast-boot in power plan and bios and turn off hibernate to get wifi and bluetooth working. This only works once but on reboot is borked again. So using the old school BLT dongle. 17 | # 18 | 19 | { pkgs, ... }: 20 | 21 | { 22 | imports = [ 23 | ./hardware-configuration.nix 24 | ../../modules/programs/games.nix 25 | ] ++ 26 | (import ../../modules/hardware/beelink) ++ 27 | (import ../../modules/desktops/virtualisation); 28 | 29 | # Boot Options 30 | boot = { 31 | loader = { 32 | systemd-boot = { 33 | enable = true; 34 | configurationLimit = 3; 35 | }; 36 | efi = { 37 | canTouchEfiVariables = true; 38 | }; 39 | timeout = 5; 40 | }; 41 | }; 42 | 43 | hardware = { 44 | graphics = { 45 | enable = true; 46 | extraPackages = with pkgs; [ 47 | intel-media-driver 48 | vaapiIntel 49 | vaapiVdpau 50 | libvdpau-va-gl 51 | ]; 52 | }; 53 | sane = { 54 | enable = true; 55 | extraBackends = [ pkgs.sane-airscan ]; 56 | }; 57 | }; 58 | 59 | hyprland.enable = true; 60 | 61 | environment = { 62 | systemPackages = with pkgs; [ 63 | discord # Messaging 64 | gimp # Image Editor 65 | #gmtp # Mount GoPro 66 | go2tv # Casting 67 | google-cloud-sdk-gce # Google Cloud 68 | jellyfin-media-player # Media Player 69 | kodi # Media Player 70 | moonlight-qt # Remote Streaming 71 | obs-studio # Live Streaming 72 | plex-media-player # Media Player 73 | prusa-slicer # 3D Slicer 74 | rclone # Gdrive ($ rclone config | rclone mount --daemon gdrive: ) 75 | simple-scan # Scanning 76 | ]; 77 | }; 78 | 79 | flatpak = { 80 | extraPackages = [ 81 | "com.github.tchx84.Flatseal" 82 | "com.ultimaker.cura" 83 | "com.stremio.Stremio" 84 | ]; 85 | }; 86 | 87 | # nixpkgs.overlays = [ 88 | # (final: prev: { 89 | # discord = prev.discord.overrideAttrs ( 90 | # _: { 91 | # src = builtins.fetchTarball { 92 | # url = "https://discord.com/api/download?platform=linux&format=tar.gz"; 93 | # sha256 = "sha256:0njwcnrn2br47dzqvmlazcmf63bblx68775f0kv8djwxfvg977im"; 94 | # }; 95 | # } 96 | # ); 97 | # }) 98 | # ]; 99 | } 100 | -------------------------------------------------------------------------------- /hosts/beelink/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Hardware settings for my Beelink EQ12 Pro Mini PC 3 | # 4 | # flake.nix 5 | # └─ ./hosts 6 | # └─ ./beelink 7 | # ├─ default.nix 8 | # └─ hardware-configuration.nix * 9 | # 10 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 11 | # and may be overwritten by future invocations. Please make changes 12 | # to /etc/nixos/configuration.nix instead. 13 | # 14 | 15 | { config, lib, modulesPath, vars, host, ... }: 16 | 17 | { 18 | imports = 19 | [ 20 | (modulesPath + "/installer/scan/not-detected.nix") 21 | ]; 22 | 23 | boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; 24 | boot.initrd.kernelModules = [ ]; 25 | # boot.kernelModules = [ "kvm-intel" "btintel" ]; 26 | boot.kernelModules = [ "kvm-intel" ]; 27 | boot.extraModulePackages = [ ]; 28 | 29 | fileSystems."/" = 30 | { 31 | device = "/dev/disk/by-uuid/045641c5-b7de-468b-979f-565b1ee56803"; 32 | fsType = "ext4"; 33 | }; 34 | 35 | fileSystems."/boot" = 36 | { 37 | device = "/dev/disk/by-uuid/94BB-A907"; 38 | fsType = "vfat"; 39 | }; 40 | 41 | swapDevices = [ ]; 42 | 43 | fileSystems."/storage" = 44 | { 45 | device = "//192.168.0.3/storage"; 46 | fsType = "cifs"; 47 | options = 48 | let 49 | automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; 50 | in 51 | [ "${automount_opts},mfsymlinks,uid=1000,gid=100,credentials=/home/${vars.user}/smb" ]; 52 | }; 53 | 54 | fileSystems."/media" = 55 | { 56 | device = "//192.168.0.3/media"; 57 | fsType = "cifs"; 58 | options = 59 | let 60 | automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; 61 | in 62 | [ "${automount_opts},mfsymlinks,uid=1000,gid=100,credentials=/home/${vars.user}/smb" ]; 63 | }; 64 | 65 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 66 | powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; 67 | hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 68 | 69 | networking = with host; { 70 | useDHCP = lib.mkDefault true; 71 | hostName = hostName; 72 | bridges = { 73 | "br0" = { 74 | interfaces = [ "enp1s0" ]; 75 | }; 76 | }; 77 | interfaces = { 78 | # enp1s0 = { 79 | # useDHCP = false; 80 | # ipv4.addresses = [{ 81 | # address = "192.168.0.50"; 82 | # prefixLength = 24; 83 | # }]; 84 | # }; 85 | # enp2s0.useDHCP = true; 86 | # wlo1.useDHCP = true; 87 | br0 = { 88 | useDHCP = false; 89 | ipv4.addresses = [{ 90 | address = "192.168.0.50"; 91 | prefixLength = 24; 92 | }]; 93 | }; 94 | }; 95 | enableIPv6 = false; 96 | defaultGateway = "192.168.0.1"; 97 | nameservers = [ "192.168.0.4" "1.1.1.1" ]; 98 | firewall.enable = false; 99 | }; 100 | } 101 | -------------------------------------------------------------------------------- /hosts/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # These are the different profiles that can be used when building NixOS. 3 | # 4 | # flake.nix 5 | # └─ ./hosts 6 | # ├─ default.nix * 7 | # ├─ configuration.nix 8 | # └─ ./.nix 9 | # └─ default.nix 10 | # 11 | 12 | { inputs, nixpkgs, nixpkgs-stable, nixos-hardware, home-manager, nur, nixvim, doom-emacs, hyprland, hyprspace, plasma-manager, vars, ... }: 13 | 14 | let 15 | system = "x86_64-linux"; 16 | 17 | pkgs = import nixpkgs { 18 | inherit system; 19 | config.allowUnfree = true; 20 | }; 21 | 22 | stable = import nixpkgs-stable { 23 | inherit system; 24 | config.allowUnfree = true; 25 | }; 26 | 27 | lib = nixpkgs.lib; 28 | in 29 | { 30 | # Desktop Profile 31 | beelink = lib.nixosSystem { 32 | inherit system; 33 | specialArgs = { 34 | inherit inputs system stable hyprland hyprspace vars; 35 | host = { 36 | hostName = "beelink"; 37 | mainMonitor = "HDMI-A-2"; 38 | secondMonitor = "HDMI-A-1"; 39 | }; 40 | }; 41 | modules = [ 42 | nur.modules.nixos.default 43 | nixvim.nixosModules.nixvim 44 | ./beelink 45 | ./configuration.nix 46 | 47 | home-manager.nixosModules.home-manager 48 | { 49 | home-manager.useGlobalPkgs = true; 50 | home-manager.useUserPackages = true; 51 | } 52 | ]; 53 | }; 54 | 55 | # Work Profile 56 | work = lib.nixosSystem { 57 | inherit system; 58 | specialArgs = { 59 | inherit inputs system stable hyprland hyprspace vars; 60 | host = { 61 | hostName = "work"; 62 | mainMonitor = "eDP-1"; 63 | secondMonitor = "DP-4"; 64 | thirdMonitor = "DP-5"; 65 | secondMonitorDesc = "desc:HP Inc. HP E24i G4 6CM3071B66"; 66 | thirdMonitorDesc = "desc:HP Inc. HP E24i G4 6CM3071996"; 67 | }; 68 | }; 69 | modules = [ 70 | nixvim.nixosModules.nixvim 71 | ./work 72 | ./configuration.nix 73 | 74 | home-manager.nixosModules.home-manager 75 | { 76 | home-manager.useGlobalPkgs = true; 77 | home-manager.useUserPackages = true; 78 | } 79 | ]; 80 | }; 81 | 82 | # Work Profile 83 | xps = lib.nixosSystem { 84 | inherit system; 85 | specialArgs = { 86 | inherit inputs system stable hyprland hyprspace vars; 87 | host = { 88 | hostName = "xps"; 89 | mainMonitor = "eDP-1"; 90 | secondMonitor = "DP-4"; 91 | thirdMonitor = "DP-5"; 92 | }; 93 | }; 94 | modules = [ 95 | nixos-hardware.nixosModules.dell-xps-15-9500-nvidia 96 | nixvim.nixosModules.nixvim 97 | ./xps 98 | ./configuration.nix 99 | 100 | home-manager.nixosModules.home-manager 101 | { 102 | home-manager.useGlobalPkgs = true; 103 | home-manager.useUserPackages = true; 104 | } 105 | ]; 106 | }; 107 | 108 | # VM Profile 109 | vm = lib.nixosSystem { 110 | inherit system; 111 | specialArgs = { 112 | inherit inputs system stable vars; 113 | host = { 114 | hostName = "vm"; 115 | mainMonitor = "Virtual-1"; 116 | secondMonitor = ""; 117 | thirdMonitor = ""; 118 | }; 119 | }; 120 | modules = [ 121 | nixvim.nixosModules.nixvim 122 | ./vm 123 | ./configuration.nix 124 | 125 | home-manager.nixosModules.home-manager 126 | { 127 | home-manager.useGlobalPkgs = true; 128 | home-manager.useUserPackages = true; 129 | } 130 | ]; 131 | }; 132 | 133 | h310m = lib.nixosSystem { 134 | inherit system; 135 | specialArgs = { 136 | inherit inputs system stable hyprland vars; 137 | host = { 138 | hostName = "h310m"; 139 | mainMonitor = "DP-2"; 140 | secondMonitor = "HDMI-A-4"; 141 | }; 142 | }; 143 | modules = [ 144 | nur.modules.nixos.default 145 | nixvim.nixosModules.nixvim 146 | ./h310m 147 | ./configuration.nix 148 | 149 | home-manager.nixosModules.home-manager 150 | { 151 | home-manager.useGlobalPkgs = true; 152 | home-manager.useUserPackages = true; 153 | home-manager.users.${vars.user}.imports = [ 154 | nixvim.homeManagerModules.nixvim 155 | ]; 156 | } 157 | ]; 158 | }; 159 | 160 | # DEPRECATED HP Probook Laptop Profile 161 | probook = lib.nixosSystem { 162 | inherit system; 163 | specialArgs = { 164 | inherit inputs system stable vars; 165 | host = { 166 | hostName = "probook"; 167 | mainMonitor = "eDP-1"; 168 | secondMonitor = ""; 169 | }; 170 | }; 171 | modules = [ 172 | nixvim.nixosModules.nixvim 173 | ./probook 174 | ./configuration.nix 175 | 176 | home-manager.nixosModules.home-manager 177 | { 178 | home-manager.useGlobalPkgs = true; 179 | home-manager.useUserPackages = true; 180 | } 181 | ]; 182 | }; 183 | } 184 | -------------------------------------------------------------------------------- /hosts/h310m/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Specific system configuration settings for h310m 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ ├─ default.nix 7 | # │ └─ ./h310m 8 | # │ ├─ default.nix * 9 | # │ └─ hardware-configuration.nix 10 | # └─ ./modules 11 | # └─ ./desktops 12 | # ├─ hyprland.nix 13 | # └─ ./virtualisation 14 | # └─ default.nix 15 | # 16 | 17 | { config, pkgs, ... }: 18 | 19 | { 20 | imports = [ ./hardware-configuration.nix ] ++ 21 | (import ../../modules/desktops/virtualisation); 22 | 23 | boot = { 24 | loader = { 25 | systemd-boot = { 26 | enable = true; 27 | configurationLimit = 5; 28 | }; 29 | efi.canTouchEfiVariables = true; 30 | timeout = 1; 31 | }; 32 | kernelParams = [ 33 | "nvidia-drm.modeset=1" 34 | "nvidia-drm.fbdev=1" 35 | ]; 36 | kernelPackages = pkgs.linuxPackages_6_6; # Older kernel, or nvidia won't work on Hyprland 37 | }; 38 | 39 | 40 | hardware = { 41 | graphics = { 42 | enable = true; 43 | }; 44 | nvidia = { 45 | open = false; 46 | package = config.boot.kernelPackages.nvidiaPackages.beta; 47 | nvidiaSettings = true; 48 | modesetting.enable = true; 49 | forceFullCompositionPipeline = true; 50 | }; 51 | 52 | sane = { 53 | enable = true; 54 | extraBackends = [ pkgs.sane-airscan ]; 55 | }; 56 | }; 57 | 58 | services.xserver.videoDrivers = [ "nvidia" ]; 59 | 60 | hyprland.enable = true; 61 | 62 | environment = { 63 | systemPackages = with pkgs; [ 64 | simple-scan # Scanning 65 | sshpass # Ansible Dependency 66 | wacomtablet # Tablet 67 | ]; 68 | }; 69 | 70 | flatpak = { 71 | extraPackages = [ 72 | "com.github.tchx84.Flatseal" 73 | ]; 74 | }; 75 | } 76 | -------------------------------------------------------------------------------- /hosts/h310m/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Hardware settings for my H310M S2H Desktop 3 | # 4 | # flake.nix 5 | # └─ ./hosts 6 | # └─ ./h310m 7 | # ├─ default.nix 8 | # └─ hardware-configuration.nix * 9 | # 10 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 11 | # and may be overwritten by future invocations. Please make changes 12 | # to /etc/nixos/configuration.nix instead. 13 | # 14 | 15 | { config, lib, modulesPath, vars, host, ... }: 16 | 17 | { 18 | imports = 19 | [ 20 | (modulesPath + "/installer/scan/not-detected.nix") 21 | ]; 22 | 23 | boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "uas" "sd_mod" ]; 24 | boot.initrd.kernelModules = [ ]; 25 | boot.kernelModules = [ "kvm-intel" ]; 26 | boot.extraModulePackages = [ ]; 27 | 28 | fileSystems."/" = 29 | { 30 | device = "/dev/disk/by-uuid/07367b8f-4ff8-42c9-bb85-c7b4b769ad05"; 31 | fsType = "btrfs"; 32 | }; 33 | 34 | fileSystems."/boot" = 35 | { 36 | device = "/dev/disk/by-uuid/5449-55CC"; 37 | fsType = "vfat"; 38 | options = [ "fmask=0022" "dmask=0022" ]; 39 | }; 40 | 41 | swapDevices = [ ]; 42 | 43 | fileSystems."/storage" = 44 | { 45 | device = "//192.168.0.3/storage"; 46 | fsType = "cifs"; 47 | options = 48 | let 49 | automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; 50 | in 51 | [ "${automount_opts},mfsymlinks,uid=1000,gid=100,credentials=/home/${vars.user}/smb" ]; 52 | }; 53 | 54 | fileSystems."/media" = 55 | { 56 | device = "//192.168.0.3/media"; 57 | fsType = "cifs"; 58 | options = 59 | let 60 | automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; 61 | in 62 | [ "${automount_opts},mfsymlinks,uid=1000,gid=100,credentials=/home/${vars.user}/smb" ]; 63 | }; 64 | 65 | powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; 66 | hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 67 | 68 | networking = with host; { 69 | useDHCP = true; 70 | hostName = hostName; 71 | enableIPv6 = false; 72 | nameservers = [ "192.168.0.4" "1.1.1.1" ]; 73 | }; 74 | } 75 | -------------------------------------------------------------------------------- /hosts/probook/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Specific system configuration settings for probook 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ ├─ default.nix 7 | # │ └─ ./probook 8 | # │ ├─ default.nix * 9 | # │ └─ hardware-configuration.nix 10 | # └─ ./modules 11 | # └─ ./desktops 12 | # ├─ bspwm.nix 13 | # └─ ./virtualisation 14 | # └─ docker.nix 15 | # 16 | 17 | { pkgs, ... }: 18 | 19 | { 20 | imports = [ 21 | ./hardware-configuration.nix 22 | ../../modules/desktops/virtualisation/docker.nix 23 | ]; 24 | 25 | boot = { 26 | loader = { 27 | efi = { 28 | canTouchEfiVariables = true; 29 | efiSysMountPoint = "/boot"; 30 | }; 31 | grub = { 32 | enable = true; 33 | devices = [ "nodev" ]; 34 | efiSupport = true; 35 | useOSProber = true; 36 | configurationLimit = 2; 37 | }; 38 | timeout = 1; 39 | }; 40 | }; 41 | 42 | hardware.sane = { 43 | enable = true; 44 | extraBackends = [ pkgs.sane-airscan ]; 45 | }; 46 | 47 | laptop.enable = true; 48 | bspwm.enable = true; 49 | 50 | environment = { 51 | systemPackages = with pkgs; [ 52 | simple-scan # Scanning 53 | ]; 54 | }; 55 | 56 | programs.light.enable = true; 57 | 58 | services = { 59 | printing = { 60 | enable = true; 61 | drivers = [ pkgs.cnijfilter2 ]; # Canon TS5300 62 | }; 63 | }; 64 | 65 | flatpak = { 66 | extraPackages = [ 67 | "com.github.tchx84.Flatseal" 68 | ]; 69 | }; 70 | 71 | # Temporary Bluetooth Fix 72 | systemd.tmpfiles.rules = [ 73 | "d /var/lib/bluetooth 700 root root - -" 74 | ]; 75 | systemd.targets."bluetooth".after = [ "systemd-tmpfiles-setup.service" ]; 76 | } 77 | -------------------------------------------------------------------------------- /hosts/probook/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Hardware settings for HP ProBook 650 G1 15.6" Laptop 3 | # Dual boot active. Windows @ sda4 / NixOS @ sda5 4 | # 5 | # flake.nix 6 | # └─ ./hosts 7 | # └─ ./probook 8 | # ├─ default.nix 9 | # └─ hardware-configuration.nix * 10 | # 11 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 12 | # and may be overwritten by future invocations. Please make changes 13 | # to /etc/nixos/configuration.nix instead. 14 | # 15 | 16 | { config, lib, modulesPath, host, ... }: 17 | 18 | { 19 | imports = 20 | [ 21 | (modulesPath + "/installer/scan/not-detected.nix") 22 | ]; 23 | 24 | boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; 25 | boot.initrd.kernelModules = [ ]; 26 | boot.kernelModules = [ "kvm-intel" ]; 27 | boot.extraModulePackages = [ ]; 28 | 29 | fileSystems."/" = 30 | { 31 | device = "/dev/disk/by-label/nixos"; 32 | fsType = "ext4"; 33 | }; 34 | 35 | fileSystems."/boot" = 36 | { 37 | device = "/dev/disk/by-uuid/6E06-6221"; 38 | fsType = "vfat"; 39 | }; 40 | 41 | swapDevices = [ ]; 42 | 43 | networking = with host; { 44 | useDHCP = false; 45 | hostName = hostName; 46 | networkmanager.enable = true; 47 | interfaces = { 48 | enp0s25 = { 49 | useDHCP = true; 50 | # ipv4.addresses = [{ 51 | # address = "192.168.0.51"; 52 | # prefixLength = 24; 53 | # }]; 54 | }; 55 | wlo1 = { 56 | useDHCP = true; 57 | # ipv4.addresses = [ { 58 | # address = "192.168.0.51"; 59 | # prefixLength = 24; 60 | # } ]; 61 | }; 62 | }; 63 | defaultGateway = "192.168.0.1"; 64 | nameservers = [ "192.168.0.4" ]; 65 | firewall = { 66 | enable = false; 67 | # allowedUDPPorts = [ 53 67 ]; 68 | # allowedTCPPorts = [ 53 80 443 9443 ]; 69 | }; 70 | }; 71 | 72 | hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 73 | } 74 | -------------------------------------------------------------------------------- /hosts/vm/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Specific system configuration settings for vm 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ ├─ default.nix 7 | # │ └─ ./vm 8 | # │ ├─ default.nix * 9 | # │ └─ hardware-configuration.nix 10 | # └─ ./modules 11 | # └─ ./desktops 12 | # └─ bspwm.nix 13 | # 14 | 15 | { pkgs, ... }: 16 | 17 | { 18 | imports = [ 19 | ./hardware-configuration.nix 20 | ]; 21 | 22 | boot = { 23 | loader = { 24 | grub = { 25 | enable = true; 26 | device = "/dev/sda"; 27 | }; 28 | timeout = 1; 29 | }; 30 | }; 31 | 32 | bspwm.enable = true; 33 | 34 | environment = { 35 | systemPackages = with pkgs; [ 36 | hello # Hello World 37 | ]; 38 | }; 39 | 40 | services = { 41 | xserver = { 42 | resolutions = [ 43 | { x = 1920; y = 1080; } 44 | { x = 1600; y = 900; } 45 | { x = 3840; y = 2160; } 46 | ]; 47 | }; 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /hosts/vm/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Hardware settings for a general VM. 3 | # Works on QEMU Virt-Manager and Virtualbox 4 | # 5 | # flake.nix 6 | # └─ ./hosts 7 | # └─ ./vm 8 | # ├─ default.nix 9 | # └─ hardware-configuration.nix * 10 | # 11 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 12 | # and may be overwritten by future invocations. Please make changes 13 | # to /etc/nixos/configuration.nix instead. 14 | # 15 | 16 | { config, lib, host, ... }: 17 | 18 | { 19 | imports = [ ]; 20 | 21 | boot.initrd.availableKernelModules = [ "ata_piix" "xhci_pci" "sd_mod" "sr_mod" ]; 22 | boot.initrd.kernelModules = [ ]; 23 | boot.kernelModules = [ ]; 24 | boot.extraModulePackages = [ ]; 25 | 26 | fileSystems."/" = 27 | { 28 | device = "/dev/disk/by-label/nixos"; 29 | fsType = "ext4"; 30 | }; 31 | 32 | swapDevices = [ ]; 33 | 34 | networking = with host; { 35 | useDHCP = false; 36 | hostName = hostName; 37 | interfaces = { 38 | enp0s3.useDHCP = true; 39 | }; 40 | }; 41 | 42 | hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 43 | # virtualisation.virtualbox.guest.enable = true; # currently disabled because package is broken 44 | } 45 | -------------------------------------------------------------------------------- /hosts/work/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Specific system configuration settings for work 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ ├─ default.nix 7 | # │ └─ ./work 8 | # │ ├─ default.nix * 9 | # │ └─ hardware-configuration.nix 10 | # └─ ./modules 11 | # ├─ ./desktops 12 | # │ ├─ hyprland.nix 13 | # │ └─ ./virtualisation 14 | # │ └─ default.nix 15 | # └─ ./hardware 16 | # └─ ./work 17 | # └─ default.nix 18 | # 19 | 20 | { pkgs, vars, ... }: 21 | 22 | { 23 | imports = [ ./hardware-configuration.nix ] ++ 24 | (import ../../modules/desktops/virtualisation) ++ 25 | (import ../../modules/hardware/work); 26 | 27 | boot = { 28 | loader = { 29 | efi = { 30 | canTouchEfiVariables = true; 31 | efiSysMountPoint = "/boot/efi"; 32 | }; 33 | grub = { 34 | enable = true; 35 | devices = [ "nodev" ]; 36 | efiSupport = true; 37 | useOSProber = true; 38 | configurationLimit = 2; 39 | default = 2; 40 | }; 41 | timeout = null; 42 | }; 43 | }; 44 | 45 | laptop.enable = true; 46 | hyprland.enable = true; 47 | 48 | hardware = { 49 | graphics = { 50 | enable = true; 51 | extraPackages = with pkgs; [ 52 | intel-media-driver 53 | vaapiIntel 54 | vaapiVdpau 55 | libvdpau-va-gl 56 | ]; 57 | }; 58 | sane = { 59 | enable = true; 60 | extraBackends = [ pkgs.sane-airscan ]; 61 | }; 62 | }; 63 | 64 | environment = { 65 | systemPackages = with pkgs; [ 66 | ansible # Automation 67 | ciscoPacketTracer8 # Networking 68 | eduvpn-client # VPN 69 | nil # LSP 70 | obsidian # Notes 71 | R 72 | rstudio 73 | rclone # Gdrive ($ rclone config | rclone mount --daemon gdrive: | fusermount -u ) 74 | simple-scan # Scanning 75 | sshpass # Ansible dependency 76 | syncthing # Sync Tool 77 | wacomtablet # Tablet 78 | vscode 79 | ]; 80 | }; 81 | 82 | programs.light.enable = true; 83 | 84 | flatpak = { 85 | extraPackages = [ 86 | "com.github.tchx84.Flatseal" 87 | ]; 88 | }; 89 | 90 | services = { 91 | syncthing = { 92 | enable = true; 93 | user = "${vars.user}"; 94 | dataDir = "/home/${vars.user}/Sync"; 95 | }; 96 | }; 97 | 98 | systemd.services.NetworkManager-wait-online.enable = false; 99 | } 100 | -------------------------------------------------------------------------------- /hosts/work/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Hardware settings for Lenovo Thinkpad T15 Gen1 15.6" Laptop 3 | # Dual boot active. Windows @ sda2 / NixOS @ sda4 4 | # 5 | # flake.nix 6 | # └─ ./hosts 7 | # └─ ./work 8 | # ├─ default.nix 9 | # └─ hardware-configuration.nix * 10 | # 11 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 12 | # and may be overwritten by future invocations. Please make changes 13 | # to /etc/nixos/configuration.nix instead. 14 | # 15 | 16 | { config, lib, modulesPath, host, ... }: 17 | 18 | { 19 | imports = 20 | [ 21 | (modulesPath + "/installer/scan/not-detected.nix") 22 | ]; 23 | 24 | boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; 25 | boot.initrd.kernelModules = [ ]; 26 | boot.kernelModules = [ "kvm-intel" ]; 27 | boot.extraModulePackages = [ ]; 28 | 29 | fileSystems."/" = 30 | { 31 | device = "/dev/disk/by-uuid/c44a8f5c-1b8e-4c0d-aa63-755a95bd5a50"; 32 | fsType = "ext4"; 33 | }; 34 | 35 | fileSystems."/boot/efi" = 36 | { 37 | device = "/dev/disk/by-uuid/A101-6404"; 38 | fsType = "vfat"; 39 | }; 40 | 41 | fileSystems."/windows" = 42 | { 43 | device = "/dev/disk/by-uuid/01D9316EDB06F490"; 44 | fsType = "ntfs"; 45 | options = [ "nofail" "uid=1000" "gid=100" ]; 46 | }; 47 | 48 | swapDevices = [ ]; 49 | 50 | networking = with host; { 51 | useDHCP = lib.mkDefault true; 52 | hostName = hostName; 53 | enableIPv6 = false; 54 | networkmanager.enable = true; 55 | networkmanager.wifi.scanRandMacAddress = false; 56 | firewall = { 57 | # wireguard trips rpfilter up 58 | extraCommands = '' 59 | ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN 60 | ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN 61 | ''; 62 | extraStopCommands = '' 63 | ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN || true 64 | ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN || true 65 | ''; 66 | # If packets are still dropped, they will show up in dmesg 67 | logReversePathDrops = true; 68 | # To load wireguard cert in nm-applet: nmcli connection import type wireguard file 69 | }; 70 | bridges = { 71 | "br0" = { 72 | interfaces = [ "enp0s31f6" ]; 73 | }; 74 | }; 75 | interfaces = { 76 | #enp0s31f6.useDHCP = lib.mkDefault true; 77 | #wlp0s20f3.useDHCP = lib.mkDefault true; 78 | br0.useDHCP = true; 79 | }; 80 | }; 81 | 82 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 83 | powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; 84 | hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 85 | } 86 | -------------------------------------------------------------------------------- /hosts/xps/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Specific system configuration settings for xps 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ ├─ default.nix 7 | # │ └─ ./xps 8 | # │ ├─ default.nix * 9 | # │ └─ hardware-configuration.nix 10 | # └─ ./modules 11 | # └─ ./desktops 12 | # ├─ hyprland.nix 13 | # └─ ./virtualisation 14 | # └─ docker.nix 15 | # 16 | 17 | { pkgs, ... }: 18 | 19 | { 20 | imports = [ 21 | ./hardware-configuration.nix 22 | ../../modules/desktops/virtualisation/docker.nix 23 | ] ++ 24 | (import ../../modules/hardware/xps) ++ 25 | (import ../../modules/desktops/virtualisation); 26 | 27 | boot = { 28 | consoleLogLevel = 3; 29 | loader = { 30 | systemd-boot = { 31 | enable = true; 32 | configurationLimit = 2; 33 | }; 34 | efi = { 35 | canTouchEfiVariables = true; 36 | }; 37 | timeout = 5; 38 | }; 39 | }; 40 | 41 | hardware.sane = { 42 | enable = true; 43 | extraBackends = [ pkgs.sane-airscan ]; 44 | }; 45 | 46 | laptop.enable = true; 47 | hyprland.enable = true; 48 | 49 | environment = { 50 | systemPackages = with pkgs; [ 51 | fprintd # Fingerprint 52 | jellyfin-media-player # Media Player 53 | plex-media-player # Media Player 54 | simple-scan # Scanning 55 | moonlight-qt # Remote Streaming 56 | ]; 57 | }; 58 | 59 | services = { 60 | fprintd = { 61 | enable = true; 62 | tod = { 63 | enable = true; 64 | driver = pkgs.libfprint-2-tod1-goodix; 65 | }; 66 | }; # $ sudo fprintd-enroll --finger right-index-finger 67 | logind.extraConfig = '' 68 | HandlePowerKey=ignore 69 | ''; # Disable short click powerbutton 70 | hardware.bolt.enable = true; 71 | }; 72 | 73 | programs.light.enable = true; 74 | 75 | flatpak = { 76 | extraPackages = [ 77 | "com.github.tchx84.Flatseal" 78 | "com.stremio.Stremio" 79 | ]; 80 | }; 81 | } 82 | -------------------------------------------------------------------------------- /hosts/xps/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Hardware settings for Dell XPS 15 9500 3 | # Dual boot active. Windows @ nvme0n1p3 / NixOS @ nvme0n1p7 4 | # 5 | # flake.nix 6 | # └─ ./hosts 7 | # └─ ./xps 8 | # ├─ default.nix 9 | # └─ hardware-configuration.nix * 10 | # 11 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 12 | # and may be overwritten by future invocations. Please make changes 13 | # to /etc/nixos/configuration.nix instead. 14 | # 15 | 16 | { config, lib, modulesPath, host, ... }: 17 | 18 | { 19 | imports = 20 | [ 21 | (modulesPath + "/installer/scan/not-detected.nix") 22 | ]; 23 | 24 | boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" "rtsx_pci_sdmmc" ]; 25 | boot.initrd.kernelModules = [ ]; 26 | boot.kernelModules = [ "kvm-intel" ]; 27 | boot.extraModulePackages = [ ]; 28 | 29 | fileSystems."/" = 30 | { 31 | device = "/dev/disk/by-uuid/5701437d-9ca9-4f6b-bae3-d5a51a9b5dc9"; 32 | fsType = "btrfs"; 33 | }; 34 | 35 | fileSystems."/boot" = 36 | { 37 | device = "/dev/disk/by-uuid/44AF-9E34"; 38 | fsType = "vfat"; 39 | }; 40 | 41 | swapDevices = [ ]; 42 | 43 | networking = with host; { 44 | useDHCP = lib.mkDefault true; 45 | # interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; 46 | hostName = hostName; 47 | enableIPv6 = false; 48 | networkmanager = { 49 | enable = true; 50 | # extraConfig = '' 51 | # [main] 52 | # rc-manager=resolvconf 53 | # ''; 54 | }; 55 | nameservers = [ "192.168.0.4" "1.1.1.1" ]; 56 | firewall.enable = false; 57 | }; 58 | 59 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 60 | powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; 61 | hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 62 | } 63 | -------------------------------------------------------------------------------- /modules/desktops/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Desktop Environments & Window Managers 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ └─ configuration.nix 7 | # └─ ./modules 8 | # └─ ./desktops 9 | # ├─ default.nix * 10 | # └─ ... 11 | # 12 | 13 | [ 14 | ./bspwm.nix 15 | ./gnome.nix 16 | ./hyprland.nix 17 | ./kde.nix 18 | ./options.nix 19 | ./river.nix 20 | ./sway.nix 21 | ] 22 | -------------------------------------------------------------------------------- /modules/desktops/options.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Options to enable packages depending on the DE/WM. They options are enabled in the .nix files. 3 | # 4 | 5 | { lib, ... }: 6 | 7 | with lib; 8 | { 9 | options = { 10 | x11wm = { 11 | # Condition if host uses an X11 window manager 12 | enable = mkOption { 13 | type = types.bool; 14 | default = false; 15 | }; 16 | }; 17 | wlwm = { 18 | # Condition if host uses a wayland window manager 19 | enable = mkOption { 20 | type = types.bool; 21 | default = false; 22 | }; 23 | }; 24 | laptop = { 25 | # Condition if host is a laptop 26 | enable = mkOption { 27 | type = types.bool; 28 | default = false; 29 | }; 30 | }; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /modules/desktops/virtualisation/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Virtualisation Modules 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ └─ ./ 7 | # │ └─ default.nix 8 | # └─ ./modules 9 | # └─ ./desktops 10 | # └─ ./virtualisation 11 | # ├─ default.nix * 12 | # └─ ... 13 | # 14 | 15 | [ 16 | ./docker.nix 17 | ./qemu.nix 18 | ./x11vnc.nix 19 | ] 20 | -------------------------------------------------------------------------------- /modules/desktops/virtualisation/docker.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Docker 3 | # 4 | 5 | { pkgs, vars, ... }: 6 | 7 | { 8 | virtualisation = { 9 | docker.enable = true; 10 | }; 11 | 12 | users.groups.docker.members = [ "${vars.user}" ]; 13 | 14 | environment.systemPackages = with pkgs; [ 15 | docker # Containers 16 | docker-compose # Multi-Container 17 | ]; 18 | } 19 | -------------------------------------------------------------------------------- /modules/desktops/virtualisation/x11vnc.nix: -------------------------------------------------------------------------------- 1 | # 2 | # VNC Remote Connect Server 3 | # 4 | 5 | { config, lib, pkgs, vars, ... }: 6 | 7 | { 8 | config = lib.mkIf (config.services.xserver.enable) { 9 | networking.firewall.allowedTCPPorts = [ 5900 ]; 10 | 11 | environment = { 12 | systemPackages = with pkgs; [ 13 | x11vnc # VNC Server 14 | ]; 15 | }; 16 | 17 | systemd.services."x11vnc" = { 18 | enable = true; 19 | description = "VNC Server for X11"; 20 | requires = [ "display-manager.service" ]; 21 | after = [ "display-manager.service" ]; 22 | serviceConfig = { 23 | # Password stored in document "passwd" at $HOME. This needs auth and link to display. Otherwise x11vnc won't detect the display 24 | ExecStart = "${pkgs.x11vnc}/bin/x11vnc -passwdfile /home/${vars.user}/passwd -noxdamage -nap -many -repeat -clear_keys -capslock -xkb -forever -loop100 -auth /var/run/lightdm/root/:0 -display :0 -clip 1920x1080+1920+0"; 25 | ExecStop = "${pkgs.x11vnc}/bin/x11vnc -R stop"; 26 | }; 27 | wantedBy = [ "multi-user.target" ]; 28 | }; 29 | }; 30 | # passwdfile: Password in /home/{vars.user}/passwd 31 | # noxdamage: Quicker render (maybe not optimal) 32 | # nap: If no acitivity, take longer naps 33 | # many: Keep listening for more connections 34 | # repeat: X server key auto repeat 35 | # clear_keys: Clear modifier keys on startup and exit 36 | # capslock: Don't ignore capslock 37 | # xkb: Use xkeyboard 38 | # forever: Keep listening for connection after disconnect 39 | # loop100: Loop to restart service but wait 100ms 40 | # auth: X authority file location so vnc also works from display manager (lightdm) 41 | # display: Which display to show. Even with multiple monitors it's 0 42 | # clip: Only show specific monitor using xinerama or pixel coordinates you can find using $ xrandr -q. Can be removed to show all. 43 | } 44 | -------------------------------------------------------------------------------- /modules/editors/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Editors 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ └─ default.nix 7 | # └─ ./modules 8 | # └─ ./editors 9 | # ├─ default.nix * 10 | # ├─ ./emacs 11 | # │ └─ ... 12 | # └─ ... 13 | # 14 | 15 | [ 16 | ./nvim.nix 17 | # ./emacs 18 | # ./emacs/doom-emacs 19 | ] 20 | -------------------------------------------------------------------------------- /modules/editors/emacs/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Personal Emacs Config 3 | # Recommended to comment out this import first install because script will cause issues. 4 | # Unfortunately an activation script like with the default nix options is not possible since home.activation and home.file.*.onChange will time out systemd. 5 | # 6 | # flake.nix 7 | # ├─ ./hosts 8 | # │ └─ configuration.nix 9 | # └─ ./modules 10 | # ├─ default.nix 11 | # └─ ./editors 12 | # └─ ./emacs 13 | # └─ default.nix * 14 | # 15 | 16 | 17 | { pkgs, vars, ... }: 18 | 19 | { 20 | services.emacs = { 21 | enable = true; 22 | }; 23 | 24 | system.activationScripts = { 25 | emacs.text = '' 26 | CONFIG="/home/${vars.user}/.emacs.d" 27 | 28 | if [ ! -d "$CONFIG" ]; then 29 | ${pkgs.git}/bin/git clone https://github.com/matthiasbenaets/emacs.d.git $CONFIG 30 | fi 31 | 32 | chown -R ${vars.user}:users /home/${vars.user}/.emacs.d 33 | ''; 34 | }; 35 | 36 | environment.systemPackages = with pkgs; [ 37 | emacs 38 | emacs-all-the-icons-fonts 39 | fd 40 | ispell 41 | ripgrep 42 | ]; 43 | } 44 | -------------------------------------------------------------------------------- /modules/editors/emacs/doom-emacs/alt/doom.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DOOM="$HOME/.emacs.d" 4 | 5 | if [ ! -d "$DOOM" ]; then 6 | git clone https://github.com/hlissner/doom-emacs.git $DOOM 7 | alacritty -e $DOOM/bin/doom -y install & disown 8 | else 9 | alacritty -e $DOOM/bin/doom sync 10 | fi 11 | 12 | -------------------------------------------------------------------------------- /modules/editors/emacs/doom-emacs/alt/home.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Doom Emacs: native install with home manager. 3 | # Recommended to comment out this import first install because script will cause issues. It your want to use doom emacs, use the correct location or change in script. 4 | # In my opinion better then nix-community/nix-doom-emacs but more of a hassle to install on a fresh install. 5 | # Unfortunately an activation script like with the default nix options is not possible since home.activation and home.file.*.onChange will time out systemd. 6 | # 7 | # flake.nix 8 | # ├─ ./hosts 9 | # │ └─ home.nix 10 | # └─ ./modules 11 | # └─ ./editors 12 | # ├─ default.nix 13 | # └─ ./emacs 14 | # └─ ./doom-emacs 15 | # └─ default.nix * 16 | # 17 | 18 | { pkgs, vars, ... }: 19 | 20 | { 21 | home-manager.users.${vars.user} = { 22 | home = { 23 | file.".doom.d" = { 24 | source = ./doom.d; # Sets up symlink name ".doom.d" for file "doom.d" 25 | recursive = true; 26 | onChange = builtins.readFile ./doom.sh; # If an edit is detected, it will run this script. Pretty much the same as what is now in default.nix but actually stating the terminal and adding the disown flag to it won't time out 27 | }; 28 | 29 | packages = with pkgs; [ 30 | alacritty # for the script 31 | ripgrep 32 | coreutils 33 | fd 34 | ]; 35 | }; 36 | 37 | programs.emacs.enable = true; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /modules/editors/emacs/doom-emacs/alt/nix-community.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Doom Emacs: home-manager alternative in "native.nix" and "default.nix". Personally not a fan of github:nix-community/nix-doom-emacs due to performance issues 3 | # To make use of this module you will need to have doom-emacs as one of the inputs of the flake. 4 | # This module is set up to be used with home-manager. 5 | # 6 | # flake.nix 7 | # ├─ ./hosts 8 | # │ └─ home.nix 9 | # └─ ./modules 10 | # └─ ./editors 11 | # ├─ default.nix 12 | # └─ ./emacs 13 | # └─ ./doom-emacs 14 | # └─ ./alt 15 | # └─ nix-community.nix * 16 | # 17 | 18 | 19 | { pkgs, doom-emacs, vars, ... }: 20 | 21 | { 22 | home-manager.users.${vars.user} = { 23 | imports = [ doom-emacs.hmModule ]; 24 | 25 | programs.doom-emacs = { 26 | enable = true; 27 | doomPrivateDir = ./doom.d; 28 | }; 29 | 30 | home.packages = with pkgs; [ 31 | clang 32 | coreutils 33 | emacs 34 | fd 35 | git 36 | ripgrep 37 | ]; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /modules/editors/emacs/doom-emacs/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Doom Emacs: Personally not a fan of github:nix-community/nix-doom-emacs due to performance issues 3 | # This is an ideal way to install on a vanilla NixOS installion. 4 | # You will need to import this from somewhere in the flake (Obviously not in a home-manager nix file) 5 | # 6 | # flake.nix 7 | # ├─ ./hosts 8 | # │ └─ configuration.nix 9 | # └─ ./modules 10 | # └─ ./editors 11 | # ├─ default.nix 12 | # └─ ./emacs 13 | # └─ ./doom-emacs 14 | # └─ default.nix * 15 | # 16 | 17 | 18 | { config, pkgs, vars, ... }: 19 | 20 | { 21 | services.emacs.enable = true; 22 | 23 | system.userActivationScripts = { 24 | # Installation Script on Rebuild 25 | doomEmacs = { 26 | text = '' 27 | source ${config.system.build.setEnvironment} 28 | EMACS="$HOME/.emacs.d" 29 | 30 | if [ ! -d "$EMACS" ]; then 31 | ${pkgs.git}/bin/git clone https://github.com/hlissner/doom-emacs.git $EMACS 32 | yes | $EMACS/bin/doom install 33 | rm -r $HOME/.doom.d 34 | ln -s ${vars.location}/modules/editors/emacs/doom-emacs/doom.d $HOME/.doom.d 35 | $EMACS/bin/doom sync 36 | else 37 | $EMACS/bin/doom sync 38 | fi 39 | ''; # Will Sync on Changes 40 | }; 41 | }; 42 | 43 | environment.systemPackages = with pkgs; [ 44 | clang 45 | coreutils 46 | emacs 47 | fd 48 | git 49 | ripgrep 50 | ]; 51 | } 52 | -------------------------------------------------------------------------------- /modules/editors/emacs/doom-emacs/doom.d/custom.el: -------------------------------------------------------------------------------- 1 | (custom-set-variables 2 | ;; custom-set-variables was added by Custom. 3 | ;; If you edit it by hand, you could mess it up, so be careful. 4 | ;; Your init file should contain only one such instance. 5 | ;; If there is more than one, they won't work right. 6 | '(warning-suppress-types 7 | '(((python python-shell-prompt-regexp)) 8 | ((python python-shell-prompt-regexp)) 9 | ((python python-shell-prompt-regexp)) 10 | ((python python-shell-prompt-regexp)) 11 | ((python python-shell-prompt-regexp)) 12 | ((python python-shell-prompt-regexp)) 13 | (org-element-cache) 14 | (org-element-cache) 15 | (org-element-cache)))) 16 | (custom-set-faces 17 | ;; custom-set-faces was added by Custom. 18 | ;; If you edit it by hand, you could mess it up, so be careful. 19 | ;; Your init file should contain only one such instance. 20 | ;; If there is more than one, they won't work right. 21 | '(org-document-title ((t (:height 2.5)))) 22 | '(org-level-1 ((t (:inherit outline-1 :height 1.2)))) 23 | '(org-level-2 ((t (:inherit outline-2 :height 1.15)))) 24 | '(org-level-3 ((t (:inherit outline-3 :height 1.12)))) 25 | '(org-level-4 ((t (:inherit outline-4 :height 1.08)))) 26 | '(org-level-5 ((t (:inherit outline-5 :height 1.05))))) 27 | -------------------------------------------------------------------------------- /modules/editors/emacs/doom-emacs/doom.d/packages.el: -------------------------------------------------------------------------------- 1 | ;; -*- no-byte-compile: t; -*- 2 | ;;; $DOOMDIR/packages.el 3 | 4 | ;; To install a package with Doom you must declare them here and run 'doom sync' 5 | ;; on the command line, then restart Emacs for the changes to take effect -- or 6 | ;; use 'M-x doom/reload'. 7 | 8 | 9 | ;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: 10 | ;(package! some-package) 11 | 12 | ;; To install a package directly from a remote git repo, you must specify a 13 | ;; `:recipe'. You'll find documentation on what `:recipe' accepts here: 14 | ;; https://github.com/raxod502/straight.el#the-recipe-format 15 | ;(package! another-package 16 | ; :recipe (:host github :repo "username/repo")) 17 | 18 | ;; If the package you are trying to install does not contain a PACKAGENAME.el 19 | ;; file, or is located in a subdirectory of the repo, you'll need to specify 20 | ;; `:files' in the `:recipe': 21 | ;(package! this-package 22 | ; :recipe (:host github :repo "username/repo" 23 | ; :files ("some-file.el" "src/lisp/*.el"))) 24 | 25 | ;; If you'd like to disable a package included with Doom, you can do so here 26 | ;; with the `:disable' property: 27 | ;(package! builtin-package :disable t) 28 | 29 | ;; You can override the recipe of a built in package without having to specify 30 | ;; all the properties for `:recipe'. These will inherit the rest of its recipe 31 | ;; from Doom or MELPA/ELPA/Emacsmirror: 32 | ;(package! builtin-package :recipe (:nonrecursive t)) 33 | ;(package! builtin-package-2 :recipe (:repo "myfork/package")) 34 | 35 | ;; Specify a `:branch' to install a package from a particular branch or tag. 36 | ;; This is required for some packages whose default branch isn't 'master' (which 37 | ;; our package manager can't deal with; see raxod502/straight.el#279) 38 | ;(package! builtin-package :recipe (:branch "develop")) 39 | 40 | ;; Use `:pin' to specify a particular commit to install. 41 | ;(package! builtin-package :pin "1a2b3c4d5e") 42 | 43 | 44 | ;; Doom's packages are pinned to a specific commit and updated from release to 45 | ;; release. The `unpin!' macro allows you to unpin single packages... 46 | ;(unpin! pinned-package) 47 | ;; ...or multiple packages 48 | ;(unpin! pinned-package another-pinned-package) 49 | ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) 50 | ;(unpin! t) 51 | 52 | ;; General 53 | (package! rotate) 54 | 55 | ;; Org mode 56 | (package! org-bullets) 57 | (package! visual-fill-column) 58 | 59 | ;; Python mode 60 | ;; (package! anaconda-mode :ignore t) 61 | (package! elpy) 62 | -------------------------------------------------------------------------------- /modules/hardware/beelink/ax101.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Bluetooth fix for ax101 (ax201) 3 | # In BIOS disable hibernate and fast boot, enable network stack 4 | # On dualboot, disable fast startup on Windows 5 | # 6 | 7 | { pkgs, ... }: 8 | 9 | let 10 | linux-firmware-ax101bt = pkgs.fetchgit { 11 | url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"; 12 | rev = "c7c5ca392684b6ea79be8242d72e3a83758343e1"; 13 | sha256 = "sha256-iqVXIdZhEuIclsdqsVCqnMsQOGm/gZYwsS42eeSrMpE="; 14 | }; 15 | 16 | ax101 = self: super: { 17 | linux-firmware = super.linux-firmware.overrideAttrs (prev: { 18 | version = "git+c7c5ca392684b6ea79be8242d72e3a83758343e1"; 19 | src = linux-firmware-ax101bt; 20 | outputHash = "sha256-CkDUwfI6WMzwr0yhpk4+3NxY696EItArCeDh528v2lc="; 21 | }); 22 | }; 23 | in 24 | { 25 | nixpkgs.overlays = [ ax101 ]; 26 | } 27 | -------------------------------------------------------------------------------- /modules/hardware/beelink/default.nix: -------------------------------------------------------------------------------- 1 | [ 2 | ./ax101.nix 3 | ] 4 | -------------------------------------------------------------------------------- /modules/hardware/bluetooth.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Bluetooth 3 | # 4 | 5 | { pkgs, ... }: 6 | 7 | { 8 | hardware.bluetooth = { 9 | enable = true; 10 | settings = { 11 | General = { 12 | Enable = "Source,Sink,Media,Socket"; 13 | AutoEnable = true; 14 | ControllerMode = "bredr"; 15 | }; 16 | }; 17 | }; 18 | services.blueman.enable = true; 19 | systemd.user.services.mpris-proxy = { 20 | description = "Mpris proxy"; 21 | after = [ "network.target" "sound.target" ]; 22 | wantedBy = [ "default.target" ]; 23 | serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /modules/hardware/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Hardware 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ └─ default.nix 7 | # └─ ./modules 8 | # └─ ./hardware 9 | # ├─ default.nix * 10 | # └─ ... 11 | # 12 | 13 | [ 14 | ./bluetooth.nix 15 | ./dslr.nix 16 | ./power.nix 17 | ] 18 | -------------------------------------------------------------------------------- /modules/hardware/dslr.nix: -------------------------------------------------------------------------------- 1 | # 2 | # DSLR Camera as webcam 3 | # 4 | 5 | { config, pkgs, ... }: 6 | 7 | { 8 | boot = { 9 | kernelModules = [ "v4l2loopback" ]; 10 | extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback.out ]; 11 | extraModprobeConfig = '' 12 | alias dslr-webcam v4l2loopback 13 | options v4l2loopback exclusive_caps=1 max_buffers=2 card_label="Virtual Camera" 14 | ''; 15 | }; 16 | 17 | environment = { 18 | systemPackages = with pkgs; [ 19 | gphoto2 20 | ffmpeg-full 21 | ]; 22 | interactiveShellInit = '' 23 | alias dslr='gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0' 24 | ''; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /modules/hardware/power.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Power Management 3 | # 4 | 5 | { config, lib, vars, ... }: 6 | 7 | { 8 | config = lib.mkIf (config.laptop.enable && config.gnome.enable == false) { 9 | services = { 10 | tlp.enable = false; # Disable due to suspend not working when docked and connected to AC 11 | auto-cpufreq.enable = true; # Power Efficiency 12 | }; 13 | 14 | home-manager.users.${vars.user} = { 15 | services = { 16 | cbatticon = { 17 | enable = true; 18 | criticalLevelPercent = 10; 19 | commandCriticalLevel = ''notify-send "battery critical!"''; 20 | lowLevelPercent = 30; 21 | iconType = "standard"; 22 | }; 23 | }; 24 | }; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /modules/hardware/work/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Hardware 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ └─ ./work 7 | # │ └─ default.nix 8 | # └─ ./modules 9 | # └─ ./hardware 10 | # └─ ./work 11 | # ├─ default.nix * 12 | # └─ ... 13 | # 14 | 15 | [ 16 | # ./intel.nix 17 | ./nvidia.nix 18 | ./wpa.nix 19 | ] 20 | -------------------------------------------------------------------------------- /modules/hardware/work/eduroam.patch: -------------------------------------------------------------------------------- 1 | --- wpa_supplicant-2.10/src/crypto/tls_openssl.c 2 | +++ src/crypto/tls_openssl.c.legacy 3 | @@ -1048,7 +1048,7 @@ 4 | 5 | SSL_CTX_set_options(ssl, SSL_OP_NO_SSLv2); 6 | SSL_CTX_set_options(ssl, SSL_OP_NO_SSLv3); 7 | - 8 | + SSL_CTX_set_options(ssl, SSL_OP_LEGACY_SERVER_CONNECT); 9 | SSL_CTX_set_mode(ssl, SSL_MODE_AUTO_RETRY); 10 | 11 | #ifdef SSL_MODE_NO_AUTO_CHAIN 12 | -------------------------------------------------------------------------------- /modules/hardware/work/intel.nix: -------------------------------------------------------------------------------- 1 | { 2 | boot.extraModprobeConfig = '' 3 | blacklist nouveau 4 | options nouveau modeset=0 5 | ''; 6 | 7 | boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ]; 8 | } 9 | -------------------------------------------------------------------------------- /modules/hardware/work/nvidia.nix: -------------------------------------------------------------------------------- 1 | # 2 | # NVIDIA drivers so that the laptop video card can get offloaded to specific applications. 3 | # Either start the desktop or packages using nvidia-offload. 4 | # For example: $ nvidia-offload kdenlive 5 | # Currently only used with work laptop using NVIDIA MX330 6 | # 7 | 8 | { config, pkgs, ... }: 9 | 10 | let 11 | nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" '' 12 | export __NV_PRIME_RENDER_OFFLOAD=1 13 | export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 14 | export __GLX_VENDOR_LIBRARY_NAME=nvidia 15 | export __VK_LAYER_NV_optimus=NVIDIA_only 16 | exec "$@" 17 | ''; 18 | in 19 | { 20 | nixpkgs.config.nvidia.acceptLicense = true; 21 | 22 | environment.systemPackages = [ nvidia-offload ]; 23 | 24 | services.xserver.videoDrivers = [ "nvidia" ]; 25 | hardware = { 26 | graphics.enable = true; 27 | nvidia = { 28 | package = config.boot.kernelPackages.nvidiaPackages.production; 29 | open = false; 30 | prime = { 31 | offload.enable = true; 32 | intelBusId = "PCI:0:2:0"; 33 | nvidiaBusId = "PCI:45:0:0"; 34 | }; 35 | modesetting.enable = true; 36 | powerManagement.enable = true; 37 | }; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /modules/hardware/work/wpa.nix: -------------------------------------------------------------------------------- 1 | # 2 | # The latest OpenSSL package uses SSL3, meaning it will no longer support certain legacy protocols. 3 | # I guess my work's network isn't set up as securaly as they want us to think. 4 | # This patch makes it back available to connect to legacy servers. 5 | # 6 | 7 | { 8 | nixpkgs.config.packageOverrides = pkgs: rec { 9 | wpa_supplicant = pkgs.wpa_supplicant.overrideAttrs (attrs: { 10 | patches = attrs.patches ++ [ ./eduroam.patch ]; 11 | }); 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /modules/hardware/xps/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Hardware 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ └─ ./xps 7 | # │ └─ default.nix 8 | # └─ ./modules 9 | # └─ ./hardware 10 | # └─ ./xps 11 | # ├─ default.nix * 12 | # └─ ... 13 | # 14 | 15 | [ 16 | ./nvidia.nix 17 | ] 18 | -------------------------------------------------------------------------------- /modules/hardware/xps/nvidia.nix: -------------------------------------------------------------------------------- 1 | # 2 | # NVIDIA drivers so that the laptop video card can get offloaded to specific applications. 3 | # Either start the desktop or packages using nvidia-offload. 4 | # For example: $ nvidia-offload glmark2 5 | # For GeForce GTX 1650 Ti 6 | # 7 | 8 | { config, pkgs, ... }: 9 | 10 | let 11 | nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" '' 12 | export __NV_PRIME_RENDER_OFFLOAD=1 13 | export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 14 | export __GLX_VENDOR_LIBRARY_NAME=nvidia 15 | export __VK_LAYER_NV_optimus=NVIDIA_only 16 | exec "$@" 17 | ''; 18 | in 19 | { 20 | nixpkgs.config.nvidia.acceptLicense = true; 21 | 22 | environment.systemPackages = [ nvidia-offload ]; 23 | 24 | services.xserver.videoDrivers = [ "nvidia" ]; 25 | hardware = { 26 | graphics = { 27 | enable = true; 28 | # package = pkgs.mesa.drivers; 29 | }; 30 | nvidia = { 31 | package = config.boot.kernelPackages.nvidiaPackages.production; 32 | open = false; 33 | prime = { 34 | offload.enable = true; 35 | intelBusId = "PCI:0:2:0"; 36 | nvidiaBusId = "PCI:1:0:0"; 37 | }; 38 | modesetting.enable = true; 39 | powerManagement.enable = true; 40 | }; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /modules/programs/accounts.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Gnome Control Manager 3 | # Mainly used for online accounts 4 | # 5 | 6 | { lib, pkgs, vars, host, ... }: 7 | 8 | { 9 | config = lib.mkIf (host.hostName == "beelink" || host.hostName == "work" || host.hostName == "xps") { 10 | environment.systemPackages = with pkgs; [ 11 | gnome-control-center 12 | gnome-online-accounts 13 | ]; 14 | 15 | services.gnome.gnome-keyring.enable = true; 16 | 17 | security.pam.services.gnomekey.enableGnomeKeyring = true; 18 | 19 | home-manager.users.${vars.user} = { 20 | xdg.desktopEntries.gnome-control-center = { 21 | name = "Gnome Control Center"; 22 | exec = "env XDG_CURRENT_DESKTOP=GNOME ${pkgs.gnome-control-center}/bin/gnome-control-center"; 23 | }; 24 | }; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /modules/programs/alacritty.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Terminal Emulator 3 | # 4 | 5 | { vars, ... }: 6 | 7 | { 8 | home-manager.users.${vars.user} = { 9 | programs = { 10 | alacritty = { 11 | enable = true; 12 | settings = { 13 | font = { 14 | normal.family = "FiraCode Nerd Font"; 15 | bold = { style = "Bold"; }; 16 | size = 11; 17 | }; 18 | offset = { 19 | x = -1; 20 | y = 0; 21 | }; 22 | }; 23 | }; 24 | }; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /modules/programs/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Apps 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ └─ configuration.nix 7 | # └─ ./modules 8 | # └─ ./programs 9 | # ├─ default.nix * 10 | # └─ ... 11 | # 12 | 13 | [ 14 | ./alacritty.nix 15 | ./accounts.nix 16 | ./eww.nix 17 | ./flatpak.nix 18 | ./kitty.nix 19 | ./obs.nix 20 | ./rofi.nix 21 | ./waybar.nix 22 | ./wofi.nix 23 | # ./games.nix 24 | ] 25 | -------------------------------------------------------------------------------- /modules/programs/eww.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Bar 3 | # 4 | 5 | { config, lib, pkgs, vars, ... }: 6 | 7 | { 8 | config = lib.mkIf (config.wlwm.enable) { 9 | environment.systemPackages = with pkgs; [ 10 | eww # Widgets 11 | jq # JSON Processor 12 | socat # Data Transfer 13 | ]; 14 | 15 | home-manager.users.${vars.user} = { 16 | home.file.".config/eww" = { 17 | source = ./eww; 18 | recursive = true; 19 | }; 20 | }; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /modules/programs/eww/css/calendar.scss: -------------------------------------------------------------------------------- 1 | .cal { 2 | @include window; 3 | padding: .2em; 4 | } 5 | 6 | calendar { 7 | padding: 5px; 8 | :selected { 9 | color: LightSkyBlue; 10 | } 11 | .header { 12 | color: white; 13 | } 14 | .highlight { 15 | color: white; 16 | font-weight: bold; 17 | } 18 | .button { 19 | color: white; 20 | } 21 | :indeterminate { 22 | color: gray; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /modules/programs/eww/css/menu.scss: -------------------------------------------------------------------------------- 1 | .parent { 2 | background-color: rgba($color: #000000, $alpha: 0.9); 3 | border-radius: 8px; 4 | padding: 8px; 5 | } 6 | .header { 7 | font-weight: bold; 8 | font-size: large; 9 | } 10 | .title { 11 | margin-right: 50px; 12 | margin-left: 1px; 13 | } 14 | .button { 15 | margin: 2px; 16 | background-color: #333; 17 | border-radius: 8px; 18 | padding: 4px 12px 4px 12px; 19 | font-size: 25px; 20 | } 21 | .button:hover { 22 | background-color: #222; 23 | } 24 | .button:active { 25 | background-color: #111; 26 | } 27 | .exit:hover { 28 | color: #f66; 29 | } 30 | .exit, .button { 31 | transition: all 0.2s ease; 32 | } 33 | -------------------------------------------------------------------------------- /modules/programs/eww/css/sink.scss: -------------------------------------------------------------------------------- 1 | .audio_button { 2 | margin: 2px; 3 | background-color: #333; 4 | border-radius: 8px; 5 | padding: 4px 12px 4px 12px; 6 | } 7 | .audio_button:hover { 8 | background-color: #222; 9 | } 10 | .audio_button:active { 11 | background-color: #111; 12 | } 13 | -------------------------------------------------------------------------------- /modules/programs/eww/css/system.scss: -------------------------------------------------------------------------------- 1 | .battery_perc.low { 2 | color: IndianRed; 3 | } 4 | -------------------------------------------------------------------------------- /modules/programs/eww/css/volume.scss: -------------------------------------------------------------------------------- 1 | .metric scale trough highlight { 2 | all: unset; 3 | background-color: #EEE; 4 | color: #000000; 5 | border-radius: 10px; 6 | } 7 | .metric scale trough { 8 | all: unset; 9 | background-color: #4e4e4e; 10 | border-radius: 50px; 11 | min-height: 5px; 12 | min-width: 50px; 13 | margin-left: 10px; 14 | margin-right: 20px; 15 | } 16 | -------------------------------------------------------------------------------- /modules/programs/eww/css/workspaces.scss: -------------------------------------------------------------------------------- 1 | .w0, .w01, .w02, .w03, .w04, .w05, .w06, .w07, .w08, .w09, .w011, .w022, .w033, .w044, .w055, .w066, .w077, .w088, .w099 { 2 | padding: 4px 10px 0px 10px; 3 | box-shadow: inset 0 -2px transparent; 4 | font-size: 15px; 5 | } 6 | 7 | .w0 { 8 | color: #a89984; 9 | } 10 | .w01, .w02, .w03, .w04, .w05, .w06, .w07, .w08, .w09 { 11 | color: white; 12 | } 13 | 14 | .w011, .w022, .w033, .w044, .w055, .w066, .w077, .w088, .w099 { 15 | color: white; 16 | box-shadow: inset 0px 2px LightSkyBlue; 17 | } 18 | .workspace { 19 | padding: 0 5px; 20 | } 21 | 22 | .workspace button:hover { 23 | box-shadow: inset 0px 2px #ffffff; 24 | } 25 | -------------------------------------------------------------------------------- /modules/programs/eww/eww.scss: -------------------------------------------------------------------------------- 1 | @mixin rounding { 2 | border-radius: 16px; 3 | } 4 | 5 | @mixin window { 6 | background-color: black; 7 | background-position: center; 8 | background-size: cover; 9 | border: 1px solid rgba(0, 0, 0, .3); 10 | color: white; 11 | margin: 5px 5px 10px; 12 | @include rounding; 13 | } 14 | 15 | * { 16 | all: unset; 17 | } 18 | 19 | @import 'css/menu'; 20 | @import 'css/workspaces'; 21 | @import 'css/sink'; 22 | @import 'css/system'; 23 | @import 'css/volume'; 24 | @import 'css/calendar'; 25 | 26 | .bar { 27 | color: white; 28 | } 29 | 30 | .tooltip { 31 | background-color: black; 32 | } 33 | 34 | .space { 35 | margin: 0px 10px 0px 10px; 36 | } 37 | -------------------------------------------------------------------------------- /modules/programs/eww/eww.yuck: -------------------------------------------------------------------------------- 1 | (include "./var.yuck") 2 | 3 | (include "./modules/icon.yuck") 4 | (include "./modules/workspace.yuck") 5 | (include "./modules/peripheral.yuck") 6 | (include "./modules/system.yuck") 7 | (include "./modules/volume.yuck") 8 | ;(include "./modules/clock.yuck") 9 | (include "./modules/space.yuck") 10 | (include "./modules/slider.yuck") 11 | (include "./modules/hover.yuck") 12 | 13 | (include "./windows/menu.yuck") 14 | (include "./windows/sink.yuck") 15 | (include "./windows/calendar.yuck") 16 | 17 | (defwidget left0 [monitor] 18 | (box 19 | :space-evenly false 20 | :halign "start" 21 | (icon :monitor "${monitor}") 22 | (workspaces0))) 23 | 24 | (defwidget left1 [monitor] 25 | (box 26 | :space-evenly false 27 | :halign "start" 28 | (icon :monitor "${monitor}") 29 | (workspaces1))) 30 | 31 | (defwidget left2 [monitor] 32 | (box 33 | :space-evenly false 34 | :halign "start" 35 | (icon :monitor "${monitor}") 36 | (workspaces2))) 37 | 38 | (defwidget center [] 39 | (box 40 | :space-evenly true 41 | :halign "center" 42 | (label :text ""))) 43 | 44 | (defwidget right [monitor] 45 | (box 46 | :space-evenly false 47 | :halign "end" 48 | (peripheral) 49 | (system) 50 | (space) 51 | (volume :monitor "${monitor}") 52 | (space) 53 | ;(clock :monitor "${monitor}"))) 54 | )) 55 | 56 | ; ---------- ; 57 | ; MAIN BAR ; 58 | ; ---------- ; 59 | 60 | (defwidget bar0 [monitor] 61 | (centerbox 62 | (left0 :monitor "${monitor}") 63 | (center) 64 | (right :monitor "${monitor}"))) 65 | 66 | (defwindow bar0 67 | :monitor 0 68 | :geometry (geometry :x "0%" 69 | :y "-20px" 70 | :width "99%" 71 | :height "20px" 72 | :anchor "top center") 73 | :stacking "bg" 74 | :exclusive false 75 | (bar0 :monitor "1")) 76 | 77 | ; ---------- ; 78 | ; SECOND BAR ; 79 | ; ---------- ; 80 | 81 | (defwidget bar1 [monitor] 82 | (centerbox 83 | (left1 :monitor "${monitor}") 84 | (center) 85 | (right :monitor "${monitor}"))) 86 | 87 | (defwindow bar1 88 | :monitor 1 89 | :geometry (geometry :x "0%" 90 | :y "-20px" 91 | :width "99%" 92 | :height "20px" 93 | :anchor "top center") 94 | :stacking "bg" 95 | :exclusive false 96 | (bar1 :monitor "0")) 97 | 98 | ; ---------- ; 99 | ; THIRD BAR ; 100 | ; ---------- ; 101 | 102 | (defwidget bar2 [monitor] 103 | (centerbox 104 | (left2 :monitor "${monitor}") 105 | (center) 106 | (right :monitor "${monitor}"))) 107 | 108 | (defwindow bar2 109 | :monitor 2 110 | :geometry (geometry :x "0%" 111 | :y "-20px" 112 | :width "99%" 113 | :height "20px" 114 | :anchor "top center") 115 | :stacking "bg" 116 | :exclusive false 117 | (bar2 :monitor "2")) 118 | -------------------------------------------------------------------------------- /modules/programs/eww/modules/clock.yuck: -------------------------------------------------------------------------------- 1 | (defvar date false) 2 | 3 | (defwidget clock [monitor] 4 | (eventbox 5 | :onhover "${EWW_CMD} update date=true" 6 | :onhoverlost "${EWW_CMD} update date=false" 7 | (overlay 8 | :class "module" 9 | (box 10 | :space-evenly false 11 | :class "text" 12 | (label 13 | :text {formattime(EWW_TIME, "%H")} 14 | :style {date ? "color: rgba(0,0,0,0); text-shadow: none;" : ""} 15 | :class "hour") 16 | (label 17 | :style {date ? "color: rgba(0,0,0,0); text-shadow: none;" : ""} 18 | :text ":") 19 | (label 20 | :text {formattime(EWW_TIME, "%M")} 21 | :style {date ? "color: rgba(0,0,0,0); text-shadow: none;" : ""} 22 | :class "minute")) 23 | (revealer 24 | :reveal date 25 | :transition "crossfade" 26 | (button 27 | :class "date text" 28 | :onclick "${EWW_CMD} open --toggle calendar --screen ${monitor}" 29 | {formattime(EWW_TIME, "%d/%m")}))))) 30 | -------------------------------------------------------------------------------- /modules/programs/eww/modules/hover.yuck: -------------------------------------------------------------------------------- 1 | (defwidget hover [window] 2 | (eventbox :onhoverlost "${EWW_CMD} open --toggle ${window}" 3 | (children))) 4 | -------------------------------------------------------------------------------- /modules/programs/eww/modules/icon.yuck: -------------------------------------------------------------------------------- 1 | (defwidget icon [monitor] 2 | (eventbox 3 | (box :space-evenly "false" 4 | :orientation "h" 5 | (eventbox :onclick "${EWW_CMD} open --toggle menu --screen ${monitor}" 6 | (label :text "" 7 | :style "font-size:20; padding-right: 10px; color: LightSkyBlue;"))))) 8 | -------------------------------------------------------------------------------- /modules/programs/eww/modules/peripheral.yuck: -------------------------------------------------------------------------------- 1 | (defpoll peripheral :interval "15s" "$HOME/.config/eww/scripts/peripheral 'hidpp_battery_*' '󰍽' \ 2 | 'hid-dc:2c:26:36:79:9b-battery' '󰌌' \ 3 | '*e8:47:3a:05:c0:2b' '󰊴'") 4 | 5 | (defwidget peripheral [] 6 | (box :orientation "h" 7 | :space-evenly "true" 8 | (label :halign "center" 9 | :text "${peripheral}" 10 | :style "padding-right:60px;"))) 11 | -------------------------------------------------------------------------------- /modules/programs/eww/modules/slider.yuck: -------------------------------------------------------------------------------- 1 | (defwidget metric [label value onchange] 2 | (box :orientation "h" 3 | :class "metric" 4 | :space-evenly false 5 | (box :class "label" label) 6 | (scale :min 0 7 | :max 101 8 | :active {onchange != ""} 9 | :value value 10 | :onchange onchange))) 11 | -------------------------------------------------------------------------------- /modules/programs/eww/modules/space.yuck: -------------------------------------------------------------------------------- 1 | (defwidget space [] 2 | (box 3 | :class "space" 4 | :orientation "h" 5 | :space-evenly "true")) 6 | -------------------------------------------------------------------------------- /modules/programs/eww/modules/system.yuck: -------------------------------------------------------------------------------- 1 | (defwidget system [] 2 | (box :class "sys_win" 3 | :orientation "h" 4 | :space-evenly "true" 5 | (label :class "cpu_perc" 6 | :halign "center" 7 | :text "${round(EWW_CPU.avg,0)}%  ") 8 | (label :class "mem_perc" 9 | :halign "center" 10 | :text "${round(EWW_RAM.used_mem_perc,0)}% ") 11 | (label :class "batt_perc ${EWW_BATTERY.total_avg >20 ? '' : 'low'}" 12 | :halign "center" 13 | :text "${round(EWW_BATTERY.total_avg,0)}%"))) 14 | -------------------------------------------------------------------------------- /modules/programs/eww/modules/volume.yuck: -------------------------------------------------------------------------------- 1 | (defpoll volume :interval "2s" "amixer get Master | tail -n1 | awk -F ' ' '{print $5}' | tr -d '[%]'") 2 | (defpoll volume_icon :interval "2s" "$HOME/.config/eww/scripts/sink") 3 | 4 | (defwidget volume [monitor] 5 | (eventbox 6 | (box :space-evenly "false" 7 | :orientation "h" 8 | :spacing "3" 9 | (metric :label "${volume}%" 10 | :value volume 11 | :onchange "amixer sset Master {}%") 12 | (eventbox :onclick "${EWW_CMD} open --toggle audio_menu --screen ${monitor}" 13 | :onmiddleclick "exec pavucontrol &" 14 | "${volume_icon}")))) 15 | -------------------------------------------------------------------------------- /modules/programs/eww/modules/workspace.yuck: -------------------------------------------------------------------------------- 1 | (deflisten workspace0 2 | "scripts/workspace 0") 3 | (defwidget workspaces0 [] 4 | (literal :content workspace0)) 5 | 6 | (deflisten workspace1 7 | "scripts/workspace 1") 8 | (defwidget workspaces1 [] 9 | (literal :content workspace1)) 10 | 11 | (deflisten workspace2 12 | "scripts/workspace 2") 13 | (defwidget workspaces2 [] 14 | (literal :content workspace2)) 15 | -------------------------------------------------------------------------------- /modules/programs/eww/scripts/eww: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | MON=$(hyprctl monitors | grep ID | wc -l) 4 | 5 | eww daemon 6 | 7 | case $MON in 8 | 1) eww open bar0;; 9 | 2) eww open-many bar0 bar1;; 10 | 3) eww open-many bar0 bar1 bar2;; 11 | esac 12 | -------------------------------------------------------------------------------- /modules/programs/eww/scripts/get-audio-devices: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | pactl list short sinks | while read -r line 4 | do 5 | echo "$line" | awk '{ print $2 }' 6 | done 7 | -------------------------------------------------------------------------------- /modules/programs/eww/scripts/peripheral: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | args=( "$@" ) 4 | i=0 5 | 6 | get_battery() { 7 | BATT=$(cat /sys/class/power_supply/$1/capacity) 8 | STAT=$(cat /sys/class/power_supply/$1/status) 9 | 10 | case "$STAT" in 11 | "Charging" ) BATTERY="$BATTERY $2  $BATT%";; 12 | "Full" ) BATTERY="$BATTERY $2  Full";; 13 | "Discharging" ) BATTERY="$BATTERY $2 $BATT%";; 14 | * ) echo ""; 15 | esac 16 | } 17 | 18 | while [ $i -lt ${#args[@]} ]; do 19 | if [ $(($i % 2)) -eq 0 ]; then 20 | get_battery "${args[i]}" "${args[i+1]}" 21 | i=$(($i + 1)) 22 | continue 23 | fi 24 | i=$(($i + 1)) 25 | done 26 | 27 | echo "$BATTERY" 28 | -------------------------------------------------------------------------------- /modules/programs/eww/scripts/set-audio-device: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SINK_NAME="$1" 4 | 5 | pactl list short sinks | grep "$SINK_NAME" | while read -r line 6 | do 7 | SINK_ID=$(echo "$line" | awk '{ print $1 }') 8 | pactl set-default-sink "$SINK_ID" 9 | done 10 | -------------------------------------------------------------------------------- /modules/programs/eww/scripts/sink: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SINK=$(pactl info | grep 'Default Sink' | cut -d':' -f 2) 4 | SINK=${SINK// /} 5 | 6 | HEAD=$(eww get headphones) 7 | SPEAK=$(eww get speaker) 8 | 9 | case "$SINK" in 10 | "$HEAD" ) printf "󰋋";; 11 | "$SPEAK" ) printf "󰓃";; 12 | * ) printf "";; 13 | esac 14 | -------------------------------------------------------------------------------- /modules/programs/eww/scripts/workspace: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ws=(1 2 3 4 5 6 7 8 9) 4 | 5 | workspaces() { 6 | unset -v \ 7 | o1 o2 o3 o4 o5 o6 o7 o8 o9 \ 8 | f1 f2 f3 f4 f5 f6 f7 f8 f9 9 | 10 | # occupied workspaces 11 | ows="$(hyprctl workspaces -j | jq '.[] | del(select(.id == -99)) | .id')" 12 | 13 | for num in $ows; do 14 | export o"$num"="$num" 15 | done 16 | 17 | # focused workspaces 18 | act="$1" 19 | num="$(hyprctl monitors -j | jq --argjson arg "$act" '.[] | select(.id == $arg).activeWorkspace.id')" 20 | export f"$num"="$num" 21 | 22 | # monitors 23 | mon="$(hyprctl monitors | grep ID | wc -l)" 24 | 25 | 26 | eb="(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace\" \ 27 | (box :class \"workspace\" :orientation \"h\" :space-evenly \"false\"" 28 | wsm1="(button :onclick \"hyprctl dispatch workspace 1\" :class \"w0$o1$f1\" \"${ws[0]}\") \ 29 | (button :onclick \"hyprctl dispatch workspace 2\" :class \"w0$o2$f2\" \"${ws[1]}\") \ 30 | (button :onclick \"hyprctl dispatch workspace 3\" :class \"w0$o3$f3\" \"${ws[2]}\") \ 31 | (button :onclick \"hyprctl dispatch workspace 4\" :class \"w0$o4$f4\" \"${ws[3]}\")" 32 | wsm2="(button :onclick \"hyprctl dispatch workspace 5\" :class \"w0$o5$f5\" \"${ws[4]}\") \ 33 | (button :onclick \"hyprctl dispatch workspace 6\" :class \"w0$o6$f6\" \"${ws[5]}\") \ 34 | (button :onclick \"hyprctl dispatch workspace 7\" :class \"w0$o7$f7\" \"${ws[6]}\") \ 35 | (button :onclick \"hyprctl dispatch workspace 8\" :class \"w0$o8$f8\" \"${ws[7]}\")" 36 | #wsm3="(button :onclick \"hyprctl dispatch workspace 9\" :class \"w0$o9$f9\" \"${ws[8]}\")" 37 | 38 | 39 | # set workspaces depending on how many active monitors 40 | if [ "$mon" -eq "1" ]; then 41 | echo "$eb$wsp1$wsp2))" 42 | elif [ "$mon" -gt "1" ]; then 43 | case $1 in 44 | 2) echo "$eb$wsm3))";; 45 | 1) echo "$eb$wsm2))";; 46 | 0) echo "$eb$wsm1))";; 47 | *) echo "";; 48 | esac 49 | fi 50 | } 51 | 52 | workspaces $1 53 | socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | while read -r; do 54 | workspaces $1 55 | done 56 | -------------------------------------------------------------------------------- /modules/programs/eww/var.yuck: -------------------------------------------------------------------------------- 1 | (defvar headphones "alsa_output.pci-0000_00_1f.3.analog-stereo") 2 | (defvar speaker "bluez_output.9F_55_3B_F4_A5_70.1") 3 | ;peripherals in /eww/modules/peripheral.yuck 4 | -------------------------------------------------------------------------------- /modules/programs/eww/windows/calendar.yuck: -------------------------------------------------------------------------------- 1 | (defwindow calendar 2 | :geometry (geometry :x "0%" 3 | :y "0%" 4 | :anchor "top right" 5 | :width "0px" 6 | :height "0px") 7 | (hover :window "calendar" 8 | (cal))) 9 | 10 | (defwidget cal [] 11 | (box 12 | :class "cal text" 13 | (calendar))) 14 | -------------------------------------------------------------------------------- /modules/programs/eww/windows/menu.yuck: -------------------------------------------------------------------------------- 1 | (defwindow menu 2 | :exclusive "false" 3 | :stacking "overlay" 4 | :focusable false 5 | :geometry (geometry :anchor "top left") 6 | (hover :window "menu" 7 | (menu))) 8 | 9 | (defwidget menu [] 10 | (box :class "parent" 11 | :space-evenly "false" 12 | :orientation "v" 13 | (box :class "body" 14 | :space-evenly "false" 15 | :orientation "v" 16 | (button :class "button" 17 | :vexpand "false" 18 | :onclick "${EWW_CMD} open --toggle menu && exec hyprctl dispatch exit" 19 | (label :text "󰍃")) 20 | (button :class "button" 21 | :vexpand "false" 22 | :onclick "${EWW_CMD} open --toggle menu && exec systemctl suspend" 23 | (label :text "󰒲")) 24 | (button :class "button" 25 | :vexpand "false" 26 | :onclick "exec systemctl reboot" 27 | (label :text "")) 28 | (button :class "button" 29 | :hexpand "false" 30 | :onclick "poweroff" 31 | (label :text "⏻"))))) 32 | -------------------------------------------------------------------------------- /modules/programs/eww/windows/sink.yuck: -------------------------------------------------------------------------------- 1 | ;; use scripts/get-audio-devices and add to var.yuck 2 | 3 | (defwindow audio_menu 4 | :exclusive "false" 5 | :stacking "overlay" 6 | :focusable false 7 | :geometry (geometry :anchor "top right") 8 | (hover :window "audio_menu" 9 | (audio_menu))) 10 | 11 | (defwidget audio_menu [] 12 | (box :class "parent" 13 | :space-evenly "false" 14 | :orientation "v" 15 | (box :class "header" 16 | :space-evenly "false" 17 | (label :text "Audio Devices" 18 | :class "title") 19 | (button :class "exit" 20 | :onclick "${EWW_CMD} open --toggle audio_menu" 21 | (label :text " "))) 22 | (box :class "body" 23 | :space-evenly "false" 24 | :orientation "v" 25 | (button :class "audio_button" 26 | :hexpand "false" 27 | :onclick "scripts/set-audio-device ${headphones}" 28 | (label :text "󰋋 Headphones")) 29 | (button :class "audio_button" 30 | :vexpand "false" 31 | :onclick "scripts/set-audio-device ${speaker}" 32 | (label :text "󰓃 Speakers"))))) 33 | -------------------------------------------------------------------------------- /modules/programs/flatpak.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Flatpak 3 | # Janky way of declaring all packages 4 | # Might cause issues on new system installs 5 | # Only use when you know what you're doing 6 | # 7 | 8 | { config, lib, pkgs, vars, ... }: 9 | 10 | with lib; 11 | { 12 | options = { 13 | flatpak = { 14 | enable = mkOption { 15 | type = types.bool; 16 | default = false; 17 | }; 18 | extraPackages = mkOption { 19 | type = types.listOf types.str; 20 | default = [ ]; 21 | }; 22 | }; 23 | }; 24 | 25 | config = mkIf (config.flatpak.enable) 26 | { 27 | xdg.portal.enable = true; 28 | xdg.portal.config.common.default = "*"; 29 | xdg.portal.extraPortals = mkIf (config.wlwm.enable || config.x11wm.enable) [ 30 | pkgs.xdg-desktop-portal-gtk 31 | ]; 32 | 33 | fonts.fontDir.enable = true; 34 | 35 | services.flatpak.enable = true; 36 | 37 | system.activationScripts = 38 | let 39 | extraPackages = concatStringsSep " " config.flatpak.extraPackages; 40 | in 41 | mkIf (config.flatpak.extraPackages != [ ]) 42 | { 43 | flatpak.text = 44 | '' 45 | flatpaks=( 46 | ${extraPackages} 47 | ) 48 | 49 | ${pkgs.flatpak}/bin/flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo 50 | 51 | # for package in ''${flatpaks[*]}; do 52 | 53 | for package in ''${flatpaks[@]}; do 54 | if ! ${pkgs.flatpak}/bin/flatpak list --app | grep -q "$package"; then 55 | ${pkgs.flatpak}/bin/flatpak install -y flathub $package 56 | fi 57 | done 58 | 59 | installed=($(${pkgs.flatpak}/bin/flatpak list --app --columns=application | tail -n +1)) 60 | 61 | for remove in ''${installed[@]}; do 62 | found=false 63 | for package in ''${flatpaks[@]}; do 64 | if [[ "$remove" == "$package"* ]]; then 65 | found=true 66 | break 67 | fi 68 | done 69 | 70 | if [[ "$found" == false ]]; then 71 | ${pkgs.flatpak}/bin/flatpak uninstall -y "$remove" 72 | ${pkgs.flatpak}/bin/flatpak uninstall -y --unused 73 | fi 74 | done 75 | 76 | /run/wrappers/bin/su - ${vars.user} -c "${pkgs.flatpak}/bin/flatpak override --user --filesystem=host" 77 | ''; 78 | }; 79 | }; 80 | } 81 | -------------------------------------------------------------------------------- /modules/programs/games.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Gaming: Steam + MC + Emulation 3 | # Do not forget to enable Steam play for all title in the settings menu 4 | # When connecting a controller via bluetooth, it might error out. To fix this, remove device, pair - connect - trust, wait for auto disconnect, sudo rmmod btusb, sudo modprobe btusb, pair again. 5 | # 6 | 7 | { config, pkgs, nur, lib, vars, ... }: 8 | 9 | let 10 | # PCSX2 Wrapper to run under X11 11 | pcsx2 = pkgs.pcsx2.overrideAttrs (old: { 12 | nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.makeWrapper ]; 13 | postFixup = '' 14 | wrapProgram $out/bin/pcsx2 \ 15 | --set GDK_BACKEND x11 16 | ''; 17 | }); 18 | in 19 | { 20 | users.groups.plugdev.members = [ "root" "${vars.user}" ]; 21 | services.udev.extraRules = '' 22 | KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev" 23 | ''; # Group and udev rule needed to have access to the controller's gyro 24 | 25 | #hardware.new-lg4ff.enable = true; 26 | hardware.bluetooth = { 27 | enable = true; 28 | settings = { 29 | # Wireless controller 30 | General = { 31 | AutoEnable = true; 32 | ControllerMode = "bredr"; 33 | }; 34 | }; 35 | }; 36 | 37 | environment.systemPackages = [ 38 | # config.nur.repos.c0deaddict.oversteer # Steering Wheel Configuration 39 | # pkgs.heroic # Game Launcher 40 | # pkgs.lutris # Game Launcher 41 | # pkgs.prismlauncher # MC Launcher 42 | # pkgs.retroarchFull # Emulator 43 | pkgs.steam # Game Launcher 44 | # pcsx2 # Emulator 45 | ]; 46 | 47 | programs = { 48 | steam = { 49 | enable = true; 50 | # remotePlay.openFirewall = true; 51 | }; 52 | gamemode.enable = true; 53 | # Better Gaming Performance 54 | # Steam: Right-click game - Properties - Launch options: gamemoderun %command% 55 | # Lutris: General Preferences - Enable Feral GameMode 56 | # - Global options - Add Environment Variables: LD_PRELOAD=/nix/store/*-gamemode-*-lib/lib/libgamemodeauto.so 57 | }; 58 | 59 | nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ 60 | "steam" 61 | "steam-original" 62 | "steam-runtime" 63 | ]; 64 | } 65 | -------------------------------------------------------------------------------- /modules/programs/kitty.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Terminal Emulator 3 | # 4 | 5 | { pkgs, vars, ... }: 6 | 7 | let 8 | colors = import ../theming/colors.nix; 9 | in 10 | { 11 | environment = { 12 | systemPackages = with pkgs; [ 13 | kitty 14 | ]; 15 | }; 16 | 17 | programs.ssh.extraConfig = '' 18 | Host * 19 | SetEnv TERM=xterm-256color 20 | ''; 21 | 22 | home-manager.users.${vars.user} = { 23 | programs = { 24 | kitty = { 25 | enable = true; 26 | themeFile = "Afterglow"; 27 | settings = { 28 | confirm_os_window_close = 0; 29 | enable_audio_bell = "no"; 30 | resize_debounce_time = "0"; 31 | background = "#${colors.scheme.default.hex.bg}"; 32 | font_family = "FiraCode Nerd Font"; 33 | }; 34 | }; 35 | }; 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /modules/programs/obs.nix: -------------------------------------------------------------------------------- 1 | { pkgs, vars, ... }: 2 | 3 | { 4 | home-manager.users.${vars.user} = { 5 | programs.obs-studio = { 6 | enable = true; 7 | plugins = with pkgs.obs-studio-plugins; [ 8 | #advanced-scene-switcher 9 | ]; 10 | }; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /modules/programs/rofi.nix: -------------------------------------------------------------------------------- 1 | # 2 | # System Menu 3 | # 4 | 5 | { config, lib, pkgs, vars, ... }: 6 | 7 | let 8 | inherit (config.home-manager.users.${vars.user}.lib.formats.rasi) mkLiteral; 9 | colors = import ../theming/colors.nix; 10 | in 11 | { 12 | config = lib.mkIf (config.x11wm.enable) { 13 | home-manager.users.${vars.user} = { 14 | home = { 15 | packages = with pkgs; [ 16 | rofi-power-menu 17 | ]; 18 | }; 19 | 20 | programs = { 21 | rofi = { 22 | enable = true; 23 | terminal = "${pkgs.${vars.terminal}}/bin/${vars.terminal}"; 24 | location = "center"; 25 | font = "FiraCode Nerd Font Mono 11"; 26 | theme = with colors.scheme.doom; { 27 | "*" = { 28 | bg0 = mkLiteral "#${bg}"; 29 | bg1 = mkLiteral "#414868"; 30 | fg0 = mkLiteral "#${text}"; 31 | fg1 = mkLiteral "#${text-alt}"; 32 | 33 | background-color = mkLiteral "transparent"; 34 | text-color = mkLiteral "@fg0"; 35 | 36 | margin = 0; 37 | padding = 0; 38 | spacing = 0; 39 | }; 40 | 41 | "element-icon, element-text, scrollbar" = { 42 | cursor = mkLiteral "pointer"; 43 | }; 44 | 45 | "window" = { 46 | location = mkLiteral "northwest"; 47 | width = mkLiteral "280px"; 48 | x-offset = mkLiteral "8px"; 49 | y-offset = mkLiteral "34px"; 50 | 51 | background-color = mkLiteral "@bg0"; 52 | border = mkLiteral "1px"; 53 | border-color = mkLiteral "@bg1"; 54 | border-radius = mkLiteral "6px"; 55 | }; 56 | 57 | "inputbar" = { 58 | spacing = mkLiteral "8px"; 59 | padding = mkLiteral "4px 8px"; 60 | children = mkLiteral "[ entry ]"; 61 | background-color = mkLiteral "@bg0"; 62 | }; 63 | 64 | "entry, element-icon, element-text" = { 65 | vertical-align = mkLiteral "0.5"; 66 | }; 67 | 68 | "textbox" = { 69 | padding = mkLiteral "4px 8px"; 70 | background-color = mkLiteral "@bg0"; 71 | }; 72 | 73 | "listview" = { 74 | padding = mkLiteral "4px 0px"; 75 | lines = 6; 76 | columns = 1; 77 | scrollbar = true; 78 | }; 79 | 80 | "element" = { 81 | padding = mkLiteral "4px 8px"; 82 | spacing = mkLiteral "8px"; 83 | }; 84 | 85 | "element normal urgent" = { 86 | text-color = mkLiteral "@fg1"; 87 | }; 88 | 89 | "element normal active" = { 90 | text-color = mkLiteral "@fg1"; 91 | }; 92 | 93 | "element selected" = { 94 | text-color = mkLiteral "@bg0"; #1 95 | background-color = mkLiteral "@fg1"; 96 | }; 97 | 98 | "element selected urgent" = { 99 | background-color = mkLiteral "@fg1"; 100 | }; 101 | 102 | "element-icon" = { 103 | size = mkLiteral "0.8em"; 104 | }; 105 | 106 | "element-text" = { 107 | text-color = mkLiteral "inherit"; 108 | }; 109 | 110 | "scrollbar" = { 111 | handle-width = mkLiteral "4px"; 112 | handle-color = mkLiteral "@fg1"; 113 | padding = mkLiteral "0 4px"; 114 | }; 115 | }; 116 | }; 117 | }; 118 | }; 119 | }; 120 | } 121 | -------------------------------------------------------------------------------- /modules/programs/thunar.nix: -------------------------------------------------------------------------------- 1 | # 2 | # File Browser 3 | # 4 | 5 | { pkgs, ... }: 6 | 7 | { 8 | programs = { 9 | thunar = { 10 | enable = true; 11 | plugins = with pkgs.xfce; [ 12 | thunar-archive-plugin 13 | thunar-volman 14 | thunar-media-tags-plugin 15 | ]; 16 | }; 17 | }; 18 | 19 | services = { 20 | tumbler.enable = true; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /modules/programs/wofi.nix: -------------------------------------------------------------------------------- 1 | # 2 | # System Menu 3 | # 4 | 5 | { config, lib, pkgs, vars, ... }: 6 | 7 | let 8 | colors = import ../theming/colors.nix; 9 | in 10 | { 11 | config = lib.mkIf (config.wlwm.enable) { 12 | home-manager.users.${vars.user} = { 13 | home = { 14 | packages = with pkgs; [ 15 | wofi 16 | ]; 17 | }; 18 | 19 | home.file = with colors.scheme.default.hex; { 20 | ".config/wofi/config" = { 21 | text = '' 22 | width=100% 23 | height=27 24 | xoffset=0 25 | yoffset=-27 26 | location=1 27 | prompt=Search... 28 | filter_rate=100 29 | allow_markup=false 30 | no_actions=true 31 | halign=fill 32 | orientation=horizontal 33 | content_halign=fill 34 | insensitive=true 35 | allow_images=true 36 | image_size=10 37 | hide_scroll=true 38 | ''; 39 | }; 40 | ".config/wofi/style.css" = { 41 | text = '' 42 | window { 43 | /*background-color: #${bg};*/ 44 | background-color: rgba(0, 0, 0, 0.8); 45 | } 46 | 47 | #input { 48 | all: unset; 49 | border: none; 50 | color: #${text}; 51 | background-color: #${bg}; 52 | padding-left: 5px; 53 | } 54 | 55 | #outer-box { 56 | border: none; 57 | border-bottom: 1px solid #${active}; 58 | } 59 | 60 | #text:selected { 61 | /*color: rgba(255, 255, 255, 0.8);*/ 62 | color: rgba(0, 0, 0, 0.8); 63 | } 64 | 65 | #entry { 66 | color: #${text}; 67 | padding-right: 10px; 68 | } 69 | 70 | #entry:selected { 71 | all: unset; 72 | border-radius: 0px; 73 | background-color: #${active}; 74 | padding-right: 10px; 75 | } 76 | 77 | #img { 78 | padding-right: 5px; 79 | padding-left: 10px; 80 | } 81 | ''; 82 | }; 83 | ".config/wofi/power.sh" = { 84 | executable = true; 85 | text = '' 86 | #!/bin/sh 87 | 88 | entries="󰍃 Logout\n󰒲 Suspend\n Reboot\n⏻ Shutdown" 89 | 90 | selected=$(echo -e $entries|wofi --dmenu --cache-file /dev/null | awk '{print tolower($2)}') 91 | 92 | case $selected in 93 | logout) 94 | exec hyprctl dispatch exit;; 95 | suspend) 96 | exec systemctl suspend;; 97 | reboot) 98 | exec systemctl reboot;; 99 | shutdown) 100 | exec systemctl poweroff -i;; 101 | esac 102 | ''; 103 | }; 104 | }; 105 | }; 106 | }; 107 | } 108 | -------------------------------------------------------------------------------- /modules/services/avahi.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Network Discoverability 3 | # 4 | 5 | { 6 | services = { 7 | avahi = { 8 | enable = true; 9 | nssmdns4 = true; 10 | publish = { 11 | enable = true; 12 | addresses = true; 13 | userServices = true; 14 | }; 15 | }; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /modules/services/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Services 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ └─ configuration.nix 7 | # └─ ./modules 8 | # └─ ./services 9 | # └─ default.nix * 10 | # └─ ... 11 | # 12 | 13 | [ 14 | ./avahi.nix 15 | # ./dunst.nix 16 | ./flameshot.nix 17 | ./picom.nix 18 | ./polybar.nix 19 | ./samba.nix 20 | ./swaync.nix 21 | ./sxhkd.nix 22 | ./udiskie.nix 23 | ] 24 | -------------------------------------------------------------------------------- /modules/services/dunst.nix: -------------------------------------------------------------------------------- 1 | # 2 | # System Notifications 3 | # 4 | 5 | { config, lib, pkgs, vars, ... }: 6 | 7 | let 8 | colors = import ../theming/colors.nix; 9 | in 10 | { 11 | config = lib.mkIf (config.x11wm.enable) { 12 | home-manager.users.${vars.user} = { 13 | home.packages = [ pkgs.libnotify ]; 14 | services.dunst = { 15 | enable = true; 16 | iconTheme = { 17 | name = "Papirus Dark"; 18 | package = pkgs.papirus-icon-theme; 19 | size = "16x16"; 20 | }; 21 | settings = with colors.scheme.doom; { 22 | global = { 23 | monitor = 0; 24 | # geometry [{width}x{height}][+/-{x}+/-{y}] 25 | # geometry = "600x50-50+65"; 26 | width = 300; 27 | height = 200; 28 | origin = "top-right"; 29 | offset = "50x50"; 30 | shrink = "yes"; 31 | transparency = 10; 32 | padding = 16; 33 | horizontal_padding = 16; 34 | frame_width = 3; 35 | frame_color = "#${bg}"; 36 | separator_color = "frame"; 37 | font = "FiraCode Nerd Font 10"; 38 | line_height = 4; 39 | idle_threshold = 120; 40 | markup = "full"; 41 | format = ''%s\n%b''; 42 | alignment = "left"; 43 | vertical_alignment = "center"; 44 | icon_position = "left"; 45 | word_wrap = "yes"; 46 | ignore_newline = "no"; 47 | show_indicators = "yes"; 48 | sort = true; 49 | stack_duplicates = true; 50 | # startup_notification = false; 51 | hide_duplicate_count = true; 52 | }; 53 | urgency_low = { 54 | background = "#${bg}"; 55 | foreground = "#${text}"; 56 | timeout = 4; 57 | }; 58 | urgency_normal = { 59 | background = "#${bg}"; 60 | foreground = "#${text}"; 61 | timeout = 4; 62 | }; 63 | urgency_critical = { 64 | background = "#${bg}"; 65 | foreground = "#${text}"; 66 | frame_color = "#${red}"; 67 | timeout = 10; 68 | }; 69 | }; 70 | }; 71 | xdg.dataFile."dbus-1/services/org.knopwob.dunst.service".source = "${pkgs.dunst}/share/dbus-1/services/org.knopwob.dunst.service"; 72 | }; 73 | }; 74 | } 75 | -------------------------------------------------------------------------------- /modules/services/flameshot.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Screenshots 3 | # 4 | 5 | { config, lib, vars, ... }: 6 | 7 | { 8 | config = lib.mkIf (config.services.xserver.enable) { 9 | home-manager.users.${vars.user} = { 10 | services.flameshot = { 11 | enable = true; 12 | settings = { 13 | General = { 14 | savePath = "/home/${vars.user}/"; 15 | saveAsFileExtension = ".png"; 16 | uiColor = "#2d0096"; 17 | showHelp = "false"; 18 | disabledTrayIcon = "true"; 19 | }; 20 | }; 21 | }; 22 | }; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /modules/services/media.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Media Services: Plex, Torrenting and Automation 3 | # 4 | 5 | { 6 | services = { 7 | radarr = { 8 | enable = true; 9 | user = "root"; 10 | group = "users"; 11 | openFirewall = true; 12 | }; 13 | sonarr = { 14 | enable = true; 15 | user = "root"; 16 | group = "users"; 17 | openFirewall = true; 18 | }; 19 | bazarr = { 20 | enable = true; 21 | user = "root"; 22 | group = "users"; 23 | openFirewall = true; 24 | }; 25 | prowlarr = { 26 | enable = true; 27 | openFirewall = true; 28 | }; 29 | deluge = { 30 | enable = true; 31 | web.enable = true; 32 | user = "root"; 33 | group = "users"; 34 | openFirewall = true; 35 | web.openFirewall = true; 36 | }; 37 | }; 38 | } 39 | 40 | # literally can't be bothered anymore with user permissions. 41 | # So everything with root, add permissions 775 with group users in radarr and sonarr 42 | # (Under Media Management - Show Advanced | Under Subtitles) 43 | # Radarr & Sonarr: chmod 775 44 | # Bazarr: chmod 664 45 | # Prowlarr should just work 46 | # Deluge: 47 | # Connection Manager: localhost:58846 48 | # Preferences: Change download folder and enable Plugins-label 49 | -------------------------------------------------------------------------------- /modules/services/picom.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Compositor 3 | # 4 | 5 | { config, lib, pkgs, vars, ... }: 6 | 7 | { 8 | config = lib.mkIf (config.bspwm.enable) { 9 | home-manager.users.${vars.user} = { 10 | services.picom = { 11 | enable = true; 12 | # package = pkgs.picom.overrideAttrs (o: { 13 | # src = pkgs.fetchFromGitHub { 14 | # # repo = "picom"; 15 | # # owner = "pijulius"; 16 | # # rev = "982bb43e5d4116f1a37a0bde01c9bda0b88705b9"; 17 | # # sha256 = "YiuLScDV9UfgI1MiYRtjgRkJ0VuA1TExATA2nJSJMhM="; 18 | # repo = "picom"; 19 | # owner = "jonaburg"; 20 | # rev = "e3c19cd7d1108d114552267f302548c113278d45"; 21 | # sha256 = "4voCAYd0fzJHQjJo4x3RoWz5l3JJbRvgIXn1Kg6nz6Y="; 22 | # }; 23 | # }); 24 | 25 | backend = "glx"; 26 | vSync = true; 27 | 28 | # activeOpacity = 0.93; # Transparency 29 | # inactiveOpacity = 0.93; 30 | # menuOpacity = 0.93; 31 | 32 | shadow = false; # Shadows 33 | shadowOpacity = 0.75; 34 | # fade = true; 35 | # fadeDelta = 10; 36 | opacityRules = [ 37 | #"100:name = 'Picture in picture'" 38 | #"100:name = 'Picture-in-Picture'" 39 | #"85:class_i ?= 'rofi'" 40 | "95:class_i *= 'discord'" 41 | "95:class_i *= 'emacs'" 42 | "95:class_i *= 'kitty'" 43 | #"100:fullscreen" 44 | ]; # Find with $ xprop | grep "WM_CLASS" 45 | 46 | settings = { 47 | daemon = true; 48 | use-damage = false; # Fixes Flickering 49 | resize-damage = 1; 50 | refresh-rate = 0; 51 | corner-radius = 5; 52 | round-borders = 5; 53 | 54 | # Animations Pijulius 55 | # animations = true; 56 | # animation-window-mass = 0.5; 57 | # animation-for-open-window = "zoom"; 58 | # animation-stiffness = 350; 59 | # animation-clamping = false; 60 | # fade-out-step = 1; 61 | 62 | # Animations Jonaburg 63 | # transition-length = 150; 64 | # transition-pow-x = 0.5; 65 | # transition-pow-y = 0.5; 66 | # transition-pow-w = 0.5; 67 | # transition-pow-h = 0.5; 68 | # size-transition = true; 69 | 70 | detect-rounded-corners = true; 71 | detect-client-opacity = false; 72 | detect-transient = true; 73 | detect-client-leader = false; 74 | mark-wmwim-focused = true; 75 | mark-ovredir-focues = true; 76 | unredir-if-possible = true; 77 | glx-no-stencil = true; 78 | glx-no-rebind-pixmap = true; 79 | }; 80 | }; 81 | }; 82 | }; 83 | } 84 | -------------------------------------------------------------------------------- /modules/services/redshift.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Screen Temperature 3 | # 4 | 5 | { config, lib, vars, ... }: 6 | 7 | { 8 | config = lib.mkIf (config.services.xserver.enable) { 9 | home-manager.users.${vars.user} = { 10 | services = { 11 | redshift = { 12 | enable = true; 13 | temperature.night = 3000; 14 | latitude = 50.929818; 15 | longitude = 5.338297; 16 | }; 17 | }; 18 | }; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /modules/services/samba.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Network Shares 3 | # 4 | 5 | { vars, ... }: 6 | 7 | { 8 | services = { 9 | samba = { 10 | enable = true; 11 | settings = { 12 | # Set Password: $ smbpasswd -a 13 | share = { 14 | "path" = "/home/${vars.user}"; 15 | "guest ok" = "yes"; 16 | "read only" = "no"; 17 | }; 18 | }; 19 | openFirewall = true; 20 | }; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /modules/services/sxhkd.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Hotkey Daemon 3 | # 4 | 5 | { config, lib, vars, ... }: 6 | 7 | { 8 | config = lib.mkIf (config.x11wm.enable) { 9 | home-manager.users.${vars.user} = { 10 | services = { 11 | sxhkd = { 12 | enable = true; 13 | keybindings = { 14 | # Apps 15 | "super + Return" = "${vars.terminal}"; 16 | "super + space" = "rofi -show drun -show-icons"; 17 | "super + e" = "pcmanfm"; 18 | "Print" = "flameshot gui"; 19 | 20 | # Bspwm 21 | "super + {q,k}" = "bspc node -{c,k}"; 22 | "super + Escape" = "bspc quit"; 23 | "super + r" = "bspc wm -r"; 24 | 25 | # Super - Nodes 26 | "super + {_,shift +}{Left,Right,Up,Down}" = "bspc node -{f,s} {west,east,north,south}"; 27 | "super + m" = "bspc desktop -l next"; 28 | "super + {t,h,f}" = "bspc node -t '~{tiled,floating,fullscreen}'"; 29 | "super + g" = "bspc node -s biggest.window"; 30 | 31 | # Alt - Move workspaces 32 | "alt + {Left,Right}" = "bspc desktop -f {prev,next}.local"; 33 | "alt + {_,shift +}{1-9,0}" = "bspc {desktop -f,node -d} '{1-9,10}'"; 34 | "alt + shift + {Left,Right}" = "bspc node -d {prev,next}.local --follow"; 35 | 36 | # Control - Resize 37 | "control + {Left,Down,Up,Right}" = '' 38 | bspc node -z {left -20 0 || bspc node -z right -20 0, \ 39 | bottom 0 20 || bspc node -z top 0 20,\ 40 | top 0 -20 || bspc node -z bottom 0 -20,\ 41 | right 20 0 || bspc node -z left 20 0} 42 | ''; 43 | 44 | # XF86 Keys 45 | "XF86AudioMute" = "pactl list sinks | grep -q Mute:.no && pactl set-sink-mute 0 1 || pactl set-sink-mute 0 0"; 46 | "XF86AudioRaiseVolume" = "pactl -- set-sink-volume 0 +10%"; 47 | "XF86AudioLowerVolume" = "pactl -- set-sink-volume 0 -10%"; 48 | "XF86AudioMicMute" = "pactl set-source-mute 1 toggle"; 49 | "XF86MonBrightnessDown" = "light -U 5"; 50 | "XF86MonBrightnessUp" = "light -A 5"; 51 | }; 52 | }; 53 | }; 54 | }; 55 | }; 56 | } 57 | -------------------------------------------------------------------------------- /modules/services/udiskie.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Mounting tool 3 | # 4 | 5 | { vars, ... }: 6 | 7 | { 8 | home-manager.users.${vars.user} = { 9 | services = { 10 | udiskie = { 11 | enable = true; 12 | automount = true; 13 | tray = "auto"; 14 | }; 15 | }; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /modules/services/x11vnc.nix: -------------------------------------------------------------------------------- 1 | ../desktops/virtualisation/x11vnc.nix -------------------------------------------------------------------------------- /modules/shell/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Shell 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ └─ configuration.nix 7 | # └─ ./modules 8 | # └─ ./shell 9 | # ├─ default.nix * 10 | # └─ ... 11 | # 12 | 13 | [ 14 | ./git.nix 15 | ./zsh.nix 16 | ./direnv.nix 17 | ] 18 | -------------------------------------------------------------------------------- /modules/shell/direnv.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Direnv 3 | # 4 | # Create shell.nix 5 | # Create .envrc and add "use nix" 6 | # Add 'eval "$(direnv hook zsh)"' to .zshrc 7 | # 8 | 9 | { 10 | programs.direnv = { 11 | enable = true; 12 | loadInNixShell = true; 13 | nix-direnv.enable = true; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /modules/shell/git.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Git 3 | # 4 | 5 | { 6 | programs = { 7 | git = { 8 | enable = true; 9 | }; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /modules/shell/zsh.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Shell 3 | # 4 | 5 | { pkgs, vars, ... }: 6 | 7 | { 8 | users.users.${vars.user} = { 9 | shell = pkgs.zsh; 10 | }; 11 | 12 | programs = { 13 | zsh = { 14 | enable = true; 15 | autosuggestions.enable = true; 16 | syntaxHighlighting.enable = true; 17 | enableCompletion = true; 18 | histSize = 100000; 19 | 20 | ohMyZsh = { 21 | enable = true; 22 | plugins = [ "git" ]; 23 | }; 24 | 25 | shellInit = '' 26 | # Spaceship 27 | source ${pkgs.spaceship-prompt}/share/zsh/site-functions/prompt_spaceship_setup 28 | autoload -U promptinit; promptinit 29 | # Hook direnv 30 | #emulate zsh -c "$(direnv hook zsh)" 31 | 32 | #eval "$(direnv hook zsh)" 33 | ''; 34 | }; 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /modules/theming/colors.nix: -------------------------------------------------------------------------------- 1 | # 2 | # System Themes 3 | # 4 | 5 | { 6 | scheme = { 7 | default = { 8 | scheme = "One Dark Pro"; 9 | hex = { 10 | bg = "111111"; 11 | fg = "f7f7f7"; 12 | red = "e06c75"; 13 | orange = "d19a66"; 14 | yellow = "e5c07b"; 15 | green = "98c379"; 16 | cyan = "56b6c2"; 17 | blue = "61afef"; 18 | purple = "c678dd"; 19 | white = "abb2bf"; 20 | black = "282c34"; 21 | gray = "5c6370"; 22 | highlight = "e2be7d"; 23 | comment = "7f848e"; 24 | active = "f7870a"; 25 | inactive = "013864"; 26 | text = "999999"; 27 | }; 28 | rgb = { 29 | bg = "17, 17, 17"; 30 | fg = "247, 247, 247"; 31 | red = "224, 108, 118"; 32 | orange = "209, 154, 102"; 33 | yellow = "229, 192, 123"; 34 | green = "152, 195, 121"; 35 | cyan = "86, 181, 194"; 36 | blue = "97, 175, 223"; 37 | purple = "197, 120, 221"; 38 | white = "171, 178, 191"; 39 | black = "40, 44, 52"; 40 | gray = "92, 99, 112"; 41 | highlight = "226, 191, 125"; 42 | comment = "127, 132, 142"; 43 | active = "247, 135, 10"; 44 | inactive = "1, 56, 100"; 45 | text = "153, 153, 153"; 46 | }; 47 | }; 48 | 49 | onedark = { 50 | scheme = "One Dark Pro"; 51 | hex = { 52 | bg = "111111"; # 283c34 53 | fg = "abb2bf"; 54 | red = "e06c75"; 55 | orange = "d19a66"; 56 | yellow = "e5c07b"; 57 | green = "98c379"; 58 | cyan = "56b6c2"; 59 | blue = "61afef"; 60 | purple = "c678dd"; 61 | white = "abb2bf"; 62 | black = "282c34"; 63 | gray = "5c6370"; 64 | highlight = "e2be7d"; 65 | comment = "7f848e"; 66 | active = "005577"; 67 | inactive = "333333"; 68 | text = "999999"; 69 | }; 70 | rgb = { 71 | bg = "17, 17, 17"; 72 | fg = "171, 178, 191"; 73 | red = "224, 108, 118"; 74 | orange = "209, 154, 102"; 75 | yellow = "229, 192, 123"; 76 | green = "152, 195, 121"; 77 | cyan = "86, 181, 194"; 78 | blue = "97, 175, 223"; 79 | purple = "197, 120, 221"; 80 | white = "171, 178, 191"; 81 | black = "40, 44, 52"; 82 | gray = "92, 99, 112"; 83 | highlight = "226, 191, 125"; 84 | comment = "127, 132, 142"; 85 | active = "0, 85, 119"; 86 | inactive = "51, 51, 51"; 87 | text = "153, 153, 153"; 88 | }; 89 | }; 90 | 91 | doom = { 92 | scheme = "Doom One Dark"; 93 | black = "000000"; 94 | red = "ff6c6b"; 95 | orange = "da8548"; 96 | yellow = "ecbe7b"; 97 | green = "95be65"; 98 | teal = "4db5bd"; 99 | blue = "6eaafb"; 100 | dark-blue = "2257a0"; 101 | magenta = "c678dd"; 102 | violet = "a9a1e1"; 103 | cyan = "6cdcf7"; 104 | dark-cyan = "5699af"; 105 | emphasis = "50536b"; 106 | text = "dfdfdf"; 107 | text-alt = "b2b2b2"; 108 | fg = "abb2bf"; 109 | bg = "282c34"; 110 | }; 111 | 112 | dracula = { 113 | scheme = "Dracula"; 114 | base00 = "282936"; #background 115 | base01 = "3a3c4e"; 116 | base02 = "4d4f68"; 117 | base03 = "626483"; 118 | base04 = "62d6e8"; 119 | base05 = "e9e9f4"; #foreground 120 | base06 = "f1f2f8"; 121 | base07 = "f7f7fb"; 122 | base08 = "ea51b2"; 123 | base09 = "b45bcf"; 124 | base0A = "00f769"; 125 | base0B = "ebff87"; 126 | base0C = "a1efe4"; 127 | base0D = "62d6e8"; 128 | base0E = "b45bcf"; 129 | base0F = "00f769"; 130 | }; 131 | }; 132 | } 133 | -------------------------------------------------------------------------------- /modules/theming/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Theming 3 | # 4 | # flake.nix 5 | # ├─ ./hosts 6 | # │ └─ configuration.nix 7 | # └─ ./modules 8 | # └─ ./theming 9 | # ├─ default.nix * 10 | # └─ ... 11 | # 12 | 13 | [ 14 | ./theming.nix 15 | ] 16 | -------------------------------------------------------------------------------- /modules/theming/theming.nix: -------------------------------------------------------------------------------- 1 | # 2 | # GTK 3 | # 4 | 5 | { lib, config, pkgs, host, vars, ... }: 6 | 7 | { 8 | home-manager.users.${vars.user} = { 9 | home = { 10 | file.".config/wall.png".source = ./wall.png; 11 | file.".config/wall.mp4".source = ./wall.mp4; 12 | pointerCursor = { 13 | gtk.enable = true; 14 | name = "Dracula-cursors"; 15 | package = pkgs.dracula-theme; 16 | size = if host.hostName == "xps" then 26 else 16; 17 | }; 18 | }; 19 | 20 | gtk = lib.mkIf (config.gnome.enable == false) { 21 | enable = true; 22 | theme = { 23 | #name = "Dracula"; 24 | #name = "Catppuccin-Mocha-Compact-Blue-Dark"; 25 | name = "Orchis-Dark-Compact"; 26 | #package = pkgs.dracula-theme; 27 | # package = pkgs.catppuccin-gtk.override { 28 | # accents = ["blue"]; 29 | # size = "compact"; 30 | # variant = "mocha"; 31 | # }; 32 | package = pkgs.orchis-theme; 33 | }; 34 | iconTheme = { 35 | name = "Papirus-Dark"; 36 | package = pkgs.papirus-icon-theme; 37 | }; 38 | font = { 39 | name = "FiraCode Nerd Font Mono Medium"; 40 | }; 41 | }; 42 | 43 | # qt = { 44 | # enable = true; 45 | # platformTheme.name = "gtk"; 46 | # style = { 47 | # name = "adwaita-dark"; 48 | # package = pkgs.adwaita-qt; 49 | # }; 50 | # }; 51 | }; 52 | 53 | # environment.variables = { 54 | # QT_QPA_PLATFORMTHEME = "gtk2"; 55 | # }; 56 | } 57 | -------------------------------------------------------------------------------- /modules/theming/wall.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthiasBenaets/nix-config/bdbae3000fcc8bf8c19dd65f51c437de21cbc739/modules/theming/wall.mp4 -------------------------------------------------------------------------------- /modules/theming/wall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthiasBenaets/nix-config/bdbae3000fcc8bf8c19dd65f51c437de21cbc739/modules/theming/wall.png -------------------------------------------------------------------------------- /nix/default.nix: -------------------------------------------------------------------------------- 1 | # 2 | # These are the diffent profiles that can be used when using Nix on other distros. 3 | # Home-Manager is used to list and customize packages. 4 | # 5 | # flake.nix 6 | # └─ ./nix 7 | # ├─ default.nix * 8 | # └─ .nix 9 | # 10 | 11 | { inputs, nixpkgs, home-manager, nixgl, vars, ... }: 12 | 13 | let 14 | system = "x86_64-linux"; 15 | pkgs = nixpkgs.legacyPackages.${system}; 16 | in 17 | { 18 | pacman = home-manager.lib.homeManagerConfiguration { 19 | inherit pkgs; 20 | extraSpecialArgs = { inherit inputs nixgl vars; }; 21 | modules = [ 22 | ./pacman.nix 23 | { 24 | home = { 25 | username = "${vars.user}"; 26 | homeDirectory = "/home/${vars.user}"; 27 | packages = [ pkgs.home-manager ]; 28 | stateVersion = "22.05"; 29 | }; 30 | } 31 | ]; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /nix/pacman.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Nix Setup using Home-manager 3 | # 4 | # flake.nix 5 | # └─ ./nix 6 | # ├─ default.nix 7 | # └─ pacman.nix * 8 | # 9 | 10 | { inputs, pkgs, nixgl, vars, ... }: 11 | 12 | { 13 | home = { 14 | packages = [ 15 | (import nixgl { inherit pkgs; }).nixGLIntel # OpenGL for GUI apps 16 | #.nixVulkanIntel 17 | pkgs.hello 18 | ]; 19 | 20 | # file.".bash_aliases".text = '' 21 | # alias alacritty="nixGLIntel ${pkgs.alacritty}/bin/alacritty" 22 | # ''; # Aliases for package using openGL (nixGL). home.shellAliases does not work 23 | 24 | activation = { 25 | linkDesktopApplications = { 26 | # Add Packages To System Menu by updating database 27 | after = [ "writeBoundary" "createXdgUserDirectories" ]; 28 | before = [ ]; 29 | data = "sudo /usr/bin/update-desktop-database"; 30 | }; 31 | }; 32 | }; 33 | 34 | xdg = { 35 | enable = true; 36 | systemDirs.data = [ "/home/${vars.user}/.nix-profile/share" ]; 37 | }; # Add Nix Packages to XDG_DATA_DIRS 38 | 39 | nix = { 40 | settings = { 41 | auto-optimise-store = true; 42 | }; 43 | package = pkgs.nixFlakes; 44 | registry.nixpkgs.flake = inputs.nixpkgs; 45 | extraOptions = '' 46 | experimental-features = nix-command flakes 47 | keep-outputs = true 48 | keep-derivations = true 49 | ''; 50 | }; 51 | nixpkgs.config.allowUnfree = true; 52 | } 53 | -------------------------------------------------------------------------------- /rsc/Nix.svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthiasBenaets/nix-config/bdbae3000fcc8bf8c19dd65f51c437de21cbc739/rsc/Nix.svg -------------------------------------------------------------------------------- /rsc/archive/original/wofi.nix: -------------------------------------------------------------------------------- 1 | # 2 | # System Menu 3 | # 4 | 5 | { config, lib, pkgs, vars, ... }: 6 | 7 | let 8 | colors = import ../theming/colors.nix; 9 | in 10 | { 11 | config = lib.mkIf (config.wlwm.enable) { 12 | home-manager.users.${vars.user} = { 13 | home = { 14 | packages = with pkgs; [ 15 | wofi 16 | ]; 17 | }; 18 | 19 | home.file = { 20 | ".config/wofi/config" = { 21 | text = '' 22 | width=280 23 | lines=10 24 | xoffset=5 25 | yoffset=5 26 | location=1 27 | prompt=Search... 28 | filter_rate=100 29 | allow_markup=false 30 | no_actions=true 31 | halign=fill 32 | orientation=vertical 33 | content_halign=fill 34 | insensitive=true 35 | allow_images=true 36 | image_size=20 37 | hide_scroll=true 38 | ''; 39 | }; 40 | ".config/wofi/style.css" = with colors.scheme.doom; { 41 | text = '' 42 | window { 43 | margin: 0px; 44 | background-color: #${bg}; 45 | } 46 | 47 | #input { 48 | all: unset; 49 | min-height: 20px; 50 | padding: 4px 10px; 51 | margin: 4px; 52 | border: none; 53 | color: #dfdfdf; 54 | font-weight: bold; 55 | background-color: #${bg}; 56 | outline: #dfdfdf; 57 | } 58 | 59 | #inner-box { 60 | font-weight: bold; 61 | border-radius: 0px; 62 | } 63 | 64 | #outer-box { 65 | margin: 0px; 66 | padding: 3px; 67 | border: none; 68 | border-radius: 10px; 69 | border: 3px solid #${text}; 70 | } 71 | 72 | #text:selected { 73 | color: #282c34; 74 | background-color: transparent; 75 | } 76 | 77 | #entry:selected { 78 | background-color: #${text}; 79 | } 80 | ''; 81 | }; 82 | ".config/wofi/power.sh" = with colors.scheme.doom; { 83 | executable = true; 84 | text = '' 85 | #!/bin/sh 86 | 87 | entries="⏾ Suspend\n⭮ Reboot\n⏻ Shutdown" 88 | 89 | selected=$(echo -e $entries|wofi --dmenu --cache-file /dev/null | awk '{print tolower($2)}') 90 | 91 | case $selected in 92 | suspend) 93 | exec systemctl suspend;; 94 | reboot) 95 | exec systemctl reboot;; 96 | shutdown) 97 | exec systemctl poweroff -i;; 98 | esac 99 | ''; 100 | }; 101 | }; 102 | }; 103 | }; 104 | } 105 | -------------------------------------------------------------------------------- /rsc/config/alacritty/alacritty.yml: -------------------------------------------------------------------------------- 1 | {"font":{"bold":{"style":"Bold"},"normal":{"family":"Source Code Pro"}},"offset":{"x":-1,"y":0}} 2 | -------------------------------------------------------------------------------- /rsc/config/bspwm/bspwmrc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Monitor 5 | bspc monitor -d 1 2 3 4 5 # Workspace tag names (needs to be the same as the polybar config to work) 6 | 7 | # Window Information 8 | bspc config border_width 3 9 | bspc config window_gaps 12 10 | bspc config split_ratio 0.5 11 | 12 | bspc config click_to_focus true 13 | bspc config focus_follows_pointer false 14 | bspc config borderless_monocle false 15 | bspc config gapless_monocle false 16 | 17 | #bspc config normal_border_color "#000000" 18 | #bspc config focused_border_color "#ffffff" 19 | 20 | 21 | # Rules 22 | bspc rule -r '*' 23 | bspc rule -a '*:*:Picture in picture' 'state=floating' 'sticky=on' 24 | bspc rule -a '*:*:Picture-in-Picture' 'state=floating' 'sticky=on' 25 | bspc rule -a '.blueman-manager-wrapped' 'state=floating' 'sticky=on' 26 | bspc rule -a 'Emacs' 'desktop=3' 'follow=on' 'state=tiled' 27 | bspc rule -a 'Lutris' 'desktop=5' 'follow=on' 28 | bspc rule -a 'Pavucontrol' 'state=floating' 'sticky=on' 29 | bspc rule -a 'Pcmanfm' 'state=floating' 30 | bspc rule -a 'Steam' 'desktop=5' 31 | bspc rule -a 'libreoffice' 'desktop=3' 'follow=on' 32 | bspc rule -a 'plexmediaplayer' 'desktop=4' 'follow=on' 'state=fullscreen' 33 | 34 | # java gui fixes 35 | export _JAVA_AWT_WM_NONREPARENTING=1 36 | bspc rule -a sun-awt-X11-XDialogPeer state=floating 37 | 38 | # Startup 39 | feh --bg-scale $HOME/.config/wall # Wallpaper 40 | 41 | #pgrep -x sxhkd > /dev/null || sxhkd & 42 | 43 | killall -q polybar & # Reboot polybar to correctly show workspaces 44 | while pgrep -u $UID -x polybar >/dev/null; do sleep 1;done 45 | 46 | polybar main & #2>~/log & # To lazy to figure out systemd service order 47 | 48 | if [[ $(xrandr -q | grep 'DisplayPort-1 connected') ]]; then # If second monitor, also enable second polybar 49 | bspc monitor DP1 -d 6 7 8 9 10 50 | bspc wm -O HDMI3 DP1 51 | polybar sec & 52 | fi 53 | 54 | 55 | -------------------------------------------------------------------------------- /rsc/config/dunst/dunstrc: -------------------------------------------------------------------------------- 1 | [global] 2 | alignment="left" 3 | font="FiraCode Nerd Font 10" 4 | format="%s\n%b" 5 | frame_color="#282c34" 6 | frame_width=3 7 | height=200 8 | hide_duplicate_count=yes 9 | horizontal_padding=16 10 | icon_path="" 11 | icon_position="left" 12 | idle_threshold=120 13 | ignore_newline="no" 14 | line_height=4 15 | markup="full" 16 | monitor=0 17 | offset="50x50" 18 | origin="top-right" 19 | padding=16 20 | separator_color="frame" 21 | show_indicators="yes" 22 | shrink="yes" 23 | sort=yes 24 | stack_duplicates=yes 25 | transparency=10 26 | vertical_alignment="center" 27 | width=300 28 | word_wrap="yes" 29 | 30 | [urgency_critical] 31 | background="#282c34" 32 | foreground="#dfdfdf" 33 | frame_color="#ff6c6b" 34 | timeout=10 35 | 36 | [urgency_low] 37 | background="#282c34" 38 | foreground="#dfdfdf" 39 | timeout=4 40 | 41 | [urgency_normal] 42 | background="#282c34" 43 | foreground="#dfdfdf" 44 | timeout=4 45 | 46 | -------------------------------------------------------------------------------- /rsc/config/eww: -------------------------------------------------------------------------------- 1 | ../../modules/programs/eww -------------------------------------------------------------------------------- /rsc/config/hypr/hyprland.conf: -------------------------------------------------------------------------------- 1 | monitor=HDMI-A-2,1920x1080@60,1920x0,1 2 | monitor=HDMI-A-1,1920x1080@60,0x0,1 3 | 4 | workspace=HDMI-A-2,1 5 | workspace=HDMI-A-2,2 6 | workspace=HDMI-A-2,3 7 | workspace=HDMI-A-2,4 8 | workspace=HDMI-A-1,5 9 | workspace=HDMI-A-1,6 10 | workspace=HDMI-A-1,7 11 | workspace=HDMI-A-1,8 12 | 13 | monitor=,highres,auto,auto 14 | 15 | general { 16 | border_size=3 17 | gaps_in=0 18 | gaps_out=0 19 | col.active_border=0x99005577 20 | col.inactive_border=0x66333333 21 | layout=dwindle 22 | } 23 | 24 | decoration { 25 | rounding=0 26 | active_opacity=0.93 27 | inactive_opacity=0.93 28 | fullscreen_opacity=1 29 | blur { 30 | enabled=true 31 | } 32 | drop_shadow=false 33 | } 34 | 35 | animations { 36 | enabled = false 37 | bezier = overshot, 0.05, 0.9, 0.1, 1.05 38 | bezier = smoothOut, 0.5, 0, 0.99, 0.99 39 | bezier = smoothIn, 0.5, -0.5, 0.68, 1.5 40 | bezier = rotate,0,0,1,1 41 | animation = windows, 1, 4, overshot, slide 42 | animation = windowsIn, 1, 2, smoothOut 43 | animation = windowsOut, 1, 0.5, smoothOut 44 | animation = windowsMove, 1, 3, smoothIn, slide 45 | animation = border, 1, 5, default 46 | animation = fade, 1, 4, smoothIn 47 | animation = fadeDim, 1, 4, smoothIn 48 | animation = workspaces, 1, 4, default 49 | animation = borderangle, 1, 20, rotate, loop 50 | } 51 | 52 | input { 53 | kb_layout=us,us 54 | #kb_options=caps:ctrl_modifier 55 | kb_variant=,dvorak 56 | follow_mouse=2 57 | repeat_delay=250 58 | numlock_by_default=1 59 | accel_profile=flat 60 | sensitivity=0.8 61 | 62 | } 63 | 64 | dwindle { 65 | pseudotile=false 66 | force_split=2 67 | } 68 | 69 | misc { 70 | disable_hyprland_logo=true 71 | disable_splash_rendering=true 72 | mouse_move_enables_dpms=true 73 | key_press_enables_dpms=true 74 | background_color=0x111111 75 | } 76 | 77 | debug { 78 | damage_tracking=2 79 | } 80 | 81 | bindm=SUPER,mouse:272,movewindow 82 | bindm=SUPER,mouse:273,resizewindow 83 | 84 | bind=SUPER,Return,exec,kitty 85 | bind=SUPER,Q,killactive, 86 | bind=SUPER,Escape,exit, 87 | bind=SUPER,S,exec,systemctl suspend 88 | bind=SUPER,L,exec,swaylock 89 | bind=SUPER,E,exec,GDK_BACKEND=x11 pcmanfm 90 | bind=SUPER,H,togglefloating, 91 | #bind=SUPER,Space,exec,rofi -show drun 92 | bind=SUPER,Space,exec, pkill wofi || wofi --show drun 93 | bind=SUPER,P,pseudo, 94 | bind=SUPER,F,fullscreen, 95 | bind=SUPER,R,forcerendererreload 96 | bind=SUPERSHIFT,R,exec,hyprctl reload 97 | bind=SUPER,T,exec,emacsclient -c 98 | bind=SUPER,K,exec,hyprctl switchxkblayout keychron-k8-keychron-k8 next 99 | 100 | bind=SUPER,left,movefocus,l 101 | bind=SUPER,right,movefocus,r 102 | bind=SUPER,up,movefocus,u 103 | bind=SUPER,down,movefocus,d 104 | 105 | bind=SUPERSHIFT,left,movewindow,l 106 | bind=SUPERSHIFT,right,movewindow,r 107 | bind=SUPERSHIFT,up,movewindow,u 108 | bind=SUPERSHIFT,down,movewindow,d 109 | 110 | bind=ALT,1,workspace,1 111 | bind=ALT,2,workspace,2 112 | bind=ALT,3,workspace,3 113 | bind=ALT,4,workspace,4 114 | bind=ALT,5,workspace,5 115 | bind=ALT,6,workspace,6 116 | bind=ALT,7,workspace,7 117 | bind=ALT,8,workspace,8 118 | bind=ALT,9,workspace,9 119 | bind=ALT,0,workspace,10 120 | bind=ALT,right,workspace,+1 121 | bind=ALT,left,workspace,-1 122 | 123 | bind=ALTSHIFT,1,movetoworkspace,1 124 | bind=ALTSHIFT,2,movetoworkspace,2 125 | bind=ALTSHIFT,3,movetoworkspace,3 126 | bind=ALTSHIFT,4,movetoworkspace,4 127 | bind=ALTSHIFT,5,movetoworkspace,5 128 | bind=ALTSHIFT,6,movetoworkspace,6 129 | bind=ALTSHIFT,7,movetoworkspace,7 130 | bind=ALTSHIFT,8,movetoworkspace,8 131 | bind=ALTSHIFT,9,movetoworkspace,9 132 | bind=ALTSHIFT,0,movetoworkspace,10 133 | bind=ALTSHIFT,right,movetoworkspace,+1 134 | bind=ALTSHIFT,left,movetoworkspace,-1 135 | 136 | #bind=CTRL,right,resizeactive,20 0 137 | #bind=CTRL,left,resizeactive,-20 0 138 | #bind=CTRL,up,resizeactive,0 -20 139 | #bind=CTRL,down,resizeactive,0 20 140 | 141 | bind=SUPER,M,submap,resize 142 | submap=resize 143 | binde=,right,resizeactive,20 0 144 | binde=,left,resizeactive,-20 0 145 | binde=,up,resizeactive,0 -20 146 | binde=,down,resizeactive,0 20 147 | bind=,escape,submap,reset 148 | submap=reset 149 | 150 | bind=,print,exec,grim -g "$(slurp)" - | swappy -f - -o ~/Pictures/$(date +%Hh_%Mm_%Ss_%d_%B_%Y).png && notify-send "Saved to ~/Pictures/$(date +%Hh_%Mm_%Ss_%d_%B_%Y).png" 151 | 152 | bind=,XF86AudioLowerVolume,exec,pamixer -d 10 153 | bind=,XF86AudioRaiseVolume,exec,pamixer -i 10 154 | bind=,XF86AudioMute,exec,pamixer -t 155 | bind=SUPER_L,c,exec,pamixer --default-source -t 156 | bind=,XF86AudioMicMute,exec,pamixer --default-source -t 157 | bind=,XF86MonBrightnessDown,exec,light -U 10 158 | bind=,XF86MonBrightnessUP,exec,light -A 10 159 | 160 | #windowrule=float,^(Rofi)$ 161 | windowrule=float,title:^(Volume Control)$ 162 | windowrule=float,title:^(Picture-in-Picture)$ 163 | windowrule=pin,title:^(Picture-in-Picture)$ 164 | windowrule=move 75% 75% ,title:^(Picture-in-Picture)$ 165 | windowrule=size 24% 24% ,title:^(Picture-in-Picture)$ 166 | 167 | exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP 168 | exec-once=waybar 169 | exec-once=eww daemon 170 | #exec-once=$HOME/.config/eww/scripts/eww # When running eww as a bar 171 | exec-once=blueman-applet 172 | exec-once=swayidle -w timeout 600 'swaylock -f' timeout 1200 'systemctl suspend' after-resume 'hyprctl dispatch dpms on' before-sleep 'swaylock -f && hyprctl dispatch dpms off' 173 | -------------------------------------------------------------------------------- /rsc/config/kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | background #202020 2 | foreground #d0d0d0 3 | cursor #d0d0d0 4 | selection_background #eecb8b 5 | selection_foreground #232323 6 | color0 #151515 7 | color1 #ac4142 8 | color2 #7e8d50 9 | color3 #e5b566 10 | color4 #6c99ba 11 | color5 #9e4e85 12 | color6 #7dd5cf 13 | color7 #d0d0d0 14 | color8 #505050 15 | color9 #ac4142 16 | color10 #7e8d50 17 | color11 #e5b566 18 | color12 #6c99ba 19 | color13 #9e4e85 20 | color14 #7dd5cf 21 | color15 #f5f5f5 22 | 23 | shell_integration no-rc enabled 24 | confirm_os_window_close 0 25 | -------------------------------------------------------------------------------- /rsc/config/nvim/init.vim: -------------------------------------------------------------------------------- 1 | set packpath^=/nix/store/l4ywgs56a0jw8x955s3gilw8an7dbpbv-vim-pack-dir 2 | set runtimepath^=/nix/store/l4ywgs56a0jw8x955s3gilw8an7dbpbv-vim-pack-dir 3 | 4 | syntax enable " Syntax highlighting 5 | colorscheme srcery " Color scheme text 6 | 7 | let g:lightline = { 8 | \ 'colorscheme': 'wombat', 9 | \ } " Color scheme lightline 10 | 11 | highlight Comment cterm=italic gui=italic " Comments become italic 12 | hi Normal guibg=NONE ctermbg=NONE " Remove background, better for personal theme 13 | 14 | set number " Set numbers 15 | 16 | nmap :NERDTreeToggle " F6 opens NERDTree 17 | -------------------------------------------------------------------------------- /rsc/config/picom/picom.conf: -------------------------------------------------------------------------------- 1 | # fading 2 | fading = true; 3 | fade-delta = 10; 4 | fade-in-step = 0.028; 5 | fade-out-step = 0.03; 6 | fade-exclude = []; 7 | 8 | # opacity 9 | active-opacity = 1.000000; 10 | inactive-opacity = 1.000000; 11 | opacity-rule = [ "80:class_i *= 'discord'" , "80:class_i *= 'emacs'" , "80:class_i *= 'Alacritty'" ]; 12 | 13 | wintypes: 14 | { 15 | popup_menu = { opacity = 1.000000; }; 16 | dropdown_menu = { opacity = 1.000000; }; 17 | }; 18 | 19 | # other options 20 | backend = "glx"; 21 | vsync = true; 22 | daemon = true; 23 | use-damage = false; 24 | resize-damage = 1 25 | refresh-rate = 0; 26 | corner-radius = 5; 27 | round-borders = 5; 28 | 29 | detect-rounded-corners = true; 30 | detect-client-opacity = false; 31 | detect-transient = true 32 | detect-client-leader = false 33 | mark-wmwim-focused = true; 34 | mark-ovredir-focues = true; 35 | unredir-if-possible = true; 36 | glx-no-stencil = true; 37 | glx-no-rebind-pixmap = true; 38 | -------------------------------------------------------------------------------- /rsc/config/polybar/config.ini: -------------------------------------------------------------------------------- 1 | [bar/main] 2 | background=#00000000 3 | font-0=SourceCodePro:size=10 4 | font-1=FontAwesome6Free:style=Solid:size=8 5 | font-2=FontAwesome6Free:style=Regular:size=8 6 | font-3=FontAwesome6Brands:style=Regular:size=8 7 | font-4=FiraCodeNerdFont:size=10 8 | foreground=#ccffffff 9 | height=15 10 | module-margin-left=1 11 | modules-left=logo bspwm 12 | modules-right=backlight pad memory cpu pad mic sink volume pad battery date 13 | monitor=eDP-1 14 | offset-y=2 15 | padding-right=2 16 | tray-detached=false 17 | tray-position=right 18 | width=100% 19 | wm-restack=bspwm 20 | 21 | [bar/sec] 22 | background=#00000000 23 | font-0=SourceCodePro:size=10 24 | font-1=FontAwesome6Free:style=Solid:size=8 25 | font-2=FontAwesome6Free:style=Regular:size=8 26 | font-3=FontAwesome6Brands:style=Regular:size=8 27 | font-4=FiraCodeNerdFont:size=10 28 | foreground=#ccffffff 29 | height=15 30 | module-margin-left=1 31 | modules-left=logo bspwm 32 | modules-right=mic sink volume pad date 33 | monitor=Virtual-1 34 | offset-y=2 35 | padding-right=2 36 | spacing=1.5 37 | width=100% 38 | wm-restack=bspwm 39 | 40 | [module/backlight] 41 | bar-empty=─ 42 | bar-empty-font=3 43 | bar-empty-foreground=#44 44 | bar-fill=─ 45 | bar-fill-font=3 46 | bar-fill-foreground=ff 47 | bar-indicator=| 48 | bar-indicator-font=3 49 | bar-indicator-foreground=#ff 50 | bar-width=10 51 | card=intel_backlight 52 | format= 53 | ramp-0= 54 | ramp-1= 55 | ramp-2= 56 | type=internal/backlight 57 | 58 | [module/battery] 59 | animation-charging-0= 60 | animation-charging-1= 61 | animation-charging-2= 62 | animation-charging-3= 63 | animation-charging-4= 64 | animation-charging-framerate=750 65 | bar-capacity-empty=█ 66 | bar-capacity-empty-font=3 67 | bar-capacity-empty-foreground=#44ffffff 68 | bar-capacity-fill=█ 69 | bar-capacity-fill-font=3 70 | bar-capacity-fill-foreground=#ddffffff 71 | bar-capacity-format=%{+u}%{+o}%fill%%empty%%{-u}%{-o} 72 | bar-capacity-width=10 73 | format-charging=" " 74 | format-discharging=" " 75 | format-full=" " 76 | full-at=98 77 | label-charging=%percentage%% 78 | label-discharging=%percentage%% 79 | label-full=%percentage%% 80 | ramp-capacity-0= 81 | ramp-capacity-0-foreground=#f53c3c 82 | ramp-capacity-1= 83 | ramp-capacity-1-foreground=#ffa900 84 | ramp-capacity-2= 85 | ramp-capacity-3= 86 | ramp-capacity-4= 87 | type=internal/battery 88 | 89 | [module/bluetooth] 90 | click-left=/nix/store/vfg179ld3fpnb6p44jpxiy77rprzzajq-blueman-2.3.2/bin/blueman-manager 91 | content= 92 | type=custom/text 93 | 94 | [module/bspwm] 95 | format= 96 | label-dimmed-underline=#ccffffff 97 | label-empty=%icon% 98 | label-empty-font=4 99 | label-empty-foreground=#55 100 | label-empty-padding=2 101 | label-focused=%icon% 102 | label-focused-background=#773f3f3f 103 | label-focused-font=4 104 | label-focused-foreground=#fff 105 | label-focused-padding=2 106 | label-focused-underline=#c9665e 107 | label-locked=L 108 | label-locked-foreground=#bd2c40 109 | label-locked-padding=2 110 | label-locked-underline=#c9665e 111 | label-monocle=M 112 | label-monocle-background=#33ffffff 113 | label-monocle-padding=2 114 | label-monocle-underline=#c9665e 115 | label-occupied=%icon% 116 | label-occupied-font=4 117 | label-occupied-foreground=#ddd 118 | label-occupied-padding=2 119 | label-occupied-underline=#666 120 | label-private=P 121 | label-private-foreground=#bd2c40 122 | label-private-padding=2 123 | label-private-underline=#c9665e 124 | label-sticky=S 125 | label-sticky-foreground=#fba922 126 | label-sticky-padding=2 127 | label-sticky-underline=#c9665e 128 | label-urgent=%icon% 129 | label-urgent-background=#bd2c40 130 | label-urgent-font=4 131 | label-urgent-foreground=#000000 132 | label-urgent-padding=2 133 | label-urgent-underline=#9b0a20 134 | pin-workspace=true 135 | type=internal/bspwm 136 | ws-icon-0=1; 137 | ws-icon-1=2; 138 | ws-icon-2=3; 139 | ws-icon-3=4; 140 | ws-icon-4=5; 141 | ws-icon-5=6; 142 | ws-icon-6=7; 143 | ws-icon-7=8; 144 | ws-icon-8=9; 145 | ws-icon-9=10; 146 | 147 | [module/cpu] 148 | format=#~ 117 | 118 | ** Create flake.nix 119 | - Using the nixpkgs-unstable branch, will be installed inside a shell. This host is ~default~. You can create multiple hosts and rename them. 120 | #+begin_src nix 121 | { 122 | description = "A development environment"; 123 | inputs = { 124 | nixpkgs = { url = "github:nixos/nixpkgs/nixpkgs-unstable"; }; 125 | }; 126 | outputs = inputs: 127 | let 128 | pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; 129 | in { 130 | # default host 131 | devShells.x86_64-linux.default = inputs.nixpkgs.legacyPackages.x86_64-linux.mkShell { 132 | buildInputs = [ ]; 133 | }; 134 | }; 135 | } 136 | #+end_src 137 | 138 | * Remove shell packages 139 | - exit shell and just collect garbage like ~$ sudo nix-collect-garbage -d~ 140 | -------------------------------------------------------------------------------- /shells/archive/appimage.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Example on how to run appimages 3 | # This example installs firefox nightly form an appimage available online 4 | # If you have the appimage locally, just use src = ; 5 | # 6 | # In this case, rather than using nix-shell, it's better to run "$ nix build -f appimage.nix" 7 | # and move the result symlink to your desired location or in a location within PATH 8 | # 9 | # A better solution is to install "appimage-run" 10 | # Appimage can then be run via "$ appimage-run " and will (hopefully) start without issues 11 | # 12 | 13 | let 14 | version = "103.0"; 15 | buildnumber = "r20220613094641"; 16 | in 17 | { pkgs ? import { } }: 18 | pkgs.appimageTools.wrapType2 { 19 | name = "firefox-nightly"; 20 | src = pkgs.fetchurl { 21 | url = "https://github.com/srevinsaju/Firefox-Appimage/releases/download/firefox-nightly/firefox-nightly-${version}.${buildnumber}-x86_64.AppImage"; 22 | sha256 = "8IYYbHnoq4hcpheIa5oPlrevalux5/xPAO0v32XumOc="; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /shells/archive/etcher.nix: -------------------------------------------------------------------------------- 1 | # 2 | # This no longer works. Better to just use $ NIXPKGS_ALLOW_INSECURE=1 nix run nixpkgs#etcher --impure 3 | # 4 | 5 | let 6 | unstableTarball = fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"; 7 | # pkgs = import {}; 8 | unstable = import unstableTarball { }; 9 | 10 | shell = unstable.mkShell { 11 | buildInputs = [ unstable.etcher ]; 12 | permittedInsecurePackages = [ 13 | "electron-12.2.3" 14 | ]; 15 | }; 16 | in 17 | shell 18 | -------------------------------------------------------------------------------- /shells/js/electron/.envrc: -------------------------------------------------------------------------------- 1 | use nix 2 | -------------------------------------------------------------------------------- /shells/js/electron/shell.nix: -------------------------------------------------------------------------------- 1 | # 2 | # ELECTRON 3 | #$ npx create-electron-app 4 | #$ npm start #inside directory 5 | #$ rs #restart/reload 6 | # 7 | 8 | with import { }; 9 | mkShell { 10 | name = "React-Electron-Shell"; 11 | buildInputs = with pkgs; [ 12 | nodePackages.create-react-app 13 | electron 14 | nodejs 15 | yarn 16 | 17 | fakeroot 18 | dpkg 19 | rpm 20 | 21 | patchelf 22 | binutils 23 | ]; 24 | ELECTRON_OVERRIDE_DIST_PATH = "${electron}/bin/"; #NEEDED to not get errors on npm start 25 | 26 | shellHook = '' 27 | echo "done" 28 | ''; 29 | } 30 | -------------------------------------------------------------------------------- /shells/js/npm/.envrc: -------------------------------------------------------------------------------- 1 | use nix 2 | -------------------------------------------------------------------------------- /shells/js/npm/shell.nix: -------------------------------------------------------------------------------- 1 | # 2 | # When installing packages globally using "$ npm install -g " 3 | # the binary will be installed in $HOME/.npm-global and should be available in your PATH 4 | # 5 | 6 | with import { }; 7 | mkShell { 8 | name = "NPM-Shell"; 9 | buildInputs = with pkgs; [ 10 | nodejs 11 | nodePackages.npm 12 | ]; 13 | 14 | shellHook = '' 15 | npm set prefix ~/.npm-global 16 | export PATH="$HOME/.npm-global/bin:$PATH" 17 | echo "done" 18 | ''; 19 | } 20 | -------------------------------------------------------------------------------- /shells/phoenix/.envrc: -------------------------------------------------------------------------------- 1 | use nix 2 | -------------------------------------------------------------------------------- /shells/phoenix/shell.nix: -------------------------------------------------------------------------------- 1 | # copy files to project folder 2 | # nix-shell (or will load by default with direnv) 3 | # postgres -h '' -k $PGHOST (in separate shell) 4 | # createuser -d postgres 5 | # mix archive.install hex phx_new 6 | # mix phx.new . 7 | 8 | with import { }; 9 | let 10 | basePackages = [ 11 | elixir 12 | erlang 13 | elixir_ls 14 | # inotify-tools 15 | nodejs 16 | yarn 17 | postgresql 18 | process-compose 19 | ]; 20 | PROJECT_ROOT = builtins.toString ./.; 21 | 22 | hooks = '' 23 | mkdir -p .nix-mix 24 | mkdir -p .nix-hex 25 | export MIX_HOME=${PROJECT_ROOT}/.nix-mix 26 | export HEX_HOME=${PROJECT_ROOT}/.nix-hex 27 | export PATH=$MIX_HOME/bin:$PATH 28 | export PATH=$HEX_HOME/bin:$PATH 29 | export LANG=en_NZ.UTF-8 30 | export ERL_AFLAGS="-kernel shell_history enabled" 31 | 32 | set -e 33 | export PGDIR=${PROJECT_ROOT}/postgres 34 | export PGHOST=$PGDIR 35 | export PGDATA=$PGDIR/data 36 | export PGLOG=$PGDIR/log 37 | export DATABASE_URL="postgresql:///postgres?host=$PGDIR" 38 | 39 | if test ! -d $PGDIR; then 40 | mkdir $PGDIR 41 | fi 42 | 43 | if [ ! -d $PGDATA ]; then 44 | echo 'Initializing postgresql database...' 45 | initdb $PGDATA --auth=trust >/dev/null 46 | fi 47 | 48 | ''; 49 | 50 | in 51 | mkShell { 52 | buildInputs = basePackages; 53 | shellHook = hooks; 54 | } 55 | -------------------------------------------------------------------------------- /shells/python/.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | -------------------------------------------------------------------------------- /shells/python/flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "nixpkgs": { 4 | "locked": { 5 | "lastModified": 1710765496, 6 | "narHash": "sha256-p7ryWEeQfMwTB6E0wIUd5V2cFTgq+DRRBz2hYGnJZyA=", 7 | "owner": "nixos", 8 | "repo": "nixpkgs", 9 | "rev": "e367f7a1fb93137af22a3908f00b9a35e2d286a7", 10 | "type": "github" 11 | }, 12 | "original": { 13 | "owner": "nixos", 14 | "ref": "nixpkgs-unstable", 15 | "repo": "nixpkgs", 16 | "type": "github" 17 | } 18 | }, 19 | "root": { 20 | "inputs": { 21 | "nixpkgs": "nixpkgs" 22 | } 23 | } 24 | }, 25 | "root": "root", 26 | "version": 7 27 | } 28 | -------------------------------------------------------------------------------- /shells/python/flake.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Example of a python development shell flake that allows for multiple versions and hosts 3 | # Can be run with "$ nix develop" or "$ nix develop #" 4 | # 5 | 6 | { 7 | description = "A python development environment"; 8 | 9 | inputs = { 10 | nixpkgs = { url = "github:nixos/nixpkgs/nixpkgs-unstable"; }; 11 | }; 12 | 13 | outputs = inputs: 14 | let 15 | pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; 16 | pypi = with pkgs; (ps: with ps; [ 17 | pip 18 | ]); 19 | in 20 | { 21 | # default host 22 | devShells.x86_64-linux.default = inputs.nixpkgs.legacyPackages.x86_64-linux.mkShell { 23 | buildInputs = [ (pkgs.python310.withPackages pypi) ]; 24 | }; 25 | # py311 host 26 | devShells.x86_64-linux.py311 = inputs.nixpkgs.legacyPackages.x86_64-linux.mkShell { 27 | buildInputs = [ (pkgs.python311.withPackages pypi) ]; 28 | }; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /shells/python/shell.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Python development shell 3 | # Pip packages will be installed in the parent working directory and will be added to PATH and PYTHONPATH 4 | # 5 | 6 | { pkgs ? import { } }: 7 | 8 | pkgs.mkShell { 9 | packages = with pkgs; [ 10 | (pkgs.python3.withPackages (ps: [ 11 | ps.pip 12 | ps.tkinter 13 | ])) 14 | python3Packages.python-lsp-server 15 | poetry # Instead of pip, you can use $ poetry init -n --name and $ poetry add request to install python packages 16 | ]; 17 | shellHook = '' 18 | export PIP_PREFIX=$(pwd)/_build/pip_packages 19 | export PYTHONPATH="$PIP_PREFIX/${pkgs.python3.sitePackages}:$PYTHONPATH" 20 | export PATH="$PIP_PREFIX/bin:$PATH" 21 | unset SOURCE_DATE_EPOCH 22 | ''; 23 | } 24 | -------------------------------------------------------------------------------- /shells/unstable/.envrc: -------------------------------------------------------------------------------- 1 | use flake . 2 | -------------------------------------------------------------------------------- /shells/unstable/flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "nixpkgs": { 4 | "locked": { 5 | "lastModified": 1704290814, 6 | "narHash": "sha256-LWvKHp7kGxk/GEtlrGYV68qIvPHkU9iToomNFGagixU=", 7 | "owner": "nixos", 8 | "repo": "nixpkgs", 9 | "rev": "70bdadeb94ffc8806c0570eb5c2695ad29f0e421", 10 | "type": "github" 11 | }, 12 | "original": { 13 | "owner": "nixos", 14 | "ref": "nixos-23.05", 15 | "repo": "nixpkgs", 16 | "type": "github" 17 | } 18 | }, 19 | "nixpkgs-unstable": { 20 | "locked": { 21 | "lastModified": 1710631334, 22 | "narHash": "sha256-rL5LSYd85kplL5othxK5lmAtjyMOBg390sGBTb3LRMM=", 23 | "owner": "nixos", 24 | "repo": "nixpkgs", 25 | "rev": "c75037bbf9093a2acb617804ee46320d6d1fea5a", 26 | "type": "github" 27 | }, 28 | "original": { 29 | "owner": "nixos", 30 | "ref": "nixos-unstable", 31 | "repo": "nixpkgs", 32 | "type": "github" 33 | } 34 | }, 35 | "root": { 36 | "inputs": { 37 | "nixpkgs": "nixpkgs", 38 | "nixpkgs-unstable": "nixpkgs-unstable" 39 | } 40 | } 41 | }, 42 | "root": "root", 43 | "version": 7 44 | } 45 | -------------------------------------------------------------------------------- /shells/unstable/flake.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Example of a flake shell 3 | # Can be run with "$ nix develop" or "$ nix develop #" 4 | # 5 | 6 | { 7 | description = "Use stable and unstable packages"; 8 | 9 | inputs = { 10 | nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; 11 | nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; 12 | }; 13 | 14 | outputs = { self, nixpkgs, nixpkgs-unstable }: 15 | let 16 | system = "x86_64-linux"; 17 | pkgs = import nixpkgs { 18 | inherit system; 19 | config.allowUnfree = true; 20 | }; 21 | unstable = import nixpkgs-unstable { 22 | inherit system; 23 | config.allowUnfree = true; 24 | }; 25 | in 26 | { 27 | devShells.${system}.default = pkgs.mkShell { 28 | packages = [ 29 | unstable.sssnake 30 | pkgs.vitetris 31 | ]; 32 | }; 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /shells/unstable/shell.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Example shell that makes it possible to use stable and unstable packages 3 | # But you could also just add a new channel and using "$ nix-env -f channel: -iA ", or via the flake.nix 4 | # 5 | 6 | let 7 | unstableTarball = fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"; 8 | stable = import { }; 9 | unstable = import unstableTarball { }; 10 | in 11 | with import { }; 12 | stdenv.mkDerivation { 13 | name = "Unstable-Shell"; 14 | buildInputs = [ unstable.hello stable.world ]; 15 | # permittedInsecurePackages = with pkgs; [ 16 | # "" 17 | # ]; 18 | } 19 | --------------------------------------------------------------------------------