├── .editorconfig ├── .gitignore ├── .taplo.toml ├── LICENSE ├── README.md ├── build.sh ├── config.toml ├── flake.lock ├── flake.nix ├── genflake.nix ├── hardware ├── android-tools │ └── default.nix ├── bluetooth │ └── default.nix ├── bootloader │ └── default.nix ├── deckbd-wrapper │ └── default.nix ├── default.nix ├── graphics │ ├── default.nix │ └── modules │ │ ├── mesa │ │ └── default.nix │ │ ├── nvidia │ │ └── default.nix │ │ └── radeon │ │ └── default.nix ├── intel │ └── default.nix ├── kernel │ └── default.nix ├── mounts │ └── default.nix ├── rtl8821ce │ └── default.nix └── ryzen │ └── default.nix ├── internals.nix ├── options.nix └── system ├── applications ├── default.nix └── modules │ ├── bash │ └── default.nix │ ├── btop │ ├── btop.conf │ └── default.nix │ ├── celluloid │ ├── config │ │ ├── celluloid.conf │ │ └── shaders │ │ │ └── FSR.glsl │ └── default.nix │ ├── clamav │ └── default.nix │ ├── codium │ └── default.nix │ ├── container-manager │ └── default.nix │ ├── direnv │ └── default.nix │ ├── game-launch │ └── default.nix │ ├── gamemode │ └── default.nix │ ├── gamescope │ └── default.nix │ ├── gdm │ └── default.nix │ ├── git │ └── default.nix │ ├── icedos-toolset │ ├── default.nix │ └── modules │ │ ├── aria2c │ │ └── default.nix │ │ ├── btrfs │ │ └── default.nix │ │ ├── ip │ │ └── default.nix │ │ ├── logout │ │ └── default.nix │ │ ├── reboot │ │ └── default.nix │ │ ├── rebuild │ │ └── default.nix │ │ └── vpn-exclude │ │ └── default.nix │ ├── input-remapper │ └── default.nix │ ├── kitty │ └── default.nix │ ├── lact │ └── default.nix │ ├── librewolf │ ├── default.nix │ ├── modules │ │ └── user.js │ │ │ └── default.nix │ └── profiles.ini │ ├── mangohud │ └── default.nix │ ├── mission-center │ └── default.nix │ ├── ncdu │ └── default.nix │ ├── network-manager │ └── default.nix │ ├── nh │ └── default.nix │ ├── nix-health │ └── default.nix │ ├── nix-store │ └── default.nix │ ├── nixfmt │ └── default.nix │ ├── obs-studio │ └── default.nix │ ├── ollama │ └── default.nix │ ├── php │ └── default.nix │ ├── rust │ └── default.nix │ ├── signal │ └── default.nix │ ├── solaar │ └── default.nix │ ├── ssh │ └── default.nix │ ├── steam │ └── default.nix │ ├── sunshine │ └── default.nix │ ├── tailscale │ └── default.nix │ ├── virt-manager │ └── default.nix │ ├── waydroid │ └── default.nix │ ├── wg-quick │ └── default.nix │ ├── zed │ └── default.nix │ ├── zen-browser │ ├── default.nix │ └── modules │ │ ├── profiles │ │ └── default.nix │ │ └── user.js │ │ └── default.nix │ └── zsh │ ├── default.nix │ └── p10k-theme.zsh ├── desktop ├── default.nix ├── gnome │ ├── default.nix │ └── modules │ │ ├── appindicator │ │ └── default.nix │ │ ├── arcmenu │ │ └── default.nix │ │ ├── dash-to-panel │ │ └── default.nix │ │ ├── home │ │ └── default.nix │ │ └── startup │ │ └── default.nix ├── hyprland │ ├── default.nix │ └── modules │ │ ├── csgo-vulkan-fix │ │ └── default.nix │ │ ├── gnome-control-center │ │ └── default.nix │ │ ├── grimblast │ │ └── default.nix │ │ ├── home │ │ └── default.nix │ │ ├── hypridle │ │ └── default.nix │ │ ├── hyprland-per-window-layout │ │ └── default.nix │ │ ├── hyprlock │ │ └── default.nix │ │ ├── hyproled │ │ └── default.nix │ │ ├── hyprpanel │ │ ├── default.nix │ │ └── profile.png │ │ ├── hyprpaper │ │ ├── default.nix │ │ └── hyprpaper.jpg │ │ ├── hyprpicker │ │ └── default.nix │ │ ├── hyprpolkitagent │ │ └── default.nix │ │ ├── hyprspace │ │ └── default.nix │ │ ├── playerctl │ │ └── default.nix │ │ ├── poweralertd │ │ └── default.nix │ │ ├── valent │ │ └── default.nix │ │ └── walker │ │ └── default.nix ├── modules │ ├── adwaita-qt │ │ ├── default.nix │ │ ├── qt5ct.conf │ │ └── qt6ct.conf │ ├── clear-xdg-portals │ │ └── default.nix │ ├── displays │ │ └── default.nix │ ├── home │ │ └── default.nix │ ├── nautilus │ │ └── default.nix │ ├── pipewire │ │ └── default.nix │ └── sd-inhibitor │ │ ├── default.nix │ │ ├── modules │ │ ├── cpu-watcher │ │ │ └── default.nix │ │ ├── disk-watcher │ │ │ └── default.nix │ │ ├── network-watcher │ │ │ └── default.nix │ │ └── pipewire-watcher │ │ │ └── default.nix │ │ └── sd-inhibitor.sh └── steam-session │ └── default.nix └── users ├── default.nix └── icedborn └── default.nix /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig configuration for nixpkgs 2 | # https://EditorConfig.org 3 | 4 | # Top-most EditorConfig file 5 | root = true 6 | 7 | # Unix-style newlines with a newline ending every file, utf-8 charset 8 | [*] 9 | end_of_line = lf 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | charset = utf-8 13 | indent_style = space 14 | indent_size = 2 15 | 16 | # Ignore diffs/patches 17 | [*.{diff,patch}] 18 | end_of_line = unset 19 | insert_final_newline = unset 20 | trim_trailing_whitespace = unset 21 | 22 | # see https://nixos.org/nixpkgs/manual/#chap-conventions 23 | 24 | # Match json/lockfiles/markdown/nix/perl/python/ruby/shell/docbook files, set indent to spaces 25 | [*.{json,lock,md,nix,pl,pm,py,rb,sh,xml}] 26 | indent_style = space 27 | indent_size = 2 28 | 29 | # Match docbook files, set indent width of one 30 | [*.xml] 31 | indent_size = 1 32 | 33 | # Match json/lockfiles/markdown/nix/ruby files, set indent width of two 34 | [*.{json,lock,md,nix,rb}] 35 | indent_size = 2 36 | 37 | # Match perl/python/shell scripts, set indent width of four 38 | [*.{pl,pm,py,sh}] 39 | indent_size = 2 40 | 41 | # Match gemfiles, set indent to spaces with width of two 42 | [Gemfile] 43 | indent_size = 2 44 | indent_style = space 45 | 46 | # Disable file types or individual files 47 | # some of these files may be auto-generated and/or require significant changes 48 | 49 | [*.{c,h}] 50 | insert_final_newline = unset 51 | trim_trailing_whitespace = unset 52 | 53 | [*.{asc,key,ovpn}] 54 | insert_final_newline = unset 55 | end_of_line = unset 56 | trim_trailing_whitespace = unset 57 | 58 | [*.lock] 59 | indent_size = unset 60 | 61 | # Although Markdown/CommonMark allows using two trailing spaces to denote 62 | # a hard line break, we do not use that feature in nixpkgs since 63 | # it forces the surrounding paragraph to become a which 64 | # does not wrap reasonably. 65 | # Instead of a hard line break, start a new paragraph by inserting a blank line. 66 | [*.md] 67 | trim_trailing_whitespace = true 68 | 69 | # binaries 70 | [*.nib] 71 | end_of_line = unset 72 | insert_final_newline = unset 73 | trim_trailing_whitespace = unset 74 | charset = unset 75 | 76 | [eggs.nix] 77 | trim_trailing_whitespace = unset 78 | 79 | [nixos/modules/services/networking/ircd-hybrid/*.{conf,in}] 80 | trim_trailing_whitespace = unset 81 | 82 | [pkgs/build-support/dotnetenv/Wrapper/**] 83 | end_of_line = unset 84 | indent_style = unset 85 | insert_final_newline = unset 86 | trim_trailing_whitespace = unset 87 | 88 | [pkgs/development/compilers/elm/registry.dat] 89 | end_of_line = unset 90 | insert_final_newline = unset 91 | 92 | [pkgs/development/haskell-modules/hackage-packages.nix] 93 | indent_style = unset 94 | trim_trailing_whitespace = unset 95 | 96 | [pkgs/servers/dict/wordnet_structures.py] 97 | trim_trailing_whitespace = unset 98 | 99 | [pkgs/tools/misc/timidity/timidity.cfg] 100 | trim_trailing_whitespace = unset 101 | 102 | [pkgs/tools/virtualization/ovftool/*.ova] 103 | end_of_line = unset 104 | insert_final_newline = unset 105 | trim_trailing_whitespace = unset 106 | charset = unset 107 | 108 | [lib/tests/*.plist] 109 | indent_style = tab 110 | insert_final_newline = unset 111 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .cache 2 | .history 3 | .idea 4 | .sessions 5 | .vscode 6 | .zed 7 | -------------------------------------------------------------------------------- /.taplo.toml: -------------------------------------------------------------------------------- 1 | [formatting] 2 | align_comments = false 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IceDOS 2 | 3 | This is a NixOS configuration project that aims to create a highly opinionated gaming and general purpose computing experience, while still providing enough config options for my different needs. 4 | 5 | ## Caution ⚠️ 6 | 7 | - This repository is not meant to be used as a flake input, thus, such a use case is not officially supported or tested. 8 | - Do not forget to go through [config.toml](https://github.com/IceDBorn/IceDOS/blob/main/config.toml) and set each option to your liking! Be especially careful for [[[icedos.hardware.mounts]]](https://github.com/IceDBorn/IceDOS/blob/55ce606b37fc7cb1e0110d3454b2827e2b56144f/config.toml#L191), malconfigured entries can make your generation un-bootable! 9 | 10 | ## Install 11 | 12 | ```bash 13 | mkdir -p ~/.config/nix 14 | echo "experimental-features = flakes nix-command" > ~/.config/nix/nix.conf 15 | git clone https://github.com/icedborn/icedos 16 | cd icedos 17 | nix-shell ./build.sh 18 | ``` 19 | 20 | ## Preview 21 | 22 | ![Untitled](https://github.com/user-attachments/assets/ac03c7bd-8211-42e7-856c-f6ff03966ce6) 23 | 24 | ## Contributing 25 | 26 | Examples of what probably will/won't be accepted: 27 | 28 | ✅ A PR that improves framerate for games in all cases or, if it's unstable, enabled through an option in `config.toml`. 29 | 30 | ✅ A PR that adds a new desktop environment option and doesn't break existing functionality. 31 | 32 | ✅ A PR that adds a package with custom overrides, as a module. It is disabled by default, and can be enabled in `config.toml`. 33 | 34 | ❌ A PR that adds a package you want to use. 35 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env nix-shell 2 | #! nix-shell -i bash -p nixfmt-rfc-style git nh 3 | 4 | CONFIG="/tmp/configuration-location" 5 | FLAKE="flake.nix" 6 | 7 | action="switch" 8 | extraBuildArgs=() 9 | 10 | while [[ $# -gt 0 ]]; do 11 | case $1 in 12 | --boot) 13 | action="boot" 14 | shift 15 | ;; 16 | --update) 17 | update="-u" 18 | shift 19 | ;; 20 | --ask) 21 | ask="-a" 22 | shift 23 | ;; 24 | --builder) 25 | extraBuildArgs+=("--build-host") 26 | extraBuildArgs+=("$2") 27 | shift 28 | shift 29 | ;; 30 | *) 31 | echo "Unknown arg $1" >/dev/stderr 32 | exit 1 33 | ;; 34 | esac 35 | done 36 | 37 | # Save current directory into a file 38 | [ -f "$CONFIG" ] && rm -f "$CONFIG" || sudo rm -rf "$CONFIG" 39 | printf "$PWD" > "$CONFIG" 40 | 41 | # Generate flake.nix 42 | [ -f "$FLAKE" ] && rm -f "$FLAKE" 43 | nix eval --extra-experimental-features nix-command --write-to "$FLAKE" --file "genflake.nix" "$FLAKE" 44 | nixfmt "$FLAKE" 45 | 46 | # Build the system configuration 47 | nh os $action . $update $ask ${extraBuildArgs[*]} 48 | -------------------------------------------------------------------------------- /config.toml: -------------------------------------------------------------------------------- 1 | [icedos.applications] 2 | extraPackages = [] 3 | insecurePackages = [] 4 | aagl = false 5 | android-tools = false 6 | celluloid = true 7 | clamav = false 8 | defaultBrowser = "zen" # Options: 'librewolf', 'zen' 9 | defaultEditor = "zed" # Options: 'codium', 'zed' 10 | input-remapper = true 11 | lact = true 12 | librewolf = false 13 | mission-center = true 14 | nautilus = true 15 | php = false 16 | rust = false 17 | solaar = true 18 | ssh = true 19 | 20 | [icedos.applications.codium] 21 | enable = true 22 | zoomLevel = 0 23 | 24 | [icedos.applications.kitty] 25 | enable = true 26 | hideDecorations = false # Hide top bar 27 | 28 | [icedos.applications.mangohud] 29 | enable = true 30 | maxFpsLimit = 144 # Use 0 for unlimited 31 | 32 | [icedos.applications.network-manager] 33 | enable = true 34 | applet = true 35 | 36 | [icedos.applications.obs-studio] 37 | enable = true 38 | virtualCamera = false 39 | 40 | [icedos.applications.ollama] 41 | enable = false 42 | models = ["qwen2.5-coder:latest"] # https://ollama.com/library 43 | rocmOverrideGfx = "10.3.0" # https://github.com/ollama/ollama/blob/main/docs/gpu.md#amd-radeon 44 | 45 | [icedos.applications.signal] 46 | enable = true 47 | package = "signal" # Options: 'flare', 'signal' 48 | 49 | [icedos.applications.steam] 50 | enable = true 51 | beta = true 52 | downloadsWorkaround = true 53 | 54 | [icedos.applications.steam.session] 55 | enable = false 56 | user = "icedborn" 57 | 58 | [icedos.applications.steam.session.autoStart] 59 | enable = false 60 | desktopSession = "hyprland" 61 | 62 | [icedos.applications.sunshine] 63 | enable = false 64 | autostart = false 65 | 66 | [icedos.applications.tailscale] 67 | enable = false 68 | enableTrayscale = true 69 | 70 | [icedos.applications.valent] 71 | enable = false 72 | deviceId = "901524a4_c7c0_407e_9903_431abce54131" 73 | 74 | [icedos.applications.zed] 75 | enable = true 76 | vim = true 77 | 78 | [icedos.applications.zed.theme] 79 | dark = "One Dark Pro" 80 | light = "One Light" 81 | mode = "system" # Options: 'system', 'dark', 'light' 82 | 83 | [icedos.applications.zen-browser] 84 | enable = true 85 | privacy = true 86 | 87 | [[icedos.applications.zen-browser.profiles]] 88 | default = true 89 | exec = "default" 90 | pwa = false 91 | 92 | [[icedos.applications.zen-browser.profiles]] 93 | default = false 94 | exec = "zen-social" 95 | pwa = true 96 | icon = "zen" 97 | name = "Zen Social" 98 | sites = [ 99 | "https://mail.proton.me", 100 | "https://develop.element.io", 101 | "https://discord.com/app", 102 | ] 103 | 104 | [icedos.bootloader.grub] 105 | enable = false 106 | device = "/dev/sda" 107 | 108 | [icedos.bootloader.systemd-boot] 109 | enable = true 110 | mountPoint = "/boot" 111 | 112 | [icedos.desktop] 113 | accentColor = "7E57C2" # With gnome enabled this is getting overriden by gnome's selected accent color hex code 114 | 115 | [icedos.desktop.autologin] 116 | enable = true 117 | user = "icedborn" 118 | 119 | [icedos.desktop.gdm] 120 | enable = true 121 | autoSuspend = true 122 | 123 | [icedos.desktop.gnome] 124 | enable = false 125 | accentColor = "purple" # Options: 'blue', 'teal', 'green', 'yellow', 'orange', 'red', 'pink', 'purple', 'slate' 126 | hotCorners = false 127 | powerButtonAction = "interactive" 128 | 129 | # Options: 'minimize', 'maximize', 'close', 'spacer'(adds space between buttons), ':'(left-center-right separator) 130 | titlebarLayout = "appmenu:close" 131 | 132 | [icedos.desktop.gnome.extensions] 133 | arcmenu = false 134 | dashToPanel = false 135 | 136 | [icedos.desktop.gnome.clock] 137 | date = false # Show the month and day of the month on the clock 138 | weekday = false # Show the day of the week on the clock 139 | 140 | [icedos.desktop.gnome.workspaces] 141 | dynamicWorkspaces = true 142 | maxWorkspaces = 1 # Determines the maximum number of workspaces when dynamic workspaces are disabled 143 | 144 | [icedos.desktop.hyprland] 145 | enable = true 146 | 147 | [icedos.desktop.hyprland.settings] 148 | followMouse = 1 # Options: https://wiki.hyprland.org/Configuring/Variables/#follow-mouse-cursor 149 | secondsToLowerBrightness = 60 150 | startupScript = """ 151 | nautilus -w & 152 | nautilus -w & 153 | signal-desktop & 154 | steam & 155 | zeditor & 156 | zen-beta --no-remote -P default --name zen-startup & 157 | zen-social & 158 | """ 159 | windowRules = [ 160 | "workspace 1 silent, class:^(zen-startup)$", 161 | "workspace 2 silent, class:^(dev.zed.Zed)$", 162 | "workspace 11 silent, class:^(signal|zen-social)$", 163 | "workspace 12 silent, class:^(Steam|steam)$, title:^((?!notificationtoasts.*).)*$", 164 | "workspace 12 silent, title:^(.*Steam[A-Za-z0-9\\s]*)$", 165 | "workspace 13 silent, class:^(org\\.gnome\\.Nautilus)$", 166 | ] 167 | 168 | [icedos.desktop.hyprland.settings.animations] 169 | enable = true 170 | bezierCurve = "0.83, 0, 0.17, 1" # Presets: https://easings.net 171 | speed = 2 # Function: (x * 100)ms 172 | 173 | [icedos.desktop.hyprland.plugins] 174 | hyprspace = false 175 | 176 | [icedos.desktop.hyprland.plugins.cs2fix] 177 | enable = false 178 | width = 1440 179 | height = 1080 180 | 181 | [icedos.desktop.hyprland.plugins.hyproled] 182 | enable = false 183 | startWidth = 0 184 | startHeight = 0 185 | endWidth = 3440 186 | endHeight = 1440 187 | 188 | [icedos.hardware] 189 | bluetooth = true 190 | 191 | [[icedos.hardware.mounts]] 192 | path = "/" 193 | device = "/dev/disk/by-uuid/e2a8d4bf-b1fc-446f-b347-c3671eda1ccb" 194 | fsType = "btrfs" 195 | flags = ["compress=zstd", "nofail", "x-gvfs-show"] 196 | 197 | [[icedos.hardware.mounts]] 198 | path = "/mnt/games" 199 | device = "/dev/disk/by-uuid/040329ae-685d-4ba6-8bdd-e0a9785f9672" 200 | fsType = "btrfs" 201 | flags = ["compress=zstd", "nofail", "x-gvfs-show"] 202 | 203 | [[icedos.hardware.mounts]] 204 | path = "/mnt/games2" 205 | device = "/dev/disk/by-uuid/60876d91-f863-45db-88c5-4c707879588f" 206 | fsType = "btrfs" 207 | flags = ["compress=zstd", "nofail", "x-gvfs-show"] 208 | 209 | [[icedos.hardware.mounts]] 210 | path = "/mnt/storage" 211 | device = "/dev/disk/by-uuid/89730200-942d-4a5c-893f-0196c87435d2" 212 | fsType = "btrfs" 213 | flags = ["compress=zstd", "nofail", "x-gvfs-show"] 214 | 215 | [icedos.hardware.cpus] 216 | intel = false 217 | 218 | [icedos.hardware.cpus.amd] 219 | enable = true 220 | zenpower = true # Report watt usage for apps e.g. mangohud 221 | 222 | [icedos.hardware.cpus.amd.undervolt] 223 | enable = true 224 | value = "-p 0 -v 3C -f A0" # Pstate 0, 1.175 voltage, 4000 clock speed 225 | 226 | [icedos.hardware.devices] 227 | laptop = false 228 | server = false 229 | steamdeck = false 230 | 231 | [icedos.hardware.drivers] 232 | rtl8821ce = false # Use the unofficial RTL8821CE driver 233 | 234 | [icedos.hardware.graphics] 235 | enable = true 236 | 237 | [icedos.hardware.graphics.amd] 238 | enable = true 239 | rocm = true 240 | 241 | [icedos.hardware.graphics.mesa] 242 | unstable = true 243 | 244 | [icedos.hardware.graphics.nvidia] 245 | enable = false 246 | beta = false 247 | cuda = false 248 | openDrivers = true 249 | 250 | [icedos.hardware.graphics.nvidia.powerLimit] 251 | enable = true 252 | value = 242 253 | 254 | [[icedos.hardware.monitors]] 255 | name = "DP-2" 256 | disable = false 257 | resolution = "3440x1440" 258 | refreshRate = 144 259 | position = "3840x0" 260 | scaling = 1 261 | rotation = 0 262 | tenBit = false 263 | 264 | [[icedos.hardware.monitors]] 265 | name = "DP-1" 266 | disable = false 267 | resolution = "1920x1080" 268 | refreshRate = 144 269 | position = "7280x200" 270 | scaling = 1 271 | rotation = 0 272 | tenBit = false 273 | 274 | [[icedos.hardware.monitors]] 275 | name = "HDMI-A-1" 276 | disable = true 277 | resolution = "3840x2160" 278 | refreshRate = 60 279 | position = "0x0" 280 | scaling = 1 281 | rotation = 0 282 | tenBit = false 283 | 284 | [icedos.hardware.networking] 285 | hostname = "desktop" 286 | hosts = "" 287 | ipv6 = false 288 | vpnExcludeIp = "192.168.1.200" 289 | 290 | [icedos.hardware.networking.wg-quick] 291 | enable = true 292 | interfaces = ["protonvpn"] 293 | 294 | [icedos.system] 295 | channels = [] # https://github.com/NixOS/nixpkgs/branches/active 296 | forceFirstBuild = false 297 | home = "/home" 298 | kernel = "cachyos" # Options: 'cachyos', 'cachyos-server', 'latest', 'lts', 'valve', 'zen' 299 | swappiness = 1 300 | version = "23.05" # Do not change without checking the docs (config.system.stateVersion) 301 | 302 | [icedos.system.generations] 303 | bootEntries = 10 304 | 305 | [icedos.system.generations.garbageCollect] 306 | automatic = true 307 | days = 0 # Number of days before a generation can be deleted 308 | generations = 10 # Number of generations that will always be kept 309 | interval = "Mon *-*-* 00:00:00" # Format(https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html) 310 | 311 | [icedos.system.users.icedborn] 312 | description = "IceDBorn" 313 | type = "main" # Options: 'main', 'work' 314 | 315 | [icedos.system.users.icedborn.applications.codium] 316 | autoSave = "off" # Options: 'off', 'afterDelay', 'onFocusChange', 'onWindowChange' 317 | formatOnSave = true 318 | formatOnPaste = true 319 | 320 | [icedos.system.users.icedborn.applications.git] 321 | username = "IceDBorn" 322 | email = "git.outsider841@simplelogin.fr" 323 | 324 | 325 | [icedos.system.users.icedborn.desktop.gnome] 326 | startupScript = "" 327 | 328 | [icedos.system.users.icedborn.desktop.gnome.pinnedApps.arcmenu] 329 | enable = false 330 | list = ["codiumIDE.desktop", "codium.desktop"] 331 | 332 | # Set pinned apps for gnome shell (will be used by dash-to-panel if enabled) 333 | [icedos.system.users.icedborn.desktop.gnome.pinnedApps.shell] 334 | enable = false 335 | list = [ 336 | "steam.desktop", 337 | "webcord.desktop", 338 | "signal-desktop.desktop", 339 | "librewolf.desktop", 340 | ] 341 | 342 | [icedos.system.users.icedborn.desktop.idle.sd-inhibitor] 343 | enable = true 344 | 345 | [icedos.system.users.icedborn.desktop.idle.sd-inhibitor.watchers.cpu] 346 | enable = true 347 | threshold = 60 # CPU usage to inhibit lock in percentage 348 | 349 | [icedos.system.users.icedborn.desktop.idle.sd-inhibitor.watchers.disk] 350 | enable = true 351 | threshold = 10 # Disk usage to inhibit lock in MB/s 352 | 353 | [icedos.system.users.icedborn.desktop.idle.sd-inhibitor.watchers.network] 354 | enable = true 355 | threshold = 1_000_000 # Network usage to inhibit lock in bytes/s 356 | 357 | [icedos.system.users.icedborn.desktop.idle.sd-inhibitor.watchers.pipewire] 358 | enable = true 359 | inputsToIgnore = ["Noise Canceling source", "Peak detect", "cava"] 360 | outputsToIgnore = ["Discord", "Element"] 361 | 362 | [icedos.system.users.icedborn.desktop.idle.lock] 363 | enable = true 364 | seconds = 180 365 | 366 | [icedos.system.users.icedborn.desktop.idle.disableMonitors] 367 | enable = true 368 | seconds = 900 369 | 370 | [icedos.system.users.icedborn.desktop.idle.suspend] 371 | enable = true 372 | seconds = 1800 373 | 374 | [icedos.system.virtualisation] 375 | virtManager = false 376 | waydroid = false 377 | 378 | [icedos.system.virtualisation.containerManager] 379 | enable = false 380 | usePodman = true 381 | requireSudoForDocker = true # CAUTION: Disabling this gives every user root priviledges! 382 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "ags": { 4 | "inputs": { 5 | "astal": "astal", 6 | "nixpkgs": [ 7 | "hyprpanel", 8 | "nixpkgs" 9 | ] 10 | }, 11 | "locked": { 12 | "lastModified": 1744557573, 13 | "narHash": "sha256-XAyj0iDuI51BytJ1PwN53uLpzTDdznPDQFG4RwihlTQ=", 14 | "owner": "aylur", 15 | "repo": "ags", 16 | "rev": "3ed9737bdbc8fc7a7c7ceef2165c9109f336bff6", 17 | "type": "github" 18 | }, 19 | "original": { 20 | "owner": "aylur", 21 | "repo": "ags", 22 | "type": "github" 23 | } 24 | }, 25 | "astal": { 26 | "inputs": { 27 | "nixpkgs": [ 28 | "hyprpanel", 29 | "ags", 30 | "nixpkgs" 31 | ] 32 | }, 33 | "locked": { 34 | "lastModified": 1742571008, 35 | "narHash": "sha256-5WgfJAeBpxiKbTR/gJvxrGYfqQRge5aUDcGKmU1YZ1Q=", 36 | "owner": "aylur", 37 | "repo": "astal", 38 | "rev": "dc0e5d37abe9424c53dcbd2506a4886ffee6296e", 39 | "type": "github" 40 | }, 41 | "original": { 42 | "owner": "aylur", 43 | "repo": "astal", 44 | "type": "github" 45 | } 46 | }, 47 | "astal_2": { 48 | "inputs": { 49 | "nixpkgs": [ 50 | "hyprpanel", 51 | "nixpkgs" 52 | ] 53 | }, 54 | "locked": { 55 | "lastModified": 1748416910, 56 | "narHash": "sha256-FEQcs58HL8Fe4i7XlqVEUwthjxwvRvgX15gTTfW17sU=", 57 | "owner": "aylur", 58 | "repo": "astal", 59 | "rev": "c1bd89a47c81c66ab5fc6872db5a916c0433fb89", 60 | "type": "github" 61 | }, 62 | "original": { 63 | "owner": "aylur", 64 | "repo": "astal", 65 | "type": "github" 66 | } 67 | }, 68 | "chaotic": { 69 | "inputs": { 70 | "fenix": "fenix", 71 | "flake-schemas": "flake-schemas", 72 | "home-manager": "home-manager", 73 | "jovian": "jovian", 74 | "nixpkgs": "nixpkgs" 75 | }, 76 | "locked": { 77 | "lastModified": 1748984900, 78 | "narHash": "sha256-KkhT3GM3ABuwTJZs7COUc3S+YHWkfRraA1KNehGgqgs=", 79 | "owner": "chaotic-cx", 80 | "repo": "nyx", 81 | "rev": "12752a57a047d1894fcc12fb02b6b4571815aa39", 82 | "type": "github" 83 | }, 84 | "original": { 85 | "owner": "chaotic-cx", 86 | "ref": "nyxpkgs-unstable", 87 | "repo": "nyx", 88 | "type": "github" 89 | } 90 | }, 91 | "fenix": { 92 | "inputs": { 93 | "nixpkgs": [ 94 | "chaotic", 95 | "nixpkgs" 96 | ], 97 | "rust-analyzer-src": "rust-analyzer-src" 98 | }, 99 | "locked": { 100 | "lastModified": 1748932954, 101 | "narHash": "sha256-1HiKieYFvFi5Hw3x2/mptbbvAuL0QwlZQC9UIGNNb1w=", 102 | "owner": "nix-community", 103 | "repo": "fenix", 104 | "rev": "2da33335e40ca932b4c5ea632816eed573736fba", 105 | "type": "github" 106 | }, 107 | "original": { 108 | "owner": "nix-community", 109 | "repo": "fenix", 110 | "type": "github" 111 | } 112 | }, 113 | "flake-schemas": { 114 | "locked": { 115 | "lastModified": 1721999734, 116 | "narHash": "sha256-G5CxYeJVm4lcEtaO87LKzOsVnWeTcHGKbKxNamNWgOw=", 117 | "rev": "0a5c42297d870156d9c57d8f99e476b738dcd982", 118 | "revCount": 75, 119 | "type": "tarball", 120 | "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.5/0190ef2f-61e0-794b-ba14-e82f225e55e6/source.tar.gz" 121 | }, 122 | "original": { 123 | "type": "tarball", 124 | "url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%3D0.1.5.tar.gz" 125 | } 126 | }, 127 | "home-manager": { 128 | "inputs": { 129 | "nixpkgs": [ 130 | "chaotic", 131 | "nixpkgs" 132 | ] 133 | }, 134 | "locked": { 135 | "lastModified": 1748979197, 136 | "narHash": "sha256-mKYwYcO9RmA2AcAFIXGDBOw5iv/fbjw6adWvMbnfIuk=", 137 | "owner": "nix-community", 138 | "repo": "home-manager", 139 | "rev": "34a13086148cbb3ae65a79f753eb451ce5cac3d3", 140 | "type": "github" 141 | }, 142 | "original": { 143 | "owner": "nix-community", 144 | "repo": "home-manager", 145 | "type": "github" 146 | } 147 | }, 148 | "home-manager_2": { 149 | "inputs": { 150 | "nixpkgs": [ 151 | "zen-browser", 152 | "nixpkgs" 153 | ] 154 | }, 155 | "locked": { 156 | "lastModified": 1743604125, 157 | "narHash": "sha256-ZD61DNbsBt1mQbinAaaEqKaJk2RFo9R/j+eYWeGMx7A=", 158 | "owner": "nix-community", 159 | "repo": "home-manager", 160 | "rev": "180fd43eea296e62ae68e079fcf56aba268b9a1a", 161 | "type": "github" 162 | }, 163 | "original": { 164 | "owner": "nix-community", 165 | "repo": "home-manager", 166 | "type": "github" 167 | } 168 | }, 169 | "hyprpanel": { 170 | "inputs": { 171 | "ags": "ags", 172 | "astal": "astal_2", 173 | "nixpkgs": [ 174 | "nixpkgs" 175 | ] 176 | }, 177 | "locked": { 178 | "lastModified": 1748962037, 179 | "narHash": "sha256-MkrOyZ6CqTzzmlfmvkPiezy51hG96xqucrR38xQpK/0=", 180 | "owner": "Jas-SinghFSU", 181 | "repo": "HyprPanel", 182 | "rev": "8422c6b80526f8289a30b93cb5b354d9f007141d", 183 | "type": "github" 184 | }, 185 | "original": { 186 | "owner": "Jas-SinghFSU", 187 | "repo": "HyprPanel", 188 | "type": "github" 189 | } 190 | }, 191 | "jovian": { 192 | "inputs": { 193 | "nix-github-actions": "nix-github-actions", 194 | "nixpkgs": [ 195 | "chaotic", 196 | "nixpkgs" 197 | ] 198 | }, 199 | "locked": { 200 | "lastModified": 1748977211, 201 | "narHash": "sha256-VtL9IxQKMsGMD0jDoMMVeZLTxrPFt36MW43nkeXf1RM=", 202 | "owner": "Jovian-Experiments", 203 | "repo": "Jovian-NixOS", 204 | "rev": "4989543da0defdedce08b14945ec5d2f6e22abb8", 205 | "type": "github" 206 | }, 207 | "original": { 208 | "owner": "Jovian-Experiments", 209 | "repo": "Jovian-NixOS", 210 | "type": "github" 211 | } 212 | }, 213 | "nerivations": { 214 | "inputs": { 215 | "nixpkgs": [ 216 | "nixpkgs" 217 | ] 218 | }, 219 | "locked": { 220 | "lastModified": 1748980475, 221 | "narHash": "sha256-rEWcXAgH+h3roY1qYA8+9g5icg27Nfmdrvn9qvZNqEc=", 222 | "owner": "icedborn", 223 | "repo": "nerivations", 224 | "rev": "7c3f3353b2fb30a08a038c8cf46749ba6388b455", 225 | "type": "github" 226 | }, 227 | "original": { 228 | "owner": "icedborn", 229 | "repo": "nerivations", 230 | "type": "github" 231 | } 232 | }, 233 | "nix-github-actions": { 234 | "inputs": { 235 | "nixpkgs": [ 236 | "chaotic", 237 | "jovian", 238 | "nixpkgs" 239 | ] 240 | }, 241 | "locked": { 242 | "lastModified": 1729697500, 243 | "narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=", 244 | "owner": "zhaofengli", 245 | "repo": "nix-github-actions", 246 | "rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf", 247 | "type": "github" 248 | }, 249 | "original": { 250 | "owner": "zhaofengli", 251 | "ref": "matrix-name", 252 | "repo": "nix-github-actions", 253 | "type": "github" 254 | } 255 | }, 256 | "nixpkgs": { 257 | "locked": { 258 | "lastModified": 1748693115, 259 | "narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=", 260 | "owner": "NixOS", 261 | "repo": "nixpkgs", 262 | "rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc", 263 | "type": "github" 264 | }, 265 | "original": { 266 | "owner": "NixOS", 267 | "ref": "nixos-unstable", 268 | "repo": "nixpkgs", 269 | "type": "github" 270 | } 271 | }, 272 | "root": { 273 | "inputs": { 274 | "chaotic": "chaotic", 275 | "home-manager": [ 276 | "chaotic", 277 | "home-manager" 278 | ], 279 | "hyprpanel": "hyprpanel", 280 | "nerivations": "nerivations", 281 | "nixpkgs": [ 282 | "chaotic", 283 | "nixpkgs" 284 | ], 285 | "zen-browser": "zen-browser" 286 | } 287 | }, 288 | "rust-analyzer-src": { 289 | "flake": false, 290 | "locked": { 291 | "lastModified": 1748871544, 292 | "narHash": "sha256-7V/sV6JiEp8LFmGIG3OqFDU2YNHgmodg1qNKGYXZKIY=", 293 | "owner": "rust-lang", 294 | "repo": "rust-analyzer", 295 | "rev": "25808c1ba14627876c9a031a67f404ac1927887d", 296 | "type": "github" 297 | }, 298 | "original": { 299 | "owner": "rust-lang", 300 | "ref": "nightly", 301 | "repo": "rust-analyzer", 302 | "type": "github" 303 | } 304 | }, 305 | "zen-browser": { 306 | "inputs": { 307 | "home-manager": "home-manager_2", 308 | "nixpkgs": [ 309 | "nixpkgs" 310 | ] 311 | }, 312 | "locked": { 313 | "lastModified": 1748920570, 314 | "narHash": "sha256-m7EshkqPxa3IxN/qwxP1LlMlRdn37aiK0hghDieho8A=", 315 | "owner": "0xc000022070", 316 | "repo": "zen-browser-flake", 317 | "rev": "ff5bf0bcf588e8c1d0f5fcd635b0c8e1cce8aee5", 318 | "type": "github" 319 | }, 320 | "original": { 321 | "owner": "0xc000022070", 322 | "repo": "zen-browser-flake", 323 | "type": "github" 324 | } 325 | } 326 | }, 327 | "root": "root", 328 | "version": 7 329 | } 330 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs = { 3 | # Package repositories 4 | chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; 5 | 6 | nixpkgs.follows = "chaotic/nixpkgs"; 7 | 8 | # Modules 9 | home-manager = { 10 | url = "github:nix-community/home-manager"; 11 | 12 | follows = "chaotic/home-manager"; 13 | 14 | }; 15 | 16 | nerivations = { 17 | url = "github:icedborn/nerivations"; 18 | inputs.nixpkgs.follows = "nixpkgs"; 19 | }; 20 | 21 | # Apps 22 | 23 | hyprpanel = { 24 | url = "github:Jas-SinghFSU/HyprPanel"; 25 | inputs.nixpkgs.follows = "nixpkgs"; 26 | }; 27 | 28 | zen-browser = { 29 | url = "github:0xc000022070/zen-browser-flake"; 30 | inputs.nixpkgs.follows = "nixpkgs"; 31 | }; 32 | 33 | }; 34 | 35 | outputs = 36 | { 37 | home-manager, 38 | nerivations, 39 | nixpkgs, 40 | self, 41 | 42 | hyprpanel, 43 | chaotic, 44 | 45 | zen-browser, 46 | ... 47 | }@inputs: 48 | { 49 | nixosConfigurations."desktop" = nixpkgs.lib.nixosSystem rec { 50 | system = "x86_64-linux"; 51 | 52 | specialArgs = { 53 | inherit inputs; 54 | }; 55 | 56 | modules = [ 57 | # Read configuration location 58 | ( 59 | { lib, ... }: 60 | let 61 | inherit (lib) mkOption types; 62 | in 63 | { 64 | options.icedos.configurationLocation = mkOption { 65 | type = types.str; 66 | default = "/home/icedborn/.code/icedos"; 67 | }; 68 | } 69 | ) 70 | 71 | # Symlink configuration state on "/run/current-system/source" 72 | { 73 | # Source: https://github.com/NixOS/nixpkgs/blob/5e4fbfb6b3de1aa2872b76d49fafc942626e2add/nixos/modules/system/activation/top-level.nix#L191 74 | system.extraSystemBuilderCmds = "ln -s ${self} $out/source"; 75 | } 76 | 77 | # Internal modules 78 | ( 79 | { lib, ... }: 80 | let 81 | inherit (lib) filterAttrs; 82 | 83 | getModules = 84 | path: 85 | map (dir: "/${path}/${dir}") ( 86 | let 87 | inherit (lib) attrNames; 88 | in 89 | attrNames ( 90 | filterAttrs (n: v: v == "directory" && !(n == "desktop" && path == ./system)) ( 91 | builtins.readDir path 92 | ) 93 | ) 94 | ); 95 | in 96 | { 97 | imports = 98 | [ 99 | ./hardware 100 | ./internals.nix 101 | ./options.nix 102 | ] 103 | ++ getModules (./system) 104 | ++ getModules (./hardware); 105 | 106 | config.system.stateVersion = "23.05"; 107 | } 108 | ) 109 | 110 | # External modules 111 | chaotic.nixosModules.default 112 | ./hardware/graphics/modules/mesa 113 | 114 | home-manager.nixosModules.home-manager 115 | nerivations.nixosModules.default 116 | 117 | ./system/desktop 118 | 119 | # Is First Build 120 | { icedos.internals.isFirstBuild = false; } 121 | 122 | ./system/desktop/hyprland 123 | { nixpkgs.overlays = [ hyprpanel.overlay ]; } 124 | 125 | ./system/applications/modules/zen-browser 126 | 127 | ./system/users/icedborn 128 | 129 | ( 130 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 131 | # and may be overwritten by future invocations. Please make changes 132 | # to /etc/nixos/configuration.nix instead. 133 | { 134 | config, 135 | lib, 136 | pkgs, 137 | modulesPath, 138 | ... 139 | }: 140 | 141 | { 142 | imports = [ 143 | (modulesPath + "/installer/scan/not-detected.nix") 144 | ]; 145 | 146 | boot.initrd.availableKernelModules = [ 147 | "nvme" 148 | "xhci_pci" 149 | "ahci" 150 | "usb_storage" 151 | "usbhid" 152 | "sd_mod" 153 | ]; 154 | boot.initrd.kernelModules = [ ]; 155 | boot.kernelModules = [ "kvm-amd" ]; 156 | boot.extraModulePackages = [ ]; 157 | boot.initrd.luks.devices."luks-8e034466-adc7-4f83-81cd-4ceb2397eb2d".device = 158 | "/dev/disk/by-uuid/8e034466-adc7-4f83-81cd-4ceb2397eb2d"; 159 | 160 | fileSystems."/" = { 161 | device = "/dev/disk/by-uuid/e2a8d4bf-b1fc-446f-b347-c3671eda1ccb"; 162 | fsType = "btrfs"; 163 | options = [ "subvol=@" ]; 164 | }; 165 | 166 | boot.initrd.luks.devices."luks-ab2a2fb9-08aa-4c27-ab62-a1581a0113ff".device = 167 | "/dev/disk/by-uuid/ab2a2fb9-08aa-4c27-ab62-a1581a0113ff"; 168 | 169 | fileSystems."/boot" = { 170 | device = "/dev/disk/by-uuid/1456-AC74"; 171 | fsType = "vfat"; 172 | }; 173 | 174 | swapDevices = [ 175 | { device = "/dev/disk/by-uuid/a642dc73-75f4-425f-8cc9-cbef30039563"; } 176 | ]; 177 | 178 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 179 | # (the default) this is the recommended approach. When using systemd-networkd it's 180 | # still possible to use this option, but it's recommended to use it in conjunction 181 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`. 182 | networking.useDHCP = lib.mkDefault true; 183 | # networking.interfaces.enp9s0.useDHCP = lib.mkDefault true; 184 | 185 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 186 | hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 187 | } 188 | ) 189 | 190 | ]; 191 | }; 192 | }; 193 | } 194 | -------------------------------------------------------------------------------- /genflake.nix: -------------------------------------------------------------------------------- 1 | let 2 | inherit (lib) 3 | attrNames 4 | boolToString 5 | concatImapStrings 6 | fileContents 7 | pathExists 8 | ; 9 | 10 | cfg = (import ./options.nix { inherit lib; }).config.icedos; 11 | lib = import ; 12 | 13 | aagl = cfg.applications.aagl; 14 | channels = cfg.system.channels; 15 | configurationLocation = fileContents "/tmp/configuration-location"; 16 | gnome = cfg.desktop.gnome.enable; 17 | hyprland = cfg.desktop.hyprland.enable; 18 | isFirstBuild = !pathExists "/run/current-system/source" || cfg.system.forceFirstBuild; 19 | 20 | chaotic = ( 21 | cfg.hardware.graphics.mesa.unstable 22 | || cfg.system.kernel == "cachyos" 23 | || cfg.system.kernel == "cachyos-server" 24 | || cfg.system.kernel == "valve" 25 | || steam-session 26 | ); 27 | 28 | librewolf = cfg.applications.librewolf; 29 | server = cfg.hardware.devices.server; 30 | steam-session = cfg.applications.steam.session.enable; 31 | users = attrNames cfg.system.users; 32 | zen-browser = cfg.applications.zen-browser.enable; 33 | 34 | injectIfExists = 35 | file: 36 | if (pathExists file) then 37 | '' 38 | ( 39 | ${fileContents file} 40 | ) 41 | '' 42 | else 43 | ""; 44 | in 45 | { 46 | flake.nix = '' 47 | { 48 | inputs = { 49 | # Package repositories 50 | ${ 51 | if (chaotic) then 52 | '' 53 | chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; 54 | '' 55 | else 56 | "" 57 | } 58 | 59 | nixpkgs.${ 60 | if (chaotic) then 61 | ''follows = "chaotic/nixpkgs";'' 62 | else 63 | ''url = "github:NixOS/nixpkgs/nixos-unstable";'' 64 | } 65 | 66 | ${concatImapStrings ( 67 | i: channel: ''"${channel}".url = github:NixOS/nixpkgs/${channel};''\n'' 68 | ) channels} 69 | 70 | # Modules 71 | home-manager = { 72 | url = "github:nix-community/home-manager"; 73 | 74 | ${ 75 | if (chaotic) then 76 | '' 77 | follows = "chaotic/home-manager"; 78 | '' 79 | else 80 | '' 81 | inputs.nixpkgs.follows = "nixpkgs"; 82 | '' 83 | } 84 | }; 85 | 86 | nerivations = { 87 | url = "github:icedborn/nerivations"; 88 | inputs.nixpkgs.follows = "nixpkgs"; 89 | }; 90 | 91 | ${ 92 | if (cfg.system.kernel == "valve" || steam-session) then 93 | '' 94 | steam-session.follows = "chaotic/jovian"; 95 | '' 96 | else 97 | "" 98 | } 99 | 100 | # Apps 101 | ${ 102 | if (aagl) then 103 | '' 104 | aagl = { 105 | url = "github:ezKEa/aagl-gtk-on-nix"; 106 | inputs.nixpkgs.follows = "nixpkgs"; 107 | }; 108 | '' 109 | else 110 | "" 111 | } 112 | 113 | ${ 114 | if (hyprland) then 115 | '' 116 | hyprpanel = { 117 | url = "github:Jas-SinghFSU/HyprPanel"; 118 | inputs.nixpkgs.follows = "nixpkgs"; 119 | }; 120 | '' 121 | else 122 | "" 123 | } 124 | 125 | ${ 126 | if (librewolf) then 127 | '' 128 | pipewire-screenaudio = { 129 | url = "github:IceDBorn/pipewire-screenaudio"; 130 | inputs.nixpkgs.follows = "nixpkgs"; 131 | }; 132 | '' 133 | else 134 | "" 135 | } 136 | 137 | ${ 138 | if (zen-browser) then 139 | '' 140 | zen-browser = { 141 | url = "github:0xc000022070/zen-browser-flake"; 142 | inputs.nixpkgs.follows = "nixpkgs"; 143 | }; 144 | '' 145 | else 146 | "" 147 | } 148 | }; 149 | 150 | outputs = 151 | { 152 | home-manager, 153 | nerivations, 154 | nixpkgs, 155 | self, 156 | ${if (aagl) then ''aagl,'' else ""} 157 | ${if (hyprland) then ''hyprpanel,'' else ""} 158 | ${if (chaotic) then ''chaotic,'' else ""} 159 | ${if (librewolf) then ''pipewire-screenaudio,'' else ""} 160 | ${if (steam-session) then ''steam-session,'' else ""} 161 | ${if (zen-browser) then ''zen-browser,'' else ""} 162 | ... 163 | }@inputs: 164 | { 165 | nixosConfigurations."${fileContents "/etc/hostname"}" = nixpkgs.lib.nixosSystem rec { 166 | system = "x86_64-linux"; 167 | 168 | specialArgs = { 169 | inherit inputs; 170 | }; 171 | 172 | modules = [ 173 | # Read configuration location 174 | ( 175 | { lib, ... }: 176 | let 177 | inherit (lib) mkOption types; 178 | in 179 | { 180 | options.icedos.configurationLocation = mkOption { 181 | type = types.str; 182 | default = "${configurationLocation}"; 183 | }; 184 | } 185 | ) 186 | 187 | # Symlink configuration state on "/run/current-system/source" 188 | { 189 | # Source: https://github.com/NixOS/nixpkgs/blob/5e4fbfb6b3de1aa2872b76d49fafc942626e2add/nixos/modules/system/activation/top-level.nix#L191 190 | system.extraSystemBuilderCmds = "ln -s ''${self} $out/source"; 191 | } 192 | 193 | # Internal modules 194 | ( 195 | { lib, ... }: 196 | let 197 | inherit (lib) filterAttrs; 198 | 199 | getModules = 200 | path: 201 | map (dir: "/''${path}/''${dir}") ( let 202 | inherit (lib) attrNames; 203 | in 204 | attrNames (filterAttrs (n: v: v == "directory" && !(n == "desktop" && path == ./system)) (builtins.readDir path)) 205 | ); 206 | in 207 | { 208 | imports = [ 209 | ./hardware 210 | ./internals.nix 211 | ./options.nix 212 | ] ++ getModules (./system) ++ getModules (./hardware); 213 | 214 | config.system.stateVersion = "${cfg.system.version}"; 215 | } 216 | ) 217 | 218 | # External modules 219 | ${ 220 | if (chaotic) then 221 | '' 222 | chaotic.nixosModules.default 223 | ./hardware/graphics/modules/mesa 224 | '' 225 | else 226 | "" 227 | } 228 | 229 | home-manager.nixosModules.home-manager 230 | nerivations.nixosModules.default 231 | 232 | ${concatImapStrings (i: channel: '' 233 | ( 234 | {config, ...}: { 235 | nixpkgs.config.packageOverrides."${channel}" = import inputs."${channel}" { 236 | inherit system; 237 | config = config.nixpkgs.config; 238 | }; 239 | } 240 | ) 241 | '') channels} 242 | 243 | ${ 244 | if (!server) then 245 | '' 246 | ./system/desktop 247 | '' 248 | else 249 | "" 250 | } 251 | 252 | # Is First Build 253 | { icedos.internals.isFirstBuild = ${boolToString (isFirstBuild)}; } 254 | 255 | ${ 256 | if (steam-session && !isFirstBuild) then 257 | '' 258 | steam-session.nixosModules.default 259 | ./system/desktop/steam-session 260 | '' 261 | else 262 | "" 263 | } 264 | 265 | ${ 266 | if (aagl) then 267 | '' 268 | aagl.nixosModules.default 269 | { 270 | nix.settings = aagl.nixConfig; # Set up Cachix 271 | programs.anime-game-launcher.enable = true; # Adds launcher and /etc/hosts rules 272 | } 273 | '' 274 | else 275 | "" 276 | } 277 | 278 | ${ 279 | if (hyprland) then 280 | '' 281 | ./system/desktop/hyprland 282 | { nixpkgs.overlays = [ hyprpanel.overlay ]; } 283 | '' 284 | else 285 | "" 286 | } 287 | 288 | ${ 289 | if (gnome) then 290 | '' 291 | ./system/desktop/gnome 292 | '' 293 | else 294 | "" 295 | } 296 | 297 | ${if (zen-browser) then "./system/applications/modules/zen-browser" else ""} 298 | 299 | ${concatImapStrings ( 300 | i: user: 301 | if (pathExists "${configurationLocation}/system/users/${user}") then 302 | "./system/users/${user}\n" 303 | else 304 | "" 305 | ) users} 306 | 307 | ${injectIfExists "/etc/nixos/hardware-configuration.nix"} 308 | ${injectIfExists "/etc/nixos/extras.nix"} 309 | ]; 310 | }; 311 | }; 312 | } 313 | ''; 314 | } 315 | -------------------------------------------------------------------------------- /hardware/android-tools/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs mkIf; 10 | cfg = config.icedos; 11 | in 12 | mkIf (cfg.applications.android-tools) { 13 | environment.systemPackages = [ pkgs.scrcpy ]; 14 | programs.adb.enable = true; 15 | 16 | users.users = mapAttrs (user: _: { 17 | extraGroups = [ "adbusers" ]; 18 | }) cfg.system.users; 19 | } 20 | -------------------------------------------------------------------------------- /hardware/bluetooth/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mkIf; 10 | cfg = config.icedos; 11 | in 12 | mkIf (cfg.hardware.bluetooth) { 13 | environment.systemPackages = mkIf (cfg.desktop.hyprland.enable) [ pkgs.blueberry ]; 14 | hardware.bluetooth.enable = true; 15 | } 16 | -------------------------------------------------------------------------------- /hardware/bootloader/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) mkIf; 9 | cfg = config.icedos; 10 | in 11 | { 12 | boot = { 13 | loader = { 14 | efi = mkIf (cfg.bootloader.systemd-boot.enable) { 15 | canTouchEfiVariables = true; 16 | efiSysMountPoint = cfg.bootloader.systemd-boot.mountPoint; 17 | }; 18 | 19 | grub = mkIf (cfg.bootloader.grub.enable) { 20 | enable = true; 21 | device = cfg.bootloader.grub.device; 22 | useOSProber = true; 23 | enableCryptodisk = true; 24 | configurationLimit = 10; 25 | }; 26 | 27 | systemd-boot = mkIf (cfg.bootloader.systemd-boot.enable) { 28 | enable = true; 29 | configurationLimit = cfg.system.generations.bootEntries; 30 | # Select the highest resolution for the bootloader 31 | consoleMode = "max"; 32 | }; 33 | 34 | # Boot default entry after 1 second 35 | timeout = 1; 36 | }; 37 | 38 | initrd.secrets = mkIf (cfg.bootloader.grub.enable) { "/crypto_keyfile.bin" = null; }; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /hardware/deckbd-wrapper/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mkIf; 10 | cfg = config.icedos; 11 | deckbd = "${pkgs.deckbd}/bin/deckbd"; 12 | in 13 | mkIf (cfg.hardware.devices.steamdeck) { 14 | boot.initrd = { 15 | preLVMCommands = '' 16 | DECKBD_RETRIES=10 17 | while true; do 18 | ${deckbd} query && break 19 | if [ "$DECKBD_RETRIES" -eq "0" ]; then break; fi 20 | sleep 1 21 | 22 | if [ "$DECKBD_RETRIES" -eq "1" ]; then 23 | echo -en "\rwaiting for deck controller to appear, $DECKBD_RETRIES retry remaining... " 24 | else 25 | echo -en "\rwaiting for deck controller to appear, $DECKBD_RETRIES retries remaining..." 26 | fi 27 | DECKBD_RETRIES=$((DECKBD_RETRIES - 1)) 28 | done 29 | 30 | if [ ! "$DECKBD_RETRIES" -eq "0" ]; then 31 | echo -en "\nstarting deckbd...\n" 32 | ${deckbd} & 33 | DECKBD_PID=$! 34 | fi 35 | ''; 36 | 37 | postMountCommands = '' 38 | [ $DECKBD_PID ] && kill $DECKBD_PID 39 | ''; 40 | 41 | kernelModules = [ 42 | "uinput" 43 | "evdev" 44 | "hid_steam" 45 | ]; 46 | }; 47 | 48 | environment.systemPackages = mkIf (cfg.applications.steam.session.enable) [ 49 | pkgs.steamdeck-firmware 50 | ]; 51 | } 52 | -------------------------------------------------------------------------------- /hardware/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | ... 4 | }: 5 | 6 | let 7 | cfg = config.icedos; 8 | in 9 | { 10 | hardware = { 11 | enableAllFirmware = true; 12 | uinput.enable = true; # Enable uinput support 13 | }; 14 | 15 | # Set memory limits 16 | security.pam.loginLimits = [ 17 | { 18 | domain = "*"; 19 | type = "hard"; 20 | item = "memlock"; 21 | value = "2147483648"; 22 | } 23 | 24 | { 25 | domain = "*"; 26 | type = "soft"; 27 | item = "memlock"; 28 | value = "2147483648"; 29 | } 30 | ]; 31 | 32 | networking = { 33 | extraHosts = cfg.hardware.networking.hosts; 34 | hostName = "${cfg.hardware.networking.hostname}"; 35 | }; 36 | 37 | services = { 38 | fstrim.enable = true; # Enable SSD TRIM 39 | upower.enable = true; # Enable power management 40 | }; 41 | 42 | zramSwap = { 43 | enable = true; 44 | memoryPercent = 10; 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /hardware/graphics/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) filterAttrs attrNames; 9 | cfg = config.icedos; 10 | 11 | getModules = 12 | path: 13 | map (dir: ./. + ("/modules/" + dir)) ( 14 | attrNames (filterAttrs (n: v: v == "directory" && !(n == "mesa")) (builtins.readDir path)) 15 | ); 16 | in 17 | { 18 | imports = getModules (./modules); 19 | 20 | hardware.graphics = { 21 | enable = cfg.hardware.graphics.enable; 22 | enable32Bit = true; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /hardware/graphics/modules/mesa/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | ... 4 | }: 5 | 6 | let 7 | cfg = config.icedos; 8 | in 9 | { 10 | chaotic.mesa-git.enable = cfg.hardware.graphics.mesa.unstable; 11 | } 12 | -------------------------------------------------------------------------------- /hardware/graphics/modules/nvidia/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mkIf; 10 | cfg = config.icedos; 11 | graphics = cfg.hardware.graphics; 12 | powerLimit = graphics.nvidia.powerLimit; 13 | nvidia_x11 = config.boot.kernelPackages.nvidia_x11.bin; 14 | in 15 | mkIf (graphics.enable && graphics.nvidia.enable) { 16 | services.xserver.videoDrivers = [ "nvidia" ]; # Install the nvidia drivers 17 | 18 | hardware.nvidia = { 19 | modesetting.enable = true; 20 | open = graphics.nvidia.openDrivers; 21 | 22 | package = 23 | if (graphics.nvidia.beta) then 24 | config.boot.kernelPackages.nvidiaPackages.beta 25 | else 26 | config.boot.kernelPackages.nvidiaPackages.stable; 27 | 28 | prime = mkIf (cfg.hardware.devices.laptop) { 29 | offload.enable = true; 30 | intelBusId = "PCI:0:2:0"; 31 | nvidiaBusId = "PCI:1:0:0"; 32 | }; 33 | }; 34 | 35 | # Enable nvidia gpu acceleration for containers 36 | virtualisation.docker.enableNvidia = ( 37 | cfg.system.virtualisation.containerManager.enable 38 | && !cfg.system.virtualisation.containerManager.usePodman 39 | ); 40 | 41 | virtualisation.podman.enableNvidia = ( 42 | cfg.system.virtualisation.containerManager.enable 43 | && cfg.system.virtualisation.containerManager.usePodman 44 | ); 45 | 46 | icedos.internals.toolset.commands = mkIf (cfg.hardware.devices.laptop) [ 47 | ( 48 | let 49 | command = "force-nvidia"; 50 | in 51 | { 52 | bin = "${pkgs.writeShellScript command '' 53 | export __NV_PRIME_RENDER_OFFLOAD=1 54 | export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 55 | export __GLX_VENDOR_LIBRARY_NAME=nvidia 56 | export __VK_LAYER_NV_optimus=NVIDIA_only 57 | exec "$@" 58 | ''}"; 59 | 60 | command = command; 61 | help = "forces command to use nvidia gpu"; 62 | } 63 | ) 64 | ]; 65 | 66 | nixpkgs.config.cudaSupport = graphics.nvidia.cuda; 67 | 68 | # Set nvidia gpu power limit 69 | systemd.services.nv-power-limit = mkIf (powerLimit.enable) { 70 | enable = true; 71 | description = "Nvidia power limit control"; 72 | after = [ 73 | "syslog.target" 74 | "systemd-modules-load.service" 75 | ]; 76 | 77 | unitConfig = { 78 | ConditionPathExists = "${nvidia_x11}/bin/nvidia-smi"; 79 | }; 80 | 81 | serviceConfig = { 82 | User = "root"; 83 | ExecStart = "${nvidia_x11}/bin/nvidia-smi --power-limit=${toString (powerLimit.value)}"; 84 | }; 85 | 86 | wantedBy = [ "multi-user.target" ]; 87 | }; 88 | } 89 | -------------------------------------------------------------------------------- /hardware/graphics/modules/radeon/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) mkIf; 9 | cfg = config.icedos.hardware.graphics; 10 | in 11 | mkIf (cfg.enable && cfg.amd.enable) { 12 | boot = { 13 | initrd.kernelModules = [ "amdgpu" ]; 14 | kernelParams = [ "amdgpu.ppfeaturemask=0xffffffff" ]; 15 | }; 16 | 17 | nixpkgs.config.rocmSupport = cfg.amd.rocm; 18 | } 19 | -------------------------------------------------------------------------------- /hardware/intel/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | ... 4 | }: 5 | 6 | let 7 | cfg = config.icedos.hardware.cpus.intel; 8 | in 9 | { 10 | hardware.cpu.intel.updateMicrocode = cfg; 11 | services.throttled.enable = cfg; 12 | } 13 | -------------------------------------------------------------------------------- /hardware/kernel/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) 10 | concatMapStrings 11 | length 12 | optionals 13 | ; 14 | 15 | cfg = config.icedos; 16 | 17 | kernel = 18 | cfg.system.kernel == "cachyos" 19 | || cfg.system.kernel == "cachyos-server" 20 | || cfg.system.kernel == "valve"; 21 | 22 | monitors = cfg.hardware.monitors; 23 | noMonitors = length (monitors) == 0; 24 | in 25 | { 26 | boot = { 27 | kernelPackages = 28 | with pkgs; 29 | if (cfg.internals.isFirstBuild && kernel) then 30 | linuxPackages 31 | else 32 | { 33 | cachyos = linuxPackages_cachyos; 34 | cachyos-server = linuxPackages_cachyos-server; 35 | latest = linuxPackages_latest; 36 | lts = linuxPackages; 37 | valve = linuxPackages_jovian; 38 | zen = linuxPackages_zen; 39 | } 40 | .${cfg.system.kernel}; 41 | 42 | kernelParams = 43 | [ 44 | "transparent_hugepage=always" 45 | # Disables UMIP which fixes certain games from crashing on launch 46 | "clearcpuid=514" 47 | ] 48 | ++ optionals (!noMonitors) [ 49 | (concatMapStrings ( 50 | m: 51 | let 52 | name = m.name; 53 | resolution = m.resolution; 54 | bitDepth = if (m.tenBit) then "-30" else ""; 55 | refreshRate = toString (m.refreshRate); 56 | rotation = toString (m.rotation); 57 | in 58 | "video=${name}:${resolution}${bitDepth}@${refreshRate},rotate=${rotation}" 59 | ) monitors) 60 | ]; 61 | 62 | kernel.sysctl = { 63 | "net.ipv6.conf.all.disable_ipv6" = !cfg.hardware.networking.ipv6; # Disable ipv6 for all interfaces 64 | "page-cluster" = 1; 65 | "vm.compaction_proactiveness" = 0; 66 | "vm.max_map_count" = 1048576; # Fixes crashes or start-up issues for games 67 | "vm.page_lock_unfairness" = 1; 68 | "vm.swappiness" = toString (cfg.system.swappiness); # Set agressiveness of swap usage 69 | }; 70 | }; 71 | 72 | # More sysctl params to set 73 | system.activationScripts.sysfs.text = '' 74 | echo advise > /sys/kernel/mm/transparent_hugepage/shmem_enabled 75 | echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag 76 | ''; 77 | } 78 | -------------------------------------------------------------------------------- /hardware/mounts/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) listToAttrs; 9 | cfg = config.icedos.hardware; 10 | in 11 | { 12 | fileSystems = listToAttrs ( 13 | map (mount: { 14 | name = mount.path; 15 | 16 | value = { 17 | device = mount.device; 18 | fsType = mount.fsType; 19 | options = mount.flags; 20 | }; 21 | }) cfg.mounts 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /hardware/rtl8821ce/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) mkIf; 9 | cfg = config.icedos.hardware.drivers; 10 | in 11 | mkIf (cfg.rtl8821ce) { 12 | boot = { 13 | extraModulePackages = with config.boot.kernelPackages; [ rtl8821ce ]; 14 | blacklistedKernelModules = [ "rtw88_8821ce" ]; 15 | kernelModules = [ "rtl8821ce" ]; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /hardware/ryzen/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mkIf optional; 10 | cfg = config.icedos.hardware.cpus.amd; 11 | in 12 | mkIf (cfg.enable) { 13 | boot = { 14 | kernelParams = [ 15 | "amd-pstate=active" 16 | "amd_pstate.shared_mem=1" 17 | ]; 18 | 19 | kernelModules = [ 20 | "amd-pstate" 21 | "msr" 22 | ] ++ optional cfg.zenpower "zenpower"; 23 | 24 | extraModulePackages = with config.boot.kernelPackages; mkIf (cfg.zenpower) [ zenpower ]; 25 | }; 26 | 27 | environment.systemPackages = mkIf (cfg.undervolt.enable) [ 28 | pkgs.zenstates 29 | ]; 30 | 31 | hardware.cpu.amd.updateMicrocode = true; 32 | 33 | # Ryzen cpu control 34 | systemd.services.zenstates = mkIf (cfg.undervolt.enable) { 35 | enable = true; 36 | description = "Ryzen Undervolt"; 37 | after = [ 38 | "syslog.target" 39 | "systemd-modules-load.service" 40 | ]; 41 | 42 | unitConfig = { 43 | ConditionPathExists = "${pkgs.zenstates}/bin/zenstates"; 44 | }; 45 | 46 | serviceConfig = { 47 | User = "root"; 48 | ExecStart = "${pkgs.zenstates}/bin/zenstates ${cfg.undervolt.value}"; 49 | }; 50 | 51 | wantedBy = [ "multi-user.target" ]; 52 | }; 53 | } 54 | -------------------------------------------------------------------------------- /internals.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) mkOption types; 9 | cfg = config.icedos; 10 | 11 | mkStrOption = 12 | default: 13 | mkOption { 14 | type = types.str; 15 | default = default; 16 | }; 17 | 18 | mkBoolOption = default: mkOption { type = types.bool; }; 19 | 20 | mkSubmoduleListOption = 21 | options: 22 | mkOption { 23 | type = types.listOf ( 24 | types.submodule { 25 | options = options; 26 | } 27 | ); 28 | }; 29 | in 30 | { 31 | options.icedos.internals = { 32 | accentColor = mkStrOption ( 33 | if (!cfg.desktop.gnome.enable) then 34 | "#${cfg.desktop.accentColor}" 35 | else 36 | { 37 | blue = "#3584e4"; 38 | green = "#3a944a"; 39 | orange = "#ed5b00"; 40 | pink = "#d56199"; 41 | purple = "#9141ac"; 42 | red = "#e62d42"; 43 | slate = "#6f8396"; 44 | teal = "#2190a4"; 45 | yellow = "#c88800"; 46 | } 47 | .${cfg.desktop.gnome.accentColor} 48 | ); 49 | 50 | isFirstBuild = mkBoolOption (false); 51 | 52 | toolset.commands = mkSubmoduleListOption ({ 53 | bin = mkStrOption (""); 54 | command = mkStrOption (""); 55 | help = mkStrOption (""); 56 | }); 57 | }; 58 | } 59 | -------------------------------------------------------------------------------- /options.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | ... 4 | }: 5 | 6 | let 7 | inherit (lib) fileContents mkOption types; 8 | mkBoolOption = mkOption { type = types.bool; }; 9 | mkLinesOption = mkOption { type = types.lines; }; 10 | mkNumberOption = mkOption { type = types.number; }; 11 | mkStrListOption = mkOption { type = with types; listOf str; }; 12 | mkStrOption = mkOption { type = types.str; }; 13 | 14 | mkSubmoduleAttrsOption = 15 | options: 16 | mkOption { 17 | type = types.attrsOf ( 18 | types.submodule { 19 | options = options; 20 | } 21 | ); 22 | }; 23 | 24 | mkSubmoduleListOption = 25 | options: 26 | mkOption { 27 | type = types.listOf ( 28 | types.submodule { 29 | options = options; 30 | } 31 | ); 32 | }; 33 | in 34 | { 35 | options = { 36 | icedos = { 37 | applications = { 38 | aagl = mkBoolOption; 39 | android-tools = mkBoolOption; 40 | celluloid = mkBoolOption; 41 | clamav = mkBoolOption; 42 | 43 | codium = { 44 | enable = mkBoolOption; 45 | zoomLevel = mkNumberOption; 46 | }; 47 | 48 | defaultBrowser = mkStrOption; 49 | defaultEditor = mkStrOption; 50 | extraPackages = mkStrListOption; 51 | input-remapper = mkBoolOption; 52 | insecurePackages = mkStrListOption; 53 | 54 | kitty = { 55 | enable = mkBoolOption; 56 | hideDecorations = mkBoolOption; 57 | }; 58 | 59 | lact = mkBoolOption; 60 | librewolf = mkBoolOption; 61 | 62 | mangohud = { 63 | enable = mkBoolOption; 64 | maxFpsLimit = mkNumberOption; 65 | }; 66 | 67 | mission-center = mkBoolOption; 68 | nautilus = mkBoolOption; 69 | 70 | network-manager = { 71 | enable = mkBoolOption; 72 | applet = mkBoolOption; 73 | }; 74 | 75 | obs-studio = { 76 | enable = mkBoolOption; 77 | virtualCamera = mkBoolOption; 78 | }; 79 | 80 | ollama = { 81 | enable = mkBoolOption; 82 | models = mkStrListOption; 83 | rocmOverrideGfx = mkStrOption; 84 | }; 85 | 86 | php = mkBoolOption; 87 | rust = mkBoolOption; 88 | 89 | signal = { 90 | enable = mkBoolOption; 91 | package = mkStrOption; 92 | }; 93 | 94 | solaar = mkBoolOption; 95 | ssh = mkBoolOption; 96 | 97 | steam = { 98 | enable = mkBoolOption; 99 | beta = mkBoolOption; 100 | downloadsWorkaround = mkBoolOption; 101 | 102 | session = { 103 | enable = mkBoolOption; 104 | 105 | autoStart = { 106 | enable = mkBoolOption; 107 | desktopSession = mkStrOption; 108 | }; 109 | 110 | user = mkStrOption; 111 | }; 112 | }; 113 | 114 | sunshine = { 115 | enable = mkBoolOption; 116 | autostart = mkBoolOption; 117 | }; 118 | 119 | tailscale = { 120 | enable = mkBoolOption; 121 | enableTrayscale = mkBoolOption; 122 | }; 123 | 124 | valent = { 125 | enable = mkBoolOption; 126 | deviceId = mkStrOption; 127 | }; 128 | 129 | zed = { 130 | enable = mkBoolOption; 131 | vim = mkBoolOption; 132 | 133 | theme = { 134 | dark = mkStrOption; 135 | light = mkStrOption; 136 | mode = mkStrOption; 137 | }; 138 | }; 139 | 140 | zen-browser = { 141 | enable = mkBoolOption; 142 | privacy = mkBoolOption; 143 | 144 | profiles = mkSubmoduleListOption { 145 | default = mkBoolOption; 146 | exec = mkStrOption; 147 | icon = mkStrOption; 148 | name = mkStrOption; 149 | pwa = mkBoolOption; 150 | sites = mkStrListOption; 151 | }; 152 | }; 153 | }; 154 | 155 | bootloader = { 156 | grub = { 157 | enable = mkBoolOption; 158 | device = mkStrOption; 159 | }; 160 | 161 | systemd-boot = { 162 | enable = mkBoolOption; 163 | mountPoint = mkStrOption; 164 | }; 165 | }; 166 | 167 | desktop = { 168 | accentColor = mkStrOption; 169 | 170 | autologin = { 171 | enable = mkBoolOption; 172 | user = mkStrOption; 173 | }; 174 | 175 | gdm = { 176 | enable = mkBoolOption; 177 | autoSuspend = mkBoolOption; 178 | }; 179 | 180 | gnome = { 181 | enable = mkBoolOption; 182 | accentColor = mkStrOption; 183 | 184 | extensions = { 185 | arcmenu = mkBoolOption; 186 | dashToPanel = mkBoolOption; 187 | }; 188 | 189 | clock = { 190 | date = mkBoolOption; 191 | weekday = mkBoolOption; 192 | }; 193 | 194 | hotCorners = mkBoolOption; 195 | powerButtonAction = mkStrOption; 196 | titlebarLayout = mkStrOption; 197 | 198 | workspaces = { 199 | dynamicWorkspaces = mkBoolOption; 200 | maxWorkspaces = mkNumberOption; 201 | }; 202 | }; 203 | 204 | hyprland = { 205 | enable = mkBoolOption; 206 | 207 | plugins = { 208 | cs2fix = { 209 | enable = mkBoolOption; 210 | width = mkNumberOption; 211 | height = mkNumberOption; 212 | }; 213 | 214 | hyprspace = mkBoolOption; 215 | 216 | hyproled = { 217 | enable = mkBoolOption; 218 | startWidth = mkNumberOption; 219 | startHeight = mkNumberOption; 220 | endWidth = mkNumberOption; 221 | endHeight = mkNumberOption; 222 | }; 223 | }; 224 | 225 | settings = { 226 | animations = { 227 | enable = mkBoolOption; 228 | bezierCurve = mkStrOption; 229 | speed = mkNumberOption; 230 | }; 231 | 232 | followMouse = mkNumberOption; 233 | secondsToLowerBrightness = mkNumberOption; 234 | startupScript = mkStrOption; 235 | windowRules = mkStrListOption; 236 | }; 237 | }; 238 | }; 239 | 240 | hardware = { 241 | bluetooth = mkBoolOption; 242 | 243 | cpus = { 244 | amd = { 245 | enable = mkBoolOption; 246 | 247 | undervolt = { 248 | enable = mkBoolOption; 249 | value = mkStrOption; 250 | }; 251 | 252 | zenpower = mkBoolOption; 253 | }; 254 | 255 | intel = mkBoolOption; 256 | }; 257 | 258 | devices = { 259 | laptop = mkBoolOption; 260 | server = mkBoolOption; 261 | steamdeck = mkBoolOption; 262 | }; 263 | 264 | drivers = { 265 | rtl8821ce = mkBoolOption; 266 | }; 267 | 268 | graphics = { 269 | enable = mkBoolOption; 270 | 271 | amd = { 272 | enable = mkBoolOption; 273 | rocm = mkBoolOption; 274 | }; 275 | 276 | mesa.unstable = mkBoolOption; 277 | 278 | nvidia = { 279 | enable = mkBoolOption; 280 | beta = mkBoolOption; 281 | cuda = mkBoolOption; 282 | openDrivers = mkBoolOption; 283 | 284 | powerLimit = { 285 | enable = mkBoolOption; 286 | value = mkNumberOption; 287 | }; 288 | }; 289 | }; 290 | 291 | monitors = mkSubmoduleListOption { 292 | name = mkStrOption; 293 | disable = mkBoolOption; 294 | resolution = mkStrOption; 295 | refreshRate = mkNumberOption; 296 | position = mkStrOption; 297 | scaling = mkNumberOption; 298 | rotation = mkNumberOption; 299 | tenBit = mkBoolOption; 300 | }; 301 | 302 | networking = { 303 | hostname = mkStrOption; 304 | hosts = mkLinesOption; 305 | ipv6 = mkBoolOption; 306 | vpnExcludeIp = mkStrOption; 307 | 308 | wg-quick = { 309 | enable = mkBoolOption; 310 | interfaces = mkStrListOption; 311 | }; 312 | }; 313 | 314 | mounts = mkSubmoduleListOption { 315 | path = mkStrOption; 316 | device = mkStrOption; 317 | fsType = mkStrOption; 318 | flags = mkStrListOption; 319 | }; 320 | }; 321 | 322 | system = { 323 | channels = mkStrListOption; 324 | forceFirstBuild = mkBoolOption; 325 | 326 | generations = { 327 | bootEntries = mkNumberOption; 328 | 329 | garbageCollect = { 330 | automatic = mkBoolOption; 331 | days = mkNumberOption; 332 | generations = mkNumberOption; 333 | interval = mkStrOption; 334 | }; 335 | }; 336 | 337 | home = mkStrOption; 338 | kernel = mkStrOption; 339 | swappiness = mkNumberOption; 340 | 341 | users = mkSubmoduleAttrsOption { 342 | description = mkStrOption; 343 | type = mkStrOption; 344 | 345 | applications = { 346 | codium = { 347 | autoSave = mkStrOption; 348 | formatOnSave = mkBoolOption; 349 | formatOnPaste = mkBoolOption; 350 | }; 351 | 352 | git = { 353 | username = mkStrOption; 354 | email = mkStrOption; 355 | }; 356 | }; 357 | 358 | desktop = { 359 | gnome = { 360 | pinnedApps = { 361 | arcmenu = { 362 | enable = mkBoolOption; 363 | list = mkStrListOption; 364 | }; 365 | 366 | shell = { 367 | enable = mkBoolOption; 368 | list = mkStrListOption; 369 | }; 370 | }; 371 | 372 | startupScript = mkStrOption; 373 | }; 374 | 375 | idle = { 376 | sd-inhibitor = { 377 | enable = mkBoolOption; 378 | 379 | watchers = { 380 | cpu = { 381 | enable = mkBoolOption; 382 | threshold = mkNumberOption; 383 | }; 384 | 385 | disk = { 386 | enable = mkBoolOption; 387 | threshold = mkNumberOption; 388 | }; 389 | 390 | network = { 391 | enable = mkBoolOption; 392 | threshold = mkNumberOption; 393 | }; 394 | 395 | pipewire = { 396 | enable = mkBoolOption; 397 | inputsToIgnore = mkStrListOption; 398 | outputsToIgnore = mkStrListOption; 399 | }; 400 | }; 401 | }; 402 | 403 | lock = { 404 | enable = mkBoolOption; 405 | seconds = mkNumberOption; 406 | }; 407 | 408 | disableMonitors = { 409 | enable = mkBoolOption; 410 | seconds = mkNumberOption; 411 | }; 412 | 413 | suspend = { 414 | enable = mkBoolOption; 415 | seconds = mkNumberOption; 416 | }; 417 | }; 418 | }; 419 | }; 420 | 421 | virtualisation = { 422 | containerManager = { 423 | enable = mkBoolOption; 424 | usePodman = mkBoolOption; 425 | requireSudoForDocker = mkBoolOption; 426 | }; 427 | 428 | virtManager = mkBoolOption; 429 | waydroid = mkBoolOption; 430 | }; 431 | 432 | version = mkStrOption; 433 | }; 434 | }; 435 | }; 436 | 437 | config = fromTOML (fileContents ./config.toml); 438 | } 439 | -------------------------------------------------------------------------------- /system/applications/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | config, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) 10 | attrNames 11 | filterAttrs 12 | foldl' 13 | lists 14 | splitString 15 | ; 16 | 17 | cfg = config.icedos; 18 | 19 | getModules = 20 | path: 21 | map (dir: ./. + ("/modules/" + dir)) ( 22 | attrNames (filterAttrs (n: v: v == "directory" && !(n == "zen-browser")) (builtins.readDir path)) 23 | ); 24 | 25 | pkgMapper = 26 | pkgList: lists.map (pkgName: foldl' (acc: cur: acc.${cur}) pkgs (splitString "." pkgName)) pkgList; 27 | in 28 | { 29 | imports = getModules (./modules); 30 | 31 | environment.systemPackages = 32 | with pkgs; 33 | [ 34 | efibootmgr # Edit EFI entries 35 | killall # Tool to kill all programs matching process name 36 | lazygit # Git TUI 37 | ntfs3g # Support NTFS drives 38 | p7zip # 7zip 39 | unrar # Support opening rar files 40 | unzip # An extraction utility 41 | wget # Terminal downloader 42 | ] 43 | ++ (pkgMapper cfg.applications.extraPackages); 44 | 45 | nixpkgs.config.permittedInsecurePackages = cfg.applications.insecurePackages; 46 | } 47 | -------------------------------------------------------------------------------- /system/applications/modules/bash/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) mapAttrs; 9 | cfg = config.icedos; 10 | in 11 | { 12 | home-manager.users = mapAttrs (user: _: { 13 | home.file.".bashrc".text = ""; # Avoid file not found errors 14 | }) cfg.system.users; 15 | 16 | security.sudo.extraConfig = "Defaults pwfeedback"; # Show asterisks when typing sudo password 17 | } 18 | -------------------------------------------------------------------------------- /system/applications/modules/btop/btop.conf: -------------------------------------------------------------------------------- 1 | #? Config file for btop v. 1.2.2 2 | 3 | #* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. 4 | #* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" 5 | color_theme = "onedark" 6 | 7 | #* If the theme set background should be shown, set to False if you want terminal background transparency. 8 | theme_background = True 9 | 10 | #* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false. 11 | truecolor = True 12 | 13 | #* Set to true to force tty mode regardless if a real tty has been detected or not. 14 | #* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols. 15 | force_tty = False 16 | 17 | #* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets. 18 | #* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box. 19 | #* Use withespace " " as separator between different presets. 20 | #* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty" 21 | presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty" 22 | 23 | #* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists. 24 | #* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. 25 | vim_keys = False 26 | 27 | #* Rounded corners on boxes, is ignored if TTY mode is ON. 28 | rounded_corners = True 29 | 30 | #* Default symbols to use for graph creation, "braille", "block" or "tty". 31 | #* "braille" offers the highest resolution but might not be included in all fonts. 32 | #* "block" has half the resolution of braille but uses more common characters. 33 | #* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY. 34 | #* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view. 35 | graph_symbol = "braille" 36 | 37 | # Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". 38 | graph_symbol_cpu = "default" 39 | 40 | # Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". 41 | graph_symbol_mem = "default" 42 | 43 | # Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". 44 | graph_symbol_net = "default" 45 | 46 | # Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". 47 | graph_symbol_proc = "default" 48 | 49 | #* Manually set which boxes to show. Available values are "cpu mem net proc", separate values with whitespace. 50 | shown_boxes = "proc cpu mem net" 51 | 52 | #* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs. 53 | update_ms = 1000 54 | 55 | #* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu responsive", 56 | #* "cpu lazy" sorts top process over time (easier to follow), "cpu responsive" updates top process directly. 57 | proc_sorting = "cpu lazy" 58 | 59 | #* Reverse sorting order, True or False. 60 | proc_reversed = False 61 | 62 | #* Show processes as a tree. 63 | proc_tree = False 64 | 65 | #* Use the cpu graph colors in the process list. 66 | proc_colors = True 67 | 68 | #* Use a darkening gradient in the process list. 69 | proc_gradient = True 70 | 71 | #* If process cpu usage should be of the core it's running on or usage of the total available cpu power. 72 | proc_per_core = True 73 | 74 | #* Show process memory as bytes instead of percent. 75 | proc_mem_bytes = True 76 | 77 | #* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate) 78 | proc_info_smaps = False 79 | 80 | #* Show proc box on left side of screen instead of right. 81 | proc_left = False 82 | 83 | #* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available. 84 | #* Select from a list of detected attributes from the options menu. 85 | cpu_graph_upper = "total" 86 | 87 | #* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available. 88 | #* Select from a list of detected attributes from the options menu. 89 | cpu_graph_lower = "total" 90 | 91 | #* Toggles if the lower CPU graph should be inverted. 92 | cpu_invert_lower = True 93 | 94 | #* Set to True to completely disable the lower CPU graph. 95 | cpu_single_graph = False 96 | 97 | #* Show cpu box at bottom of screen instead of top. 98 | cpu_bottom = False 99 | 100 | #* Shows the system uptime in the CPU box. 101 | show_uptime = True 102 | 103 | #* Show cpu temperature. 104 | check_temp = True 105 | 106 | #* Which sensor to use for cpu temperature, use options menu to select from list of available sensors. 107 | cpu_sensor = "Auto" 108 | 109 | #* Show temperatures for cpu cores also if check_temp is True and sensors has been found. 110 | show_coretemp = True 111 | 112 | #* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core. 113 | #* Use lm-sensors or similar to see which cores are reporting temperatures on your machine. 114 | #* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries. 115 | #* Example: "4:0 5:1 6:3" 116 | cpu_core_map = "" 117 | 118 | #* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine". 119 | temp_scale = "celsius" 120 | 121 | #* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024. 122 | base_10_sizes = False 123 | 124 | #* Show CPU frequency. 125 | show_cpu_freq = True 126 | 127 | #* Draw a clock at top of screen, formatting according to strftime, empty string to disable. 128 | #* Special formatting: /host = hostname | /user = username | /uptime = system uptime 129 | clock_format = "" 130 | 131 | #* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort. 132 | background_update = True 133 | 134 | #* Custom cpu model name, empty string to disable. 135 | custom_cpu_name = "" 136 | 137 | #* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ". 138 | #* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user". 139 | disks_filter = "exclude=/nix/store /boot/efi /boot /var/lib/docker/btrfs /var/lib/podman/btrfs" 140 | 141 | #* Show graphs instead of meters for memory values. 142 | mem_graphs = True 143 | 144 | #* Show mem box below net box instead of above. 145 | mem_below_net = False 146 | 147 | #* If swap memory should be shown in memory box. 148 | show_swap = True 149 | 150 | #* Show swap as a disk, ignores show_swap value above, inserts itself after first disk. 151 | swap_disk = False 152 | 153 | #* If mem box should be split to also show disks info. 154 | show_disks = True 155 | 156 | #* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar. 157 | only_physical = True 158 | 159 | #* Read disks list from /etc/fstab. This also disables only_physical. 160 | use_fstab = False 161 | 162 | #* Set to true to show available disk space for privileged users. 163 | disk_free_priv = False 164 | 165 | #* Toggles if io activity % (disk busy time) should be shown in regular disk usage view. 166 | show_io_stat = True 167 | 168 | #* Toggles io mode for disks, showing big graphs for disk read/write speeds. 169 | io_mode = False 170 | 171 | #* Set to True to show combined read/write io graphs in io mode. 172 | io_graph_combined = False 173 | 174 | #* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ". 175 | #* Example: "/mnt/media:100 /:20 /boot:1". 176 | io_graph_speeds = "" 177 | 178 | #* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False. 179 | net_download = 100 180 | 181 | net_upload = 100 182 | 183 | #* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest. 184 | net_auto = True 185 | 186 | #* Sync the auto scaling for download and upload to whichever currently has the highest scale. 187 | net_sync = False 188 | 189 | #* Starts with the Network Interface specified here. 190 | net_iface = "enp9s0" 191 | 192 | #* Show battery stats in top right if battery is present. 193 | show_battery = True 194 | 195 | #* Which battery to use if multiple are present. "Auto" for auto detection. 196 | selected_battery = "Auto" 197 | 198 | #* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG". 199 | #* The level set includes all lower levels, i.e. "DEBUG" will show all logging info. 200 | log_level = "DEBUG" 201 | -------------------------------------------------------------------------------- /system/applications/modules/btop/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs; 10 | cfg = config.icedos; 11 | in 12 | { 13 | environment.systemPackages = [ pkgs.btop ]; 14 | 15 | home-manager.users = mapAttrs (user: _: { 16 | home.file.".config/btop/btop.conf".source = ./btop.conf; 17 | }) cfg.system.users; 18 | } 19 | -------------------------------------------------------------------------------- /system/applications/modules/celluloid/config/celluloid.conf: -------------------------------------------------------------------------------- 1 | # Guide https://github.com/mpv-player/mpv/issues/10565 2 | 3 | # Because we want high quality 4 | profile=gpu-hq 5 | # Because it can play DoVi and is faster 6 | vo=gpu-next 7 | # Hardware acceleration (faster, less energy consumption) 8 | hwdec=auto-safe 9 | # Force modern standards 10 | gpu-api=vulkan 11 | gpu-context=waylandvk 12 | 13 | # Interpolation because 24hz videos look way better 14 | video-sync=display-resample 15 | interpolation=yes 16 | 17 | # HDR passtrough: Important for HDR & DoVi playback, no downside for SDR so always on 18 | target-colorspace-hint=yes 19 | 20 | [HDR] # Dolby Video HDR profile 21 | profile-restore=copy 22 | # target-trc=pq # Isn't supported properly by most WMs and DEs, but will greatly improve color and brightness when it is 23 | target-prim=bt.2020 24 | # Adjust this to the peak brightness of your display 25 | target-peak=400 26 | 27 | # Prefer Japanese audio when available (for anime) 28 | alang=Japanese,jpn,ja,English,eng,en 29 | # Force enable English subtitles 30 | slang=English,eng,en 31 | 32 | glsl-shaders-append="~/.config/celluloid/shaders/FSR.glsl" 33 | -------------------------------------------------------------------------------- /system/applications/modules/celluloid/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs mkIf; 10 | cfg = config.icedos; 11 | in 12 | mkIf (cfg.applications.celluloid) { 13 | environment.systemPackages = with pkgs; [ 14 | (writeShellScriptBin "celluloid-hdr" "ENABLE_HDR_WSI=1 celluloid --mpv-profile=HDR $@") 15 | celluloid 16 | ]; 17 | 18 | home-manager.users = mapAttrs (user: _: { 19 | home.file.".config/celluloid" = { 20 | source = ./config; 21 | recursive = true; 22 | }; 23 | 24 | dconf.settings = { 25 | "io/github/celluloid-player/celluloid" = { 26 | mpv-config-file = "file:///home/${user}/.config/celluloid/celluloid.conf"; 27 | }; 28 | 29 | "io/github/celluloid-player/celluloid" = { 30 | mpv-config-enable = true; 31 | }; 32 | 33 | "io/github/celluloid-player/celluloid" = { 34 | always-append-to-playlist = true; 35 | }; 36 | }; 37 | }) cfg.system.users; 38 | } 39 | -------------------------------------------------------------------------------- /system/applications/modules/clamav/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mkIf; 10 | cfg = config.icedos.applications; 11 | in 12 | mkIf (cfg.clamav) { 13 | environment.systemPackages = [ pkgs.clamav ]; 14 | services.clamav.updater.enable = true; 15 | } 16 | -------------------------------------------------------------------------------- /system/applications/modules/codium/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs mkIf; 10 | cfg = config.icedos; 11 | in 12 | mkIf (cfg.applications.codium.enable) { 13 | environment.variables.EDITOR = mkIf (cfg.applications.defaultEditor == "codium") "codium -n -w"; 14 | 15 | home-manager.users = mapAttrs (user: _: { 16 | programs.vscode = { 17 | enable = true; 18 | profiles.default.enableExtensionUpdateCheck = true; 19 | profiles.default.enableUpdateCheck = false; 20 | package = pkgs.vscodium; 21 | 22 | profiles.default.extensions = with pkgs; [ 23 | vscode-extensions.codezombiech.gitignore 24 | vscode-extensions.dbaeumer.vscode-eslint 25 | vscode-extensions.donjayamanne.githistory 26 | vscode-extensions.eamodio.gitlens 27 | vscode-extensions.editorconfig.editorconfig 28 | vscode-extensions.esbenp.prettier-vscode 29 | vscode-extensions.fabiospampinato.vscode-open-in-github 30 | vscode-extensions.formulahendry.auto-close-tag 31 | vscode-extensions.formulahendry.code-runner 32 | vscode-extensions.gruntfuggly.todo-tree 33 | vscode-extensions.jnoortheen.nix-ide 34 | vscode-extensions.pkief.material-icon-theme 35 | vscode-extensions.tamasfe.even-better-toml 36 | vscode-extensions.timonwong.shellcheck 37 | vscode-extensions.zhuangtongfa.material-theme 38 | ]; 39 | 40 | profiles.default.userSettings = { 41 | "[css]".editor.defaultFormatter = "esbenp.prettier-vscode"; 42 | "[javascript]".editor.defaultFormatter = "esbenp.prettier-vscode"; 43 | "[typescript]".editor.defaultFormatter = "esbenp.prettier-vscode"; 44 | "[typescriptreact]".editor.defaultFormatter = "esbenp.prettier-vscode"; 45 | diffEditor.ignoreTrimWhitespace = false; 46 | 47 | editor = { 48 | fontFamily = "'JetBrainsMono Nerd Font', 'Droid Sans Mono', 'monospace', monospace"; 49 | fontLigatures = true; 50 | formatOnPaste = cfg.system.users.${user}.applications.codium.formatOnPaste; 51 | formatOnSave = cfg.system.users.${user}.applications.codium.formatOnSave; 52 | minimap.enabled = false; 53 | renderWhitespace = "trailing"; 54 | smoothScrolling = true; 55 | tabSize = 2; 56 | }; 57 | 58 | evenBetterToml.formatter.alignComments = false; 59 | 60 | files = { 61 | associations."*.css" = "tailwindcss"; 62 | autoSave = cfg.system.users.${user}.applications.codium.autoSave; 63 | insertFinalNewline = true; 64 | trimFinalNewlines = true; 65 | trimTrailingWhitespace = true; 66 | }; 67 | 68 | git = { 69 | autofetch = true; 70 | confirmSync = false; 71 | }; 72 | 73 | gitlens = { 74 | codeLens.enabled = false; 75 | defaultDateFormat = "YYYY-MM-DD HH:mm"; 76 | defaultDateLocale = "system"; 77 | defaultDateShortFormat = "YYYY-M-D"; 78 | defaultTimeFormat = "HH:mm"; 79 | statusBar.enabled = false; 80 | 81 | views.repositories = { 82 | showContributors = false; 83 | showStashes = true; 84 | showTags = false; 85 | showWorktrees = false; 86 | }; 87 | }; 88 | 89 | nix.formatterPath = "nixfmt"; 90 | scm.showHistoryGraph = false; 91 | 92 | terminal.integrated = { 93 | cursorBlinking = true; 94 | cursorStyle = "line"; 95 | smoothScrolling = true; 96 | }; 97 | 98 | update.mode = "none"; 99 | 100 | window = { 101 | menuBarVisibility = "toggle"; 102 | zoomLevel = cfg.applications.codium.zoomLevel; 103 | }; 104 | 105 | workbench = { 106 | colorTheme = "One Dark Pro Darker"; 107 | iconTheme = "material-icon-theme"; 108 | list.smoothScrolling = true; 109 | startupEditor = "none"; 110 | tips.enabled = false; 111 | }; 112 | }; 113 | }; 114 | }) cfg.system.users; 115 | } 116 | -------------------------------------------------------------------------------- /system/applications/modules/container-manager/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs mkIf; 10 | cfg = config.icedos.system; 11 | in 12 | mkIf (cfg.virtualisation.containerManager.enable) { 13 | environment.systemPackages = with pkgs; [ distrobox ]; 14 | virtualisation.docker.enable = !cfg.virtualisation.containerManager.usePodman; 15 | virtualisation.podman.enable = cfg.virtualisation.containerManager.usePodman; 16 | 17 | users.users = mapAttrs (user: _: { 18 | extraGroups = 19 | mkIf 20 | ( 21 | !cfg.virtualisation.containerManager.usePodman 22 | && !cfg.virtualisation.containerManager.requireSudoForDocker 23 | ) 24 | [ 25 | "docker" 26 | ]; 27 | }) cfg.users; 28 | } 29 | -------------------------------------------------------------------------------- /system/applications/modules/direnv/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | programs.direnv.enable = true; 3 | } 4 | -------------------------------------------------------------------------------- /system/applications/modules/game-launch/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | ... 4 | }: 5 | 6 | { 7 | environment.systemPackages = [ 8 | (pkgs.writeShellScriptBin "game-launch" '' 9 | PROTON_PREFER_SDL_INPUT="1" 10 | MANGOHUD="${pkgs.mangohud}/bin/mangohud" 11 | GAMEMODE="${pkgs.gamemode}/bin/gamemoderun" 12 | 13 | while [[ $# -gt 0 ]]; do 14 | case "$1" in 15 | --protonpath) 16 | PROTONPATH="$2" 17 | shift 2 18 | ;; 19 | --fsr4) 20 | FSR4_UPGRADE="1" 21 | DXIL_SPIRV_CONFIG="wmma_rdna3_workaround" 22 | shift 23 | ;; 24 | --wayland) 25 | PROTON_ENABLE_WAYLAND="1" 26 | shift 27 | ;; 28 | --hdr) 29 | PROTON_ENABLE_WAYLAND="1" 30 | PROTON_ENABLE_HDR="1" 31 | shift 32 | ;; 33 | --dll) 34 | WINEDLLOVERRIDES="$2" 35 | shift 2 36 | ;; 37 | --no-sdl) 38 | PROTON_PREFER_SDL_INPUT="0" 39 | shift 40 | ;; 41 | --no-mangohud) 42 | MANGOHUD="" 43 | shift 44 | ;; 45 | --no-gamemode) 46 | GAMEMODE="" 47 | shift 48 | ;; 49 | --game) 50 | GAME="$2" 51 | shift 2 52 | ;; 53 | *) 54 | echo "Unknown arg: $1" >&2 55 | exit 1 56 | ;; 57 | esac 58 | done 59 | 60 | "$MANGOHUD" "$GAMEMODE" "${pkgs.umu-launcher}/bin/umu-run" "$GAME" 61 | '') 62 | ]; 63 | } 64 | -------------------------------------------------------------------------------- /system/applications/modules/gamemode/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | ... 4 | }: 5 | 6 | { 7 | programs.gamemode = { 8 | enable = true; 9 | 10 | settings = { 11 | general.renice = 20; 12 | 13 | gpu = { 14 | apply_gpu_optimisations = "accept-responsibility"; 15 | nv_powermizer_mode = 1; 16 | amd_performance_level = "high"; 17 | }; 18 | 19 | custom = { 20 | start = "${pkgs.libnotify}/bin/notify-send 'Gamemode enabled'"; 21 | end = "${pkgs.libnotify}/bin/notify-send 'Gamemode disabled'"; 22 | }; 23 | }; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /system/applications/modules/gamescope/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) 10 | head 11 | last 12 | mapAttrs 13 | mkIf 14 | splitString 15 | ; 16 | 17 | cfg = config.icedos; 18 | 19 | extraPackages = [ 20 | pkgs.gamescope 21 | gamescope-launch 22 | ]; 23 | 24 | package = pkgs.gamescope; 25 | 26 | gamescope-launch = ( 27 | pkgs.writeShellScriptBin "gamescope-launch" '' 28 | OG_LD_PRELOAD="$LD_PRELOAD" 29 | LD_PRELOAD="" 30 | GAMESCOPE="${pkgs.gamescope}/bin/gamescope" 31 | GAMEMODE="${pkgs.gamemode}/bin/gamemoderun" 32 | SDL="--backend sdl" 33 | 34 | ${ 35 | if (cfg.applications.mangohud.enable) then 36 | '' 37 | MANGOHUD="--mangoapp" 38 | MANGOHUD_CONFIGFILE="/home/$USER/.config/MangoHud/MangoHud.conf" 39 | '' 40 | else 41 | "" 42 | } 43 | 44 | ${ 45 | let 46 | monitor = head (cfg.hardware.monitors); 47 | resolution = splitString "x" (monitor.resolution); 48 | width = head (resolution); 49 | height = last (resolution); 50 | refreshRate = toString (monitor.refreshRate); 51 | in 52 | '' 53 | DEFAULT_WIDTH="-W ${width}" 54 | DEFAULT_HEIGHT="-H ${height}" 55 | DEFAULT_REFRESH_RATE="-r ${refreshRate}" 56 | '' 57 | } 58 | 59 | while [[ $# -gt 0 ]]; do 60 | case "$1" in 61 | --gamescope-args) 62 | GAMESCOPE_ARGS="$2" 63 | 64 | if [[ $GAMESCOPE_ARGS = *'-W'* ]] || [[ $GAMESCOPE_ARGS = *'-H'* ]]; then 65 | DEFAULT_WIDTH="" 66 | DEFAULT_HEIGHT="" 67 | fi 68 | 69 | if [[ $GAMESCOPE_ARGS = *'-r'* ]]; then 70 | DEFAULT_REFRESH_RATE="" 71 | fi 72 | 73 | shift 2 74 | ;; 75 | --no-gamemode) 76 | GAMEMODE="" 77 | shift 78 | ;; 79 | --no-mangohud) 80 | MANGOHUD="" 81 | shift 82 | ;; 83 | --no-sdl) 84 | SDL="" 85 | shift 86 | ;; 87 | --) 88 | shift 89 | COMMAND=("$@") 90 | break 91 | ;; 92 | *) 93 | COMMAND=("$@") 94 | break 95 | ;; 96 | -*|--*) 97 | echo "Unknown arg: $1" >&2 98 | exit 1 99 | ;; 100 | esac 101 | done 102 | 103 | DEFAULT_GAMESCOPE_ARGS="$DEFAULT_WIDTH $DEFAULT_HEIGHT $DEFAULT_REFRESH_RATE $SDL" 104 | 105 | $GAMEMODE $GAMESCOPE $MANGOHUD $DEFAULT_GAMESCOPE_ARGS $GAMESCOPE_ARGS -- env LD_PRELOAD="$OG_LD_PRELOAD" "''${COMMAND[@]}" 106 | '' 107 | ); 108 | 109 | ifSteam = deck: cfg.applications.steam.enable && deck; 110 | in 111 | { 112 | environment.systemPackages = [ 113 | gamescope-launch 114 | package 115 | ]; 116 | 117 | programs.steam.extraPackages = mkIf (ifSteam (cfg.hardware.devices.steamdeck)) extraPackages; 118 | 119 | home-manager.users = mapAttrs (user: _: { 120 | home.packages = mkIf (ifSteam (!cfg.hardware.devices.steamdeck)) [ 121 | (pkgs.steam.override { extraPkgs = pkgs: extraPackages; }) 122 | ]; 123 | }) cfg.system.users; 124 | } 125 | -------------------------------------------------------------------------------- /system/applications/modules/gdm/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) mkIf; 9 | cfg = config.icedos; 10 | in 11 | mkIf (cfg.desktop.gdm.enable && !cfg.applications.steam.session.autoStart.enable) { 12 | services = { 13 | displayManager.gdm = { 14 | enable = true; 15 | autoSuspend = cfg.desktop.gdm.autoSuspend; 16 | }; 17 | 18 | xserver = { 19 | enable = true; 20 | xkb.layout = "us,gr"; 21 | }; 22 | }; 23 | 24 | # Workaround for autologin 25 | systemd.services = { 26 | "getty@tty1".enable = false; 27 | "autovt@tty1".enable = false; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /system/applications/modules/git/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) mapAttrs; 9 | cfg = config.icedos; 10 | in 11 | { 12 | home-manager.users = mapAttrs (user: _: { 13 | programs.git = { 14 | enable = true; 15 | 16 | extraConfig = { 17 | pull.rebase = true; 18 | }; 19 | 20 | userName = "${cfg.system.users.${user}.applications.git.username}"; 21 | userEmail = "${cfg.system.users.${user}.applications.git.email}"; 22 | }; 23 | }) cfg.system.users; 24 | } 25 | -------------------------------------------------------------------------------- /system/applications/modules/icedos-toolset/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) 10 | attrNames 11 | concatMapStrings 12 | filterAttrs 13 | sort 14 | ; 15 | 16 | cfg = config.icedos; 17 | 18 | getModules = 19 | path: 20 | map (dir: ./. + ("/modules/" + dir)) ( 21 | attrNames (filterAttrs (_: v: v == "directory") (builtins.readDir path)) 22 | ); 23 | in 24 | { 25 | imports = getModules (./modules); 26 | 27 | environment.systemPackages = [ 28 | ( 29 | let 30 | purpleString = string: ''''${PURPLE}${string}''${NC}''; 31 | in 32 | pkgs.writeShellScriptBin "icedos" '' 33 | PURPLE='\033[0;35m' 34 | NC='\033[0m' 35 | 36 | if [[ "$1" == "" || "$1" == "help" ]]; then 37 | echo "Available commands:" 38 | 39 | ${concatMapStrings (tool: '' 40 | echo -e "> ${purpleString tool.command}: ${tool.help} " 41 | '') (sort (a: b: a.command < b.command) (cfg.internals.toolset.commands))} 42 | 43 | exit 0 44 | fi 45 | 46 | case "$1" in 47 | ${concatMapStrings (tool: '' 48 | ${tool.command}) 49 | shift 50 | exec ${tool.bin} "$@" 51 | ;; 52 | '') cfg.internals.toolset.commands} 53 | *|-*|--*) 54 | echo "Unknown arg: $1" >&2 55 | exit 1 56 | ;; 57 | esac 58 | '' 59 | ) 60 | ]; 61 | } 62 | -------------------------------------------------------------------------------- /system/applications/modules/icedos-toolset/modules/aria2c/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | ... 4 | }: 5 | 6 | { 7 | icedos.internals.toolset.commands = [ 8 | ( 9 | let 10 | command = "download"; 11 | in 12 | { 13 | bin = "${pkgs.writeShellScript command '' 14 | if [[ "$1" == "" ]]; then 15 | echo "error: specify url as an argument" 16 | echo "usage: icedos download [OPTIONS] [URI | MAGNET | TORRENT_FILE | METALINK_FILE]..." 17 | echo "help: icedos download -h" 18 | exit 1 19 | fi 20 | 21 | "${pkgs.aria}/bin/aria2c" -j 16 -s 16 "$@" 22 | ''}"; 23 | command = command; 24 | help = "download provided url using aria2c utizing 16 connections"; 25 | } 26 | ) 27 | ]; 28 | } 29 | -------------------------------------------------------------------------------- /system/applications/modules/icedos-toolset/modules/btrfs/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | ... 4 | }: 5 | 6 | { 7 | icedos.internals.toolset.commands = [ 8 | ( 9 | let 10 | command = "btrfs-zstd"; 11 | in 12 | { 13 | bin = "${pkgs.writeShellScript command '' 14 | if [[ "$1" == "" ]]; then 15 | echo "error: specify path as an argument" 16 | exit 1 17 | fi 18 | 19 | sudo "${pkgs.btrfs-progs}/bin/btrfs" filesystem defrag -czstd -r -v "$@" 20 | ''}"; 21 | command = command; 22 | help = "compress btrfs path using zstd"; 23 | } 24 | ) 25 | ]; 26 | } 27 | -------------------------------------------------------------------------------- /system/applications/modules/icedos-toolset/modules/ip/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | ... 4 | }: 5 | 6 | let 7 | command = "ip"; 8 | in 9 | { 10 | icedos.internals.toolset.commands = [ 11 | { 12 | bin = "${pkgs.writeShellScript command ''"${pkgs.curl}/bin/curl" ifconfig.me''}"; 13 | command = command; 14 | help = "print current ip"; 15 | } 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /system/applications/modules/icedos-toolset/modules/logout/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | ... 4 | }: 5 | 6 | let 7 | command = "logout"; 8 | in 9 | { 10 | icedos.internals.toolset.commands = [ 11 | { 12 | bin = "${pkgs.writeShellScript command "pkill -KILL -u $USER"}"; 13 | command = command; 14 | help = "force kill all current user processes, resulting in a logout"; 15 | } 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /system/applications/modules/icedos-toolset/modules/reboot/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | ... 4 | }: 5 | 6 | let 7 | command = "reboot"; 8 | in 9 | { 10 | icedos.internals.toolset.commands = [ 11 | { 12 | bin = "${pkgs.writeShellScript command '' 13 | case "$1" in 14 | "") 15 | systemctl reboot -i 16 | ;; 17 | uefi) 18 | systemctl reboot --firmware-setup -i 19 | ;; 20 | *) 21 | echo "Unknown arg: $1" >&2 22 | exit 1 23 | ;; 24 | esac 25 | ''}"; 26 | 27 | command = command; 28 | help = "reboot ignoring inhibitors and users, uefi supported by appending it as an argument"; 29 | } 30 | ]; 31 | } 32 | -------------------------------------------------------------------------------- /system/applications/modules/icedos-toolset/modules/rebuild/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: 6 | 7 | let 8 | builder = 9 | c: u: 10 | "${pkgs.writeShellScript "${c}" '' 11 | function cache() { 12 | FILE="$1" 13 | 14 | [ ! -f "$FILE" ] && return 1 15 | mkdir -p .cache 16 | 17 | LASTFILE=$(ls -lt ".cache" | grep "$FILE" | head -2 | tail -1 | awk '{print $9}') 18 | 19 | diff -sq ".cache/$LASTFILE" "$FILE" &> /dev/null || cp "$FILE" ".cache/$FILE-$(date -Is)" 20 | } 21 | 22 | function runCommand() { 23 | if command -v "$1" &> /dev/null 24 | then 25 | "$1" 26 | fi 27 | } 28 | 29 | cd ${config.icedos.configurationLocation} 2> /dev/null || 30 | (echo 'warning: configuration path is invalid, run build.sh located inside the configuration scripts directory to update the path.' && false) && 31 | 32 | cache "flake.nix" 33 | 34 | if ${u}; then 35 | nix-shell ./build.sh --update $@ && cache "flake.lock" || true 36 | runCommand update-codium-extensions 37 | else 38 | nix-shell ./build.sh $@ 39 | fi 40 | ''}"; 41 | in 42 | { 43 | icedos.internals.toolset.commands = [ 44 | ( 45 | let 46 | command = "rebuild"; 47 | in 48 | { 49 | bin = toString (builder command "false"); 50 | command = command; 51 | help = "rebuild the system"; 52 | } 53 | ) 54 | 55 | ( 56 | let 57 | command = "update"; 58 | in 59 | { 60 | bin = toString (builder command "true"); 61 | command = command; 62 | help = "update flake.lock and rebuild the system"; 63 | } 64 | ) 65 | ]; 66 | } 67 | -------------------------------------------------------------------------------- /system/applications/modules/icedos-toolset/modules/vpn-exclude/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.icedos.hardware.networking; 9 | in 10 | { 11 | icedos.internals.toolset.commands = [ 12 | ( 13 | let 14 | command = "vpn-exclude"; 15 | in 16 | { 17 | bin = "${pkgs.writeShellScript command '' 18 | if [[ "$1" == "" ]]; then 19 | echo "error: provide command as an argument" 20 | exit 1 21 | fi 22 | 23 | INTERFACE=$(ip -o -4 route show to default | awk '{print $5}') 24 | GATEWAY=$(ip -o -4 route show to default | awk '{print $3}') 25 | NAMESPACE="vpnexcludens" 26 | LINK="vpnexcludelink" 27 | 28 | [ -f "/var/run/netns/$NAMESPACE" ] || sudo bash -c " 29 | ( 30 | ip netns add $NAMESPACE 31 | ip link add $LINK link $INTERFACE address 00:11:22:33:44:55 type macvlan mode bridge 32 | ip link set $LINK netns $NAMESPACE 33 | 34 | ip netns exec $NAMESPACE ip link set dev lo up 35 | ip netns exec $NAMESPACE ip link set dev $LINK up 36 | 37 | ip netns exec $NAMESPACE ip addr add ${cfg.vpnExcludeIp}/24 dev $LINK 38 | ip netns exec $NAMESPACE ip route add default via $GATEWAY dev $LINK 39 | ) 40 | " 41 | 42 | sudo ip netns exec "$NAMESPACE" sudo -u "$USER" "$1" 43 | ''}"; 44 | 45 | command = command; 46 | help = "run command excluded from all vpn connections"; 47 | } 48 | ) 49 | ]; 50 | } 51 | -------------------------------------------------------------------------------- /system/applications/modules/input-remapper/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs mkIf; 10 | cfg = config.icedos; 11 | in 12 | 13 | mkIf (cfg.applications.input-remapper) { 14 | services.input-remapper.enable = true; 15 | 16 | home-manager.users = mapAttrs (user: _: { 17 | systemd.user.services.input-remapper-autoload-fix = { 18 | Unit.Description = "Input Remapper Autoload Fix"; 19 | Install.WantedBy = [ "graphical-session.target" ]; 20 | 21 | Service = { 22 | ExecStart = "${pkgs.input-remapper}/bin/input-remapper-control --command autoload"; 23 | Nice = "-20"; 24 | Restart = "on-failure"; 25 | StartLimitIntervalSec = 60; 26 | StartLimitBurst = 60; 27 | }; 28 | }; 29 | 30 | }) cfg.system.users; 31 | 32 | users.users = mapAttrs (user: _: { extraGroups = [ "input" ]; }) cfg.system.users; 33 | } 34 | -------------------------------------------------------------------------------- /system/applications/modules/kitty/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) mapAttrs mkIf; 9 | cfg = config.icedos; 10 | in 11 | mkIf (cfg.applications.kitty.enable) { 12 | home-manager.users = mapAttrs (user: _: { 13 | programs.kitty = { 14 | enable = true; 15 | settings = { 16 | background_opacity = "0.8"; 17 | confirm_os_window_close = "0"; 18 | cursor_shape = "beam"; 19 | enable_audio_bell = "no"; 20 | hide_window_decorations = if (cfg.applications.kitty.hideDecorations) then "yes" else "no"; 21 | update_check_interval = "0"; 22 | copy_on_select = "no"; 23 | wayland_titlebar_color = "background"; 24 | }; 25 | 26 | font.name = "JetBrainsMono Nerd Font"; 27 | font.size = 10; 28 | themeFile = "OneDark-Pro"; 29 | }; 30 | 31 | wayland.windowManager.hyprland.settings.bind = mkIf (cfg.desktop.hyprland.enable) [ 32 | "$mainMod, X, exec, kitty" 33 | ]; 34 | 35 | dconf.settings = mkIf (cfg.desktop.gnome.enable) { 36 | "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { 37 | binding = "x"; 38 | command = "kitty"; 39 | name = "Kitty"; 40 | }; 41 | 42 | "org/gnome/settings-daemon/plugins/media-keys".custom-keybindings = [ 43 | "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" 44 | ]; 45 | }; 46 | }) cfg.system.users; 47 | } 48 | -------------------------------------------------------------------------------- /system/applications/modules/lact/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mkIf; 10 | cfg = config.icedos; 11 | in 12 | mkIf (cfg.applications.lact) { 13 | environment.systemPackages = [ pkgs.lact ]; 14 | 15 | # We are creating the lact daemon service manually because the provided one hangs 16 | systemd.services.lactd = { 17 | enable = true; 18 | description = "Radeon GPU monitor"; 19 | after = [ 20 | "syslog.target" 21 | "systemd-modules-load.service" 22 | ]; 23 | 24 | unitConfig = { 25 | ConditionPathExists = "${pkgs.lact}/bin/lact"; 26 | }; 27 | 28 | serviceConfig = { 29 | User = "root"; 30 | ExecStart = "${pkgs.lact}/bin/lact daemon"; 31 | }; 32 | 33 | wantedBy = [ "multi-user.target" ]; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /system/applications/modules/librewolf/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | config, 5 | inputs, 6 | ... 7 | }: 8 | 9 | let 10 | inherit (lib) 11 | attrNames 12 | filterAttrs 13 | mapAttrs 14 | mkIf 15 | ; 16 | 17 | cfg = config.icedos; 18 | 19 | package = ( 20 | pkgs.librewolf.override { 21 | nativeMessagingHosts = [ inputs.pipewire-screenaudio.packages.${pkgs.system}.default ]; 22 | } 23 | ); 24 | 25 | getModules = 26 | path: 27 | map (dir: ./. + ("/modules/" + dir)) ( 28 | attrNames (filterAttrs (n: v: v == "directory") (builtins.readDir path)) 29 | ); 30 | in 31 | { 32 | imports = getModules (./modules); 33 | 34 | # Set as default browser for electron apps 35 | environment = { 36 | sessionVariables.DEFAULT_BROWSER = mkIf ( 37 | cfg.applications.librewolf && cfg.applications.defaultBrowser == "librewolf" 38 | ) "${package}/bin/librewolf"; 39 | 40 | systemPackages = if (cfg.applications.librewolf) then [ package ] else [ ]; 41 | }; 42 | 43 | home-manager.users = mapAttrs (user: _: { 44 | home.file = mkIf (cfg.applications.librewolf) { 45 | ".librewolf/profiles.ini" = { 46 | source = ./profiles.ini; 47 | force = true; 48 | }; 49 | }; 50 | }) cfg.system.users; 51 | } 52 | -------------------------------------------------------------------------------- /system/applications/modules/librewolf/modules/user.js/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) 10 | mapAttrs 11 | mkIf 12 | substring 13 | ; 14 | 15 | cfg = config.icedos; 16 | firefoxVersion = substring 0 5 pkgs.firefox.version; 17 | in 18 | mkIf (cfg.applications.librewolf) { 19 | home-manager.users = mapAttrs (user: _: { 20 | programs.librewolf.settings = { 21 | "browser.download.autohideButton" = true; 22 | "browser.theme.dark-private-windows" = false; 23 | "general.autoScroll" = true; 24 | "general.useragent.override" = 25 | "Mozilla/5.0 (X11; Linux x86_64; rv:${firefoxVersion}) Gecko/20100101 Firefox/${firefoxVersion}"; 26 | "identity.fxaccounts.enabled" = true; 27 | "image.jxl.enabled" = true; # Enable JPEG XL support 28 | "media.ffmpeg.vaapi.enabled" = true; # Enable VA-API hard accelaration 29 | "middlemouse.paste" = false; 30 | "privacy.resistFingerprinting" = false; 31 | "svg.context-properties.content.enabled" = true; 32 | "toolkit.legacyUserProfileCustomizations.stylesheets" = true; 33 | "webgl.disabled" = false; 34 | }; 35 | }) cfg.system.users; 36 | } 37 | -------------------------------------------------------------------------------- /system/applications/modules/librewolf/profiles.ini: -------------------------------------------------------------------------------- 1 | [Profile0] 2 | Name=Default 3 | IsRelative=1 4 | Path=default 5 | Default=1 6 | 7 | [General] 8 | StartWithLastProfile=1 9 | Version=2 10 | -------------------------------------------------------------------------------- /system/applications/modules/mangohud/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) mapAttrs mkIf; 9 | cfg = config.icedos; 10 | in 11 | mkIf (cfg.applications.mangohud.enable) { 12 | home-manager.users = mapAttrs ( 13 | user: _: 14 | let 15 | type = cfg.system.users.${user}.type; 16 | in 17 | { 18 | programs.mangohud = { 19 | enable = (type != "work"); 20 | 21 | settings = { 22 | background_alpha = 0; 23 | battery = (cfg.hardware.devices.laptop || cfg.hardware.devices.steamdeck); 24 | battery_icon = (cfg.hardware.devices.laptop || cfg.hardware.devices.steamdeck); 25 | battery_time = (cfg.hardware.devices.laptop || cfg.hardware.devices.steamdeck); 26 | cpu_color = "FFFFFF"; 27 | cpu_power = true; 28 | cpu_temp = true; 29 | engine_color = "FFFFFF"; 30 | engine_short_names = true; 31 | font_size = 18; 32 | fps_color = "FFFFFF"; 33 | fps_limit = "${toString (cfg.applications.mangohud.maxFpsLimit)},60,0"; 34 | frame_timing = false; 35 | frametime = false; 36 | gl_vsync = 0; 37 | gpu_color = "FFFFFF"; 38 | gpu_power = true; 39 | gpu_temp = true; 40 | horizontal = true; 41 | hud_compact = true; 42 | hud_no_margin = true; 43 | no_small_font = true; 44 | offset_x = 5; 45 | offset_y = 5; 46 | text_color = "FFFFFF"; 47 | toggle_fps_limit = "Ctrl_L+Shift_L+F1"; 48 | vram_color = "FFFFFF"; 49 | vsync = 1; 50 | }; 51 | }; 52 | } 53 | ) cfg.system.users; 54 | } 55 | -------------------------------------------------------------------------------- /system/applications/modules/mission-center/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs mkIf; 10 | cfg = config.icedos; 11 | package = pkgs.mission-center; 12 | in 13 | mkIf (cfg.applications.mission-center) { 14 | environment.systemPackages = [ package ]; 15 | 16 | home-manager.users = mapAttrs (user: _: { 17 | wayland.windowManager.hyprland.settings.bind = mkIf (cfg.desktop.hyprland.enable) [ 18 | "CTRL SHIFT, ESCAPE, exec, ${package}/bin/missioncenter" 19 | ]; 20 | }) cfg.system.users; 21 | } 22 | -------------------------------------------------------------------------------- /system/applications/modules/ncdu/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | ... 4 | }: 5 | 6 | { 7 | icedos.internals.toolset.commands = [ 8 | ( 9 | let 10 | command = "du"; 11 | in 12 | { 13 | bin = "${pkgs.writeShellScript command ''${pkgs.ncdu}/bin/ncdu "$@"''}"; 14 | command = command; 15 | help = "see disk usage on current folder or provided path"; 16 | } 17 | ) 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /system/applications/modules/network-manager/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs mkIf; 10 | cfg = config.icedos; 11 | in 12 | 13 | mkIf (cfg.applications.network-manager.enable) { 14 | networking = { 15 | networkmanager.enable = true; 16 | firewall.enable = false; 17 | }; 18 | 19 | users.users = mapAttrs (user: _: { extraGroups = [ "networkmanager" ]; }) cfg.system.users; 20 | 21 | home-manager.users = mapAttrs (user: _: { 22 | xdg.desktopEntries = mkIf (cfg.applications.network-manager.applet) { 23 | nm-connection-editor = { 24 | exec = "${pkgs.networkmanagerapplet}/bin/nm-connection-editor"; 25 | icon = "epiphany"; 26 | name = "Network Connection Editor"; 27 | terminal = false; 28 | type = "Application"; 29 | }; 30 | 31 | nm-tray = { 32 | exec = "${pkgs.networkmanagerapplet}/bin/nm-applet"; 33 | icon = "epiphany"; 34 | name = "Network Connection Tray"; 35 | terminal = false; 36 | type = "Application"; 37 | }; 38 | }; 39 | }) cfg.system.users; 40 | } 41 | -------------------------------------------------------------------------------- /system/applications/modules/nh/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: 6 | 7 | let 8 | cfg = config.icedos.system.generations.garbageCollect; 9 | command = "gc"; 10 | days = "${toString (cfg.days)}d"; 11 | generations = toString (cfg.generations); 12 | in 13 | { 14 | icedos.internals.toolset.commands = [ 15 | { 16 | bin = "${pkgs.writeShellScript command ''"${pkgs.nh}/bin/nh" clean all -k "${generations}" -K "${days}"''}"; 17 | command = command; 18 | help = "clean nix plus home manager, store and profiles"; 19 | } 20 | ]; 21 | 22 | programs.nh = { 23 | enable = true; 24 | 25 | clean = { 26 | enable = cfg.automatic; 27 | extraArgs = "-k ${toString (cfg.generations)} -K ${days}"; 28 | dates = cfg.interval; 29 | }; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /system/applications/modules/nix-health/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | ... 4 | }: 5 | 6 | { 7 | icedos.internals.toolset.commands = [ 8 | ( 9 | let 10 | command = "health"; 11 | in 12 | { 13 | bin = "${pkgs.writeShellScript command ''"${pkgs.nix-health}/bin/nix-health" -q "$@"''}"; 14 | 15 | command = command; 16 | help = "print information about system state"; 17 | } 18 | ) 19 | ]; 20 | } 21 | -------------------------------------------------------------------------------- /system/applications/modules/nix-store/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | inputs, 4 | lib, 5 | pkgs, 6 | ... 7 | }: 8 | 9 | let 10 | inherit (lib) mapAttrs mapAttrsToList; 11 | in 12 | { 13 | icedos.internals.toolset.commands = [ 14 | ( 15 | let 16 | command = "pkgs"; 17 | in 18 | { 19 | bin = "${pkgs.writeShellScript command "nix-store --query --requisites /run/current-system | cut -d- -f2- | sort | uniq"}"; 20 | command = command; 21 | help = "list installed packages"; 22 | } 23 | ) 24 | 25 | ( 26 | let 27 | command = "repair"; 28 | in 29 | { 30 | bin = "${pkgs.writeShellScript command "nix-store --verify --check-contents --repair"}"; 31 | command = command; 32 | help = "repair nix store"; 33 | } 34 | ) 35 | ]; 36 | 37 | nix = { 38 | # Use flake's nixpkgs input for nix-shell 39 | nixPath = mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry; 40 | registry = mapAttrs (_: v: { flake = v; }) inputs; 41 | 42 | settings = { 43 | auto-optimise-store = true; 44 | 45 | experimental-features = [ 46 | "nix-command" 47 | "flakes" 48 | ]; 49 | }; 50 | }; 51 | 52 | nixpkgs.config.allowUnfree = true; 53 | } 54 | -------------------------------------------------------------------------------- /system/applications/modules/nixfmt/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | ... 4 | }: 5 | 6 | let 7 | package = pkgs.nixfmt-rfc-style; 8 | in 9 | { 10 | environment.systemPackages = [ package ]; 11 | 12 | icedos.internals.toolset.commands = [ 13 | ( 14 | let 15 | command = "nixf"; 16 | in 17 | { 18 | bin = "${pkgs.writeShellScript command ''find "''${1:-.}" -type f -name "*.nix" -exec "${package}/bin/nixfmt" {} \;''}"; 19 | command = command; 20 | help = "format all nix files of current or provided directory"; 21 | } 22 | ) 23 | ]; 24 | } 25 | -------------------------------------------------------------------------------- /system/applications/modules/obs-studio/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) mkIf; 9 | cfg = config.icedos.applications.obs-studio; 10 | in 11 | mkIf (cfg.enable) { 12 | programs.obs-studio = { 13 | enable = true; 14 | enableVirtualCamera = cfg.virtualCamera; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /system/applications/modules/ollama/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) 9 | head 10 | length 11 | mapAttrs 12 | mkIf 13 | ; 14 | 15 | cfg = config.icedos; 16 | ollama = cfg.applications.ollama; 17 | in 18 | mkIf (ollama.enable) { 19 | services.ollama = { 20 | enable = true; 21 | rocmOverrideGfx = ollama.rocmOverrideGfx; 22 | loadModels = ollama.models; 23 | }; 24 | 25 | home-manager.users = mapAttrs (user: _: { 26 | programs.zed-editor = mkIf (cfg.applications.zed.enable) { 27 | userSettings = mkIf (ollama.enable) { 28 | assistant = { 29 | default_model = { 30 | provider = "ollama"; 31 | model = if (length ollama.models != 0) then "${head (ollama.models)}" else ""; 32 | }; 33 | 34 | version = 2; 35 | }; 36 | 37 | language_models = { 38 | ollama = { 39 | api_url = "http://localhost:11434"; 40 | available_models = map (model: { 41 | name = "${model}"; 42 | display_name = "${model}"; 43 | max_tokens = 32768; 44 | }) (ollama.models); 45 | }; 46 | }; 47 | }; 48 | }; 49 | }) cfg.system.users; 50 | } 51 | -------------------------------------------------------------------------------- /system/applications/modules/php/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs mkIf; 10 | cfg = config.icedos; 11 | in 12 | mkIf (cfg.applications.php) { 13 | environment.systemPackages = with pkgs; [ 14 | intelephense # Language server 15 | php # An HTML-embedded scripting language 16 | phpPackages.composer # Dependency Manager 17 | phpPackages.phpstan # Static Analysis Tool 18 | ]; 19 | 20 | home-manager.users = mapAttrs (user: _: { 21 | programs.vscode.profiles.default = mkIf (cfg.applications.codium.enable) { 22 | extensions = [ pkgs.vscode-extensions.bmewburn.vscode-intelephense-client ]; 23 | userSettings.intelephense.format.braces = "k&r"; 24 | }; 25 | 26 | programs.zed-editor.userSettings = mkIf (cfg.applications.zed.enable) { 27 | languages.PHP.language_servers = [ 28 | "intelephense" 29 | "!phpactor" 30 | ]; 31 | 32 | lsp.intelephense.settings.format.braces = "k&r"; 33 | }; 34 | }) cfg.system.users; 35 | } 36 | -------------------------------------------------------------------------------- /system/applications/modules/rust/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mkIf; 10 | cfg = config.icedos.applications; 11 | in 12 | mkIf (cfg.rust) { 13 | environment.systemPackages = with pkgs; [ 14 | cargo # Package manager 15 | rust-analyzer # Language server 16 | rustfmt # Formatter 17 | ]; 18 | } 19 | -------------------------------------------------------------------------------- /system/applications/modules/signal/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mkIf; 10 | cfg = config.icedos.applications.signal; 11 | 12 | package = 13 | with pkgs; 14 | { 15 | flare = flare-signal; 16 | signal = signal-desktop; 17 | } 18 | .${cfg.package}; 19 | in 20 | mkIf (cfg.enable) { 21 | environment.systemPackages = [ package ]; 22 | } 23 | -------------------------------------------------------------------------------- /system/applications/modules/solaar/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mkIf; 10 | cfg = config.icedos.applications; 11 | in 12 | mkIf (cfg.solaar) { 13 | environment.systemPackages = [ pkgs.solaar ]; 14 | services.udev.packages = [ pkgs.logitech-udev-rules ]; 15 | } 16 | -------------------------------------------------------------------------------- /system/applications/modules/ssh/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) mkIf; 9 | cfg = config.icedos.applications; 10 | in 11 | mkIf (cfg.ssh) { 12 | services.openssh.enable = true; 13 | programs.zsh.shellAliases.ssh = "TERM=xterm-256color ssh"; 14 | } 15 | -------------------------------------------------------------------------------- /system/applications/modules/steam/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) 9 | mapAttrs 10 | mkIf 11 | ; 12 | 13 | cfg = config.icedos; 14 | in 15 | mkIf (cfg.applications.steam.enable) { 16 | home-manager.users = mapAttrs ( 17 | user: _: 18 | let 19 | type = cfg.system.users.${user}.type; 20 | in 21 | { 22 | home = { 23 | file = { 24 | # Enable steam beta 25 | ".local/share/Steam/package/beta" = mkIf (type != "work" && cfg.applications.steam.beta) { 26 | text = if (cfg.applications.steam.session.enable) then "steamdeck_publicbeta" else "publicbeta"; 27 | }; 28 | 29 | # Enable slow steam downloads workaround 30 | ".local/share/Steam/steam_dev.cfg" = 31 | mkIf (type != "work" && cfg.applications.steam.downloadsWorkaround) 32 | { 33 | text = '' 34 | @nClientDownloadEnableHTTP2PlatformLinux 0 35 | @fDownloadRateImprovementToAddAnotherConnection 1.0 36 | ''; 37 | }; 38 | }; 39 | }; 40 | } 41 | ) cfg.system.users; 42 | 43 | programs.steam = mkIf (cfg.hardware.devices.steamdeck) { 44 | enable = true; 45 | extest.enable = true; 46 | }; 47 | } 48 | -------------------------------------------------------------------------------- /system/applications/modules/sunshine/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) mkIf; 9 | cfg = config.icedos.applications.sunshine; 10 | in 11 | mkIf (cfg.enable) { 12 | services.sunshine = { 13 | enable = true; 14 | capSysAdmin = true; 15 | autoStart = cfg.autostart; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /system/applications/modules/tailscale/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mkIf optional; 10 | cfg = config.icedos.applications.tailscale; 11 | in 12 | mkIf (cfg.enable) { 13 | environment.systemPackages = with pkgs; [ tailscale ] ++ optional (cfg.enableTrayscale) trayscale; 14 | services.tailscale.enable = true; 15 | } 16 | -------------------------------------------------------------------------------- /system/applications/modules/virt-manager/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) mapAttrs mkIf optional; 9 | inherit (config.icedos.hardware) cpus; 10 | cfg = config.icedos.system; 11 | in 12 | mkIf (cfg.virtualisation.virtManager) { 13 | programs.virt-manager.enable = true; 14 | 15 | virtualisation = { 16 | libvirtd.enable = true; 17 | spiceUSBRedirection.enable = true; 18 | }; 19 | 20 | users.users = mapAttrs (user: _: { 21 | extraGroups = [ "libvirtd" ]; 22 | }) cfg.users; 23 | 24 | boot.kernelParams = 25 | [ 26 | # Allows passthrough of independent devices, that are members of larger IOMMU groups 27 | # It only affects kernels with ACS Override support. Ex: CachyOS, Liquorix, Zen 28 | "pcie_acs_override=downstream,multifunction" 29 | ] 30 | ++ optional cpus.amd.enable "amd_iommu=on" 31 | ++ optional cpus.intel "intel_iommu=on"; 32 | } 33 | -------------------------------------------------------------------------------- /system/applications/modules/waydroid/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | ... 4 | }: 5 | 6 | let 7 | cfg = config.icedos.system.virtualisation; 8 | in 9 | { 10 | virtualisation.waydroid.enable = cfg.waydroid; 11 | } 12 | -------------------------------------------------------------------------------- /system/applications/modules/wg-quick/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) listToAttrs mkIf; 10 | cfg = config.icedos.hardware.networking.wg-quick; 11 | in 12 | mkIf (cfg.enable) { 13 | networking.wg-quick.interfaces = listToAttrs ( 14 | map (name: { 15 | inherit name; 16 | 17 | value = { 18 | configFile = "/etc/wireguard/${name}.conf"; 19 | }; 20 | }) cfg.interfaces 21 | ); 22 | 23 | icedos.internals.toolset.commands = [ 24 | ( 25 | let 26 | command = "wg-config"; 27 | in 28 | { 29 | bin = "${pkgs.writeShellScript command '' 30 | sudo bash -c ' 31 | set -e 32 | 33 | if [[ "$1" == "" ]]; then 34 | echo "error: provide config file location as an argument" 35 | exit 1 36 | fi 37 | 38 | newFile="/etc/wireguard/''$(basename $1)" 39 | 40 | mkdir -p /etc/wireguard 41 | umask 0022 /etc/wireguard 42 | 43 | cp "$1" "$newFile" 44 | chmod 600 "$newFile" 45 | rm "$1" 46 | ' -- $@ 47 | ''}"; 48 | command = command; 49 | help = "add wireguard config to /etc/wireguard"; 50 | } 51 | ) 52 | ]; 53 | } 54 | -------------------------------------------------------------------------------- /system/applications/modules/zed/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs mkIf; 10 | cfg = config.icedos; 11 | zed = cfg.applications.zed; 12 | in 13 | mkIf (zed.enable) { 14 | environment.variables.EDITOR = mkIf (cfg.applications.defaultEditor == "zed") "zeditor -n -w"; 15 | 16 | environment.systemPackages = with pkgs; [ 17 | nil 18 | nixd 19 | package-version-server 20 | ]; 21 | 22 | home-manager.users = mapAttrs (user: _: { 23 | programs.zed-editor = { 24 | enable = true; 25 | 26 | extensions = [ 27 | "git-firefly" 28 | "html" 29 | "nix" 30 | "one-dark-pro" 31 | "php" 32 | "sql" 33 | "toml" 34 | "twig" 35 | ]; 36 | 37 | userSettings = { 38 | auto_update = false; 39 | autosave = "off"; 40 | buffer_font_family = "JetBrainsMono Nerd Font"; 41 | buffer_font_size = 14; 42 | chat_panel.button = false; 43 | collaboration_panel.button = false; 44 | features.inline_completion_provider = "none"; 45 | 46 | indent_guides = { 47 | enabled = true; 48 | coloring = "indent_aware"; 49 | }; 50 | 51 | inlay_hints.enabled = true; 52 | journal.hour_format = "hour24"; 53 | lsp.nil.initialization_options.formatting.command = [ "nixfmt" ]; 54 | notification_panel.button = false; 55 | relative_line_numbers = true; 56 | show_whitespaces = "boundary"; 57 | tabs.git_status = true; 58 | 59 | terminal = { 60 | blinking = "on"; 61 | copy_on_select = true; 62 | font_family = "JetBrainsMono Nerd Font"; 63 | font_size = 14; 64 | }; 65 | 66 | theme = { 67 | dark = zed.theme.dark; 68 | light = zed.theme.light; 69 | mode = zed.theme.mode; 70 | }; 71 | 72 | ui_font_size = 16; 73 | vim_mode = zed.vim; 74 | }; 75 | }; 76 | }) cfg.system.users; 77 | } 78 | -------------------------------------------------------------------------------- /system/applications/modules/zen-browser/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | config, 5 | inputs, 6 | ... 7 | }: 8 | 9 | let 10 | inherit (lib) attrNames filterAttrs mkIf; 11 | 12 | cfg = config.icedos; 13 | package = (inputs.zen-browser.packages."${pkgs.system}".default); 14 | 15 | getModules = 16 | path: 17 | map (dir: ./. + ("/modules/" + dir)) ( 18 | attrNames (filterAttrs (n: v: v == "directory") (builtins.readDir path)) 19 | ); 20 | in 21 | { 22 | imports = getModules (./modules); 23 | 24 | # Set as default browser for electron apps 25 | environment = { 26 | sessionVariables.DEFAULT_BROWSER = mkIf ( 27 | cfg.applications.zen-browser.enable && cfg.applications.defaultBrowser == "zen" 28 | ) "${package}/bin/zen-beta"; 29 | 30 | systemPackages = [ package ]; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /system/applications/modules/zen-browser/modules/profiles/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | inputs, 4 | lib, 5 | pkgs, 6 | ... 7 | }: 8 | 9 | let 10 | inherit (lib) 11 | concatImapStrings 12 | filter 13 | listToAttrs 14 | mapAttrs 15 | ; 16 | 17 | cfg = config.icedos; 18 | profiles = filter (profile: profile.pwa) cfg.applications.zen-browser.profiles; 19 | in 20 | { 21 | environment.systemPackages = map ( 22 | profile: 23 | pkgs.writeShellScriptBin profile.exec '' 24 | ${ 25 | inputs.zen-browser.packages."${pkgs.system}".default 26 | }/bin/zen-beta --no-remote -P ${profile.exec} --name "${profile.exec}" ${toString profile.sites} 27 | '' 28 | ) profiles; 29 | 30 | home-manager.users = mapAttrs (user: _: { 31 | xdg.desktopEntries = listToAttrs ( 32 | map (profile: { 33 | name = profile.exec; 34 | 35 | value = { 36 | exec = profile.exec; 37 | icon = profile.icon; 38 | name = profile.name; 39 | terminal = false; 40 | type = "Application"; 41 | }; 42 | }) profiles 43 | ); 44 | 45 | home.file.".zen/profiles.ini" = { 46 | text = '' 47 | ${concatImapStrings (i: profile: '' 48 | [Profile${toString (i - 1)}] 49 | Name=${profile.exec} 50 | IsRelative=1 51 | Path=${profile.exec} 52 | ZenAvatarPath=chrome://browser/content/zen-avatars/avatar-63.svg 53 | Default=${if (profile.default) then "1" else "0"} 54 | '') cfg.applications.zen-browser.profiles} 55 | 56 | [General] 57 | StartWithLastProfile=1 58 | Version=2 59 | ''; 60 | force = true; 61 | }; 62 | }) cfg.system.users; 63 | } 64 | -------------------------------------------------------------------------------- /system/applications/modules/zen-browser/modules/user.js/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) 10 | listToAttrs 11 | mapAttrs 12 | mkIf 13 | substring 14 | ; 15 | 16 | cfg = config.icedos; 17 | accentColor = cfg.internals.accentColor; 18 | firefoxVersion = substring 0 5 pkgs.firefox.version; 19 | 20 | userJs = '' 21 | user_pref("browser.download.always_ask_before_handling_new_types", false); 22 | user_pref("browser.newtabpage.enabled", false); 23 | user_pref("browser.search.separatePrivateDefault", false); 24 | user_pref("browser.shell.checkDefaultBrowser", false); 25 | user_pref("browser.startup.homepage", "chrome://browser/content/blanktab.html"); 26 | user_pref("browser.toolbars.bookmarks.visibility", "always"); 27 | user_pref("dom.webgpu.enabled", true); 28 | user_pref("general.autoScroll", true); 29 | user_pref("general.useragent.override", "Mozilla/5.0 (X11; Linux x86_64; rv:${firefoxVersion}) Gecko/${firefoxVersion} Firefox/${firefoxVersion}"); 30 | user_pref("media.videocontrols.picture-in-picture.video-toggle.enabled", false); 31 | user_pref("middlemouse.paste", false); 32 | user_pref("mousewheel.default.delta_multiplier_x", 250); 33 | user_pref("mousewheel.with_shift.delta_multiplier_y", 250); 34 | user_pref("toolkit.scrollbox.verticalScrollDistance", 2); 35 | user_pref("zen.splitView.change-on-hover", true); 36 | user_pref("zen.theme.accent-color", "${accentColor}"); 37 | user_pref("zen.theme.color-prefs.amoled", true); 38 | user_pref("zen.theme.color-prefs.use-workspace-colors", false); 39 | user_pref("zen.urlbar.behavior", "float"); 40 | user_pref("zen.view.compact", true); 41 | user_pref("zen.view.compact.hide-tabbar", true); 42 | user_pref("zen.view.compact.hide-toolbar", true); 43 | user_pref("zen.view.show-newtab-button-border-top", false); 44 | user_pref("zen.view.sidebar-expanded.on-hover", false); 45 | user_pref("zen.view.use-single-toolbar", false); 46 | user_pref("zen.welcome-screen.seen", true); 47 | 48 | ${ 49 | if (!cfg.applications.zen-browser.privacy) then 50 | '' 51 | user_pref("privacy.clearOnShutdown.downloads", false); 52 | user_pref("privacy.clearOnShutdown.history", false); 53 | '' 54 | else 55 | '' 56 | user_pref("browser.startup.page", 1); 57 | user_pref("browser.urlbar.suggest.history", false); 58 | user_pref("browser.urlbar.suggest.recentsearches", false); 59 | user_pref("pref.privacy.disable_button.cookie_exceptions", false); 60 | user_pref("privacy.clearOnShutdown_v2.historyFormDataAndDownloads", false); 61 | user_pref("privacy.history.custom", true); 62 | user_pref("privacy.sanitize.sanitizeOnShutdown", true); 63 | user_pref("signon.management.page.breach-alerts.enabled", false); 64 | user_pref("signon.rememberSignons", false); 65 | '' 66 | } 67 | ''; 68 | in 69 | mkIf (cfg.applications.zen-browser.enable) { 70 | home-manager.users = mapAttrs (user: _: { 71 | home.file = listToAttrs ( 72 | map (profile: { 73 | name = ".zen/${profile.exec}/user.js"; 74 | 75 | value = { 76 | text = 77 | if (!profile.pwa) then 78 | userJs 79 | else 80 | userJs 81 | + '' 82 | user_pref("browser.toolbars.bookmarks.visibility", "never"); 83 | user_pref("zen.tab-unloader.enabled", false); 84 | user_pref("zen.view.sidebar-expanded", false); 85 | user_pref("zen.view.compact.hide-tabbar", false); 86 | ''; 87 | }; 88 | }) cfg.applications.zen-browser.profiles 89 | ); 90 | }) cfg.system.users; 91 | } 92 | -------------------------------------------------------------------------------- /system/applications/modules/zsh/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs; 10 | cfg = config.icedos; 11 | in 12 | { 13 | home-manager.users = mapAttrs (user: _: { 14 | programs.zsh.enable = true; 15 | 16 | home.file = { 17 | ".config/zsh/p10k.zsh".source = 18 | "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; 19 | 20 | ".config/zsh/p10k-theme.zsh".source = ./p10k-theme.zsh; 21 | }; 22 | }) cfg.system.users; 23 | 24 | programs.zsh = { 25 | enable = true; 26 | 27 | ohMyZsh = { 28 | enable = true; 29 | plugins = [ 30 | "git" 31 | "npm" 32 | "sudo" 33 | "systemd" 34 | ]; 35 | }; 36 | 37 | autosuggestions.enable = true; 38 | syntaxHighlighting.enable = true; 39 | 40 | interactiveShellInit = '' 41 | if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then 42 | source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" 43 | fi 44 | 45 | [[ ! -f ~/.config/zsh/p10k.zsh ]] || source ~/.config/zsh/p10k.zsh 46 | [[ ! -f ~/.config/zsh/p10k-theme.zsh ]] || source ~/.config/zsh/p10k-theme.zsh 47 | unsetopt PROMPT_SP 48 | ''; 49 | }; 50 | 51 | users.defaultUserShell = pkgs.zsh; 52 | } 53 | -------------------------------------------------------------------------------- /system/applications/modules/zsh/p10k-theme.zsh: -------------------------------------------------------------------------------- 1 | 'builtin' 'local' '-a' 'p10k_config_opts' 2 | [[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') 3 | [[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') 4 | [[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') 5 | 'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' 6 | 7 | () { 8 | emulate -L zsh -o extended_glob 9 | 10 | unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' 11 | 12 | [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return 13 | 14 | local grey='242' 15 | local red='#FF5C57' 16 | local yellow='#F3F99D' 17 | local blue='#57C7FF' 18 | local magenta='#FF6AC1' 19 | local cyan='#9AEDFE' 20 | local white='#F1F1F0' 21 | 22 | typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( 23 | context # user@host 24 | dir # current directory 25 | vcs # git status 26 | command_execution_time # previous command duration 27 | virtualenv # python virtual environment 28 | prompt_char # prompt symbol 29 | ) 30 | 31 | typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( 32 | time # current time 33 | ) 34 | 35 | typeset -g POWERLEVEL9K_BACKGROUND= # transparent background 36 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace 37 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space 38 | typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol 39 | typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION= # no segment icons 40 | typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false 41 | typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS}_FOREGROUND=$magenta 42 | typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS}_FOREGROUND=$red 43 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' 44 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' 45 | typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='❮' 46 | typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=false 47 | typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=$grey 48 | typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false 49 | typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= 50 | typeset -g POWERLEVEL9K_DIR_FOREGROUND=$blue 51 | typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE="%F{$white}%n%f%F{$grey}@%m%f" 52 | typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE="%F{$grey}%n@%m%f" 53 | typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_CONTENT_EXPANSION= 54 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=5 55 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 56 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' 57 | typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=$yellow 58 | typeset -g POWERLEVEL9K_VCS_FOREGROUND=$grey 59 | typeset -g POWERLEVEL9K_VCS_LOADING_TEXT= 60 | typeset -g POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS=0 61 | typeset -g POWERLEVEL9K_VCS_{INCOMING,OUTGOING}_CHANGESFORMAT_FOREGROUND=$cyan 62 | typeset -g POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind) 63 | typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= 64 | typeset -g POWERLEVEL9K_VCS_COMMIT_ICON='@' 65 | typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED}_ICON= 66 | typeset -g POWERLEVEL9K_VCS_DIRTY_ICON='*' 67 | typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=':⇣' 68 | typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=':⇡' 69 | typeset -g POWERLEVEL9K_VCS_{COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=1 70 | typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${${${P9K_CONTENT/⇣* :⇡/⇣⇡}// }//:/ }' 71 | typeset -g POWERLEVEL9K_TIME_FOREGROUND=$grey 72 | typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' 73 | typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false 74 | typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off 75 | typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose 76 | typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true 77 | (( ! $+functions[p10k] )) || p10k reload 78 | } 79 | 80 | # Tell `p10k configure` which file it should overwrite. 81 | typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} 82 | 83 | (( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} 84 | 'builtin' 'unset' 'p10k_config_opts' 85 | -------------------------------------------------------------------------------- /system/desktop/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) attrNames filterAttrs mkIf; 10 | cfg = config.icedos; 11 | 12 | getModules = 13 | path: 14 | map (dir: ./. + ("/modules/" + dir)) ( 15 | attrNames (filterAttrs (_: v: v == "directory") (builtins.readDir path)) 16 | ); 17 | in 18 | { 19 | imports = getModules (./modules); 20 | time.timeZone = "Europe/Bucharest"; 21 | 22 | i18n = { 23 | defaultLocale = "en_US.UTF-8"; 24 | extraLocaleSettings.LC_MEASUREMENT = "es_ES.UTF-8"; 25 | }; 26 | 27 | services = { 28 | displayManager.autoLogin = 29 | mkIf (cfg.desktop.autologin.enable && !cfg.applications.steam.session.autoStart.enable) 30 | { 31 | enable = true; 32 | user = cfg.desktop.autologin.user; 33 | }; 34 | }; 35 | 36 | environment = { 37 | systemPackages = with pkgs; [ 38 | adwaita-icon-theme # Gtk theme 39 | amberol # Music player 40 | dconf-editor # Edit gnome's dconf 41 | libnotify # Send desktop notifications 42 | libreoffice-fresh # Office tools 43 | loupe # Image viewer 44 | ]; 45 | 46 | sessionVariables = { 47 | NIXOS_OZONE_WL = 1; 48 | QT_QPA_PLATFORM = "wayland;xcb"; 49 | QT_QPA_PLATFORMTHEME = "qt5ct"; 50 | }; 51 | }; 52 | 53 | fonts.packages = with pkgs; [ 54 | cantarell-fonts 55 | meslo-lgs-nf 56 | nerd-fonts.jetbrains-mono 57 | ]; 58 | 59 | xdg.portal.config.common.default = "*"; 60 | } 61 | -------------------------------------------------------------------------------- /system/desktop/gnome/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) attrNames filterAttrs; 9 | 10 | getModules = 11 | path: 12 | map (dir: ./. + ("/modules/" + dir)) ( 13 | attrNames (filterAttrs (_: v: v == "directory") (builtins.readDir path)) 14 | ); 15 | in 16 | { 17 | imports = getModules (./modules); 18 | services.desktopManager.gnome.enable = true; 19 | programs.dconf.enable = true; 20 | environment.systemPackages = [ pkgs.gnome-tweaks ]; 21 | 22 | environment.gnome.excludePackages = with pkgs; [ 23 | cheese # Camera 24 | eog # Image viewer 25 | epiphany # Web browser 26 | evince # Document viewer 27 | geary # Email 28 | gnome-browser-connector # Install gnome extensions from the browser 29 | gnome-calendar # Calendar 30 | gnome-characters # Emojis 31 | gnome-console # Terminal 32 | gnome-contacts # Contacts 33 | gnome-font-viewer # Font viewer 34 | gnome-maps # Maps 35 | gnome-music # Music 36 | gnome-software # Software center 37 | gnome-system-monitor # System monitoring tool 38 | gnome-text-editor # Text editor 39 | gnome-tour # Greeter 40 | simple-scan # Scanner 41 | totem # Videos 42 | yelp # Help 43 | ]; 44 | } 45 | -------------------------------------------------------------------------------- /system/desktop/gnome/modules/appindicator/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs; 10 | cfg = config.icedos; 11 | in 12 | { 13 | environment.systemPackages = [ 14 | pkgs.gnomeExtensions.appindicator 15 | ]; 16 | 17 | home-manager.users = mapAttrs (user: _: { 18 | dconf.settings."org/gnome/shell".enabled-extensions = [ "appindicatorsupport@rgcjonas.gmail.com" ]; 19 | }) cfg.system.users; 20 | } 21 | -------------------------------------------------------------------------------- /system/desktop/gnome/modules/arcmenu/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | inputs, 4 | lib, 5 | pkgs, 6 | ... 7 | }: 8 | let 9 | inherit (lib) map mapAttrs mkIf; 10 | cfg = config.icedos; 11 | in 12 | mkIf (cfg.desktop.gnome.extensions.arcmenu) { 13 | environment.systemPackages = [ pkgs.gnomeExtensions.arcmenu ]; 14 | 15 | home-manager.users = mapAttrs (user: _: { 16 | dconf.settings = { 17 | "org/gnome/shell" = { 18 | enabled-extensions = [ "arcmenu@arcmenu.com" ]; 19 | }; 20 | 21 | "org/gnome/shell/extensions/arcmenu" = { 22 | distro-icon = 6; 23 | menu-button-icon = "Distro_Icon"; # Use arch icon 24 | multi-monitor = true; 25 | menu-layout = "Windows"; 26 | windows-disable-frequent-apps = true; 27 | windows-disable-pinned-apps = !cfg.system.users.${user}.desktop.gnome.pinnedApps.arcmenu.enable; 28 | pinned-apps = 29 | with inputs.home-manager.lib.hm.gvariant; 30 | (map (s: [ 31 | (mkDictionaryEntry [ 32 | "id" 33 | s 34 | ]) 35 | ]) cfg.system.users.${user}.desktop.gnome.pinnedApps.arcmenu.list); 36 | }; 37 | }; 38 | }) cfg.system.users; 39 | } 40 | -------------------------------------------------------------------------------- /system/desktop/gnome/modules/dash-to-panel/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | let 8 | inherit (lib) mapAttrs mkIf; 9 | cfg = config.icedos; 10 | in 11 | mkIf (cfg.desktop.gnome.extensions.dashToPanel) { 12 | environment.systemPackages = [ pkgs.gnomeExtensions.dash-to-panel ]; 13 | 14 | home-manager.users = mapAttrs (user: _: { 15 | dconf.settings = { 16 | "org/gnome/shell" = { 17 | enabled-extensions = [ "dash-to-panel@jderose9.github.com" ]; 18 | }; 19 | 20 | "org/gnome/shell/extensions/dash-to-panel" = { 21 | panel-element-positions = '' 22 | { 23 | "0": [ 24 | {"element":"showAppsButton","visible":false,"position":"stackedTL"}, 25 | {"element":"activitiesButton","visible":false,"position":"stackedTL"}, 26 | {"element":"leftBox","visible":true,"position":"stackedTL"}, 27 | {"element":"taskbar","visible":true,"position":"stackedTL"}, 28 | {"element":"centerBox","visible":true,"position":"stackedBR"}, 29 | {"element":"rightBox","visible":true,"position":"stackedBR"}, 30 | {"element":"dateMenu","visible":true,"position":"stackedBR"}, 31 | {"element":"systemMenu","visible":true,"position":"stackedBR"}, 32 | {"element":"desktopButton","visible":true,"position":"stackedBR"} 33 | ], 34 | "1": [ 35 | {"element":"showAppsButton","visible":false,"position":"stackedTL"}, 36 | {"element":"activitiesButton","visible":false,"position":"stackedTL"}, 37 | {"element":"leftBox","visible":true,"position":"stackedTL"}, 38 | {"element":"taskbar","visible":true,"position":"stackedTL"}, 39 | {"element":"centerBox","visible":true,"position":"stackedBR"}, 40 | {"element":"rightBox","visible":true,"position":"stackedBR"}, 41 | {"element":"dateMenu","visible":true,"position":"stackedBR"}, 42 | {"element":"systemMenu","visible":true,"position":"stackedBR"}, 43 | {"element":"desktopButton","visible":true,"position":"stackedBR"} 44 | ] 45 | } 46 | ''; # Disable activities button 47 | panel-sizes = ''{"0":44}''; 48 | appicon-margin = 4; 49 | dot-style-focused = "DASHES"; 50 | dot-style-unfocused = "DOTS"; 51 | hide-overview-on-startup = true; 52 | scroll-icon-action = "NOTHING"; 53 | scroll-panel-action = "NOTHING"; 54 | hot-keys = true; 55 | }; 56 | }; 57 | }) cfg.system.users; 58 | } 59 | -------------------------------------------------------------------------------- /system/desktop/gnome/modules/home/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) mapAttrs mkIf; 9 | cfg = config.icedos; 10 | in 11 | { 12 | home-manager.users = mapAttrs (user: _: { 13 | dconf.settings = { 14 | "org/gnome/desktop/input-sources" = { 15 | # Use different keyboard language for each window 16 | per-window = true; 17 | }; 18 | 19 | "org/gnome/desktop/interface" = { 20 | accent-color = cfg.desktop.gnome.accentColor; 21 | color-scheme = "prefer-dark"; 22 | clock-show-seconds = true; 23 | clock-show-date = cfg.desktop.gnome.clock.date; 24 | clock-show-weekday = cfg.desktop.gnome.clock.weekday; 25 | show-battery-percentage = cfg.hardware.devices.laptop; 26 | enable-hot-corners = cfg.desktop.gnome.hotCorners; 27 | }; 28 | 29 | # Disable lockscreen notifications 30 | "org/gnome/desktop/notifications" = { 31 | show-in-lock-screen = false; 32 | }; 33 | 34 | "org/gnome/desktop/wm/preferences" = { 35 | # Buttons to show in titlebars 36 | button-layout = cfg.desktop.gnome.titlebarLayout; 37 | num-workspaces = toString (cfg.desktop.gnome.workspaces.maxWorkspaces); 38 | }; 39 | 40 | # Disable mouse acceleration 41 | "org/gnome/desktop/peripherals/mouse" = { 42 | accel-profile = "flat"; 43 | }; 44 | 45 | # Disable file history 46 | "org/gnome/desktop/privacy" = { 47 | remember-recent-files = false; 48 | }; 49 | 50 | # Turn off screen 51 | "org/gnome/desktop/session" = { 52 | idle-delay = 53 | if (cfg.system.users.${user}.desktop.idle.disableMonitors.enable) then 54 | toString (cfg.system.users.${user}.desktop.idle.disableMonitors.seconds) 55 | else 56 | 0; 57 | }; 58 | 59 | # Set screen lock 60 | "org/gnome/desktop/screensaver" = { 61 | lock-enabled = cfg.system.users.${user}.desktop.idle.lock.enable; 62 | lock-delay = toString (cfg.system.users.${user}.desktop.idle.lock.seconds); 63 | }; 64 | 65 | # Disable system sounds 66 | "org/gnome/desktop/sound" = { 67 | event-sounds = false; 68 | }; 69 | 70 | "org/gnome/mutter" = { 71 | # Enable window snapping to the edges of the screen 72 | edge-tiling = true; 73 | # Enable fractional scaling 74 | experimental-features = [ "scale-monitor-framebuffer" ]; 75 | dynamic-workspaces = cfg.desktop.gnome.workspaces.dynamicWorkspaces; 76 | }; 77 | 78 | "org/gnome/settings-daemon/plugins/power" = { 79 | # Auto suspend 80 | sleep-inactive-ac-type = 81 | if (cfg.system.users.${user}.desktop.idle.suspend.enable) then "suspend" else "nothing"; 82 | # Auto suspend timeout 83 | sleep-inactive-ac-timeout = toString (cfg.system.users.${user}.desktop.idle.suspend.seconds); 84 | # Power button shutdown 85 | power-button-action = cfg.desktop.gnome.powerButtonAction; 86 | }; 87 | 88 | "org/gnome/shell" = { 89 | disable-user-extensions = false; 90 | enabled-extensions = [ "user-theme@gnome-shell-extensions.gcampax.github.com" ]; 91 | 92 | favorite-apps = mkIf (cfg.system.users.${user}.desktop.gnome.pinnedApps.shell.enable 93 | ) cfg.system.users.${user}.desktop.gnome.pinnedApps.shell.list; 94 | }; 95 | 96 | "org/gnome/shell/keybindings" = { 97 | # Disable clock shortcut 98 | toggle-message-tray = [ ]; 99 | }; 100 | 101 | # Limit app switcher to current workspace 102 | "org/gnome/shell/app-switcher" = { 103 | current-workspace-only = true; 104 | }; 105 | }; 106 | }) cfg.system.users; 107 | } 108 | -------------------------------------------------------------------------------- /system/desktop/gnome/modules/startup/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) makeBinPath mapAttrs; 10 | cfg = config.icedos; 11 | in 12 | { 13 | home-manager.users = mapAttrs ( 14 | user: _: 15 | let 16 | startupScript = cfg.system.users.${user}.desktop.gnome.startupScript; 17 | in 18 | { 19 | home.file = { 20 | ".config/autostart/gnome-startup.desktop" = { 21 | text = '' 22 | [Desktop Entry] 23 | Exec=${ 24 | makeBinPath [ 25 | (pkgs.writeShellScriptBin "gnome-startup" '' 26 | run () { 27 | pidof $1 || "$@" & 28 | } 29 | 30 | ${startupScript} 31 | '') 32 | ] 33 | }/gnome-startup 34 | Icon=kitty 35 | Name=StartupScript 36 | StartupWMClass=startup 37 | Terminal=false 38 | Type=Application 39 | ''; 40 | }; 41 | }; 42 | } 43 | ) cfg.system.users; 44 | } 45 | -------------------------------------------------------------------------------- /system/desktop/hyprland/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) attrNames filterAttrs; 9 | 10 | getModules = 11 | path: 12 | map (dir: ./. + ("/modules/" + dir)) ( 13 | attrNames (filterAttrs (_: v: v == "directory") (builtins.readDir path)) 14 | ); 15 | in 16 | { 17 | imports = getModules (./modules); 18 | 19 | programs.hyprland = { 20 | enable = true; 21 | withUWSM = true; 22 | }; 23 | 24 | environment = { 25 | systemPackages = with pkgs; [ 26 | baobab # Disk usage analyser 27 | file-roller # Archive file manager 28 | gnome-disk-utility # Disks manager 29 | gnome-keyring # Keyring daemon 30 | gnome-online-accounts # Nextcloud integration 31 | gnome-themes-extra # Adwaita GTK theme 32 | hyprshade # Shader config tool 33 | wdisplays # Displays manager 34 | ]; 35 | }; 36 | 37 | services = { 38 | dbus = { 39 | enable = true; 40 | implementation = "broker"; 41 | }; 42 | 43 | gnome.gnome-keyring.enable = true; 44 | }; 45 | 46 | security = { 47 | polkit.enable = true; 48 | pam.services.login.enableGnomeKeyring = true; 49 | }; 50 | 51 | xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; 52 | } 53 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/csgo-vulkan-fix/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) 10 | mapAttrs 11 | mkIf 12 | ; 13 | 14 | cfg = config.icedos; 15 | in 16 | mkIf (cfg.desktop.hyprland.plugins.cs2fix.enable) { 17 | home-manager.users = mapAttrs (user: _: { 18 | wayland.windowManager.hyprland = { 19 | plugins = [ pkgs.hyprlandPlugins.csgo-vulkan-fix ]; 20 | 21 | settings.plugin = [ 22 | { 23 | csgo-vulkan-fix = { 24 | res_w = cfg.desktop.hyprland.cs2fix.width; 25 | res_h = cfg.desktop.hyprland.cs2fix.height; 26 | class = "cs2"; 27 | }; 28 | } 29 | ]; 30 | }; 31 | }) cfg.system.users; 32 | } 33 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/gnome-control-center/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs; 10 | cfg = config.icedos; 11 | in 12 | { 13 | environment.systemPackages = [ pkgs.gnome-control-center ]; 14 | 15 | home-manager.users = mapAttrs (user: _: { 16 | xdg.desktopEntries.gnome-control-center = { 17 | exec = "env XDG_CURRENT_DESKTOP=GNOME gnome-control-center"; 18 | icon = "gnome-control-center"; 19 | name = "Gnome Control Center"; 20 | terminal = false; 21 | type = "Application"; 22 | }; 23 | 24 | dconf.settings."org/gnome/control-center".last-panel = "online-accounts"; 25 | }) cfg.system.users; 26 | } 27 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/grimblast/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs; 10 | cfg = config.icedos; 11 | in 12 | { 13 | environment.systemPackages = [ pkgs.grimblast ]; 14 | 15 | home-manager.users = mapAttrs (user: _: { 16 | wayland.windowManager.hyprland.settings.bind = [ 17 | "$mainMod ALT, Print, exec, grimblast edit" 18 | "$mainMod CTRL SHIFT, P, exec, grimblast copy" 19 | "$mainMod SHIFT, P, exec, grimblast copy output" 20 | "$mainMod SHIFT, Print, exec, grimblast --freeze edit area" 21 | "$mainMod, P, exec, grimblast --freeze copy area" 22 | "$mainMod, Print, exec, grimblast --freeze copy area" 23 | ", Print, exec, grimblast copy output" 24 | "ALT, Print, exec, grimblast copy" 25 | "SHIFT, Print, exec, grimblast edit output" 26 | ]; 27 | }) cfg.system.users; 28 | } 29 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/home/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) 10 | concatLists 11 | filter 12 | genList 13 | imap 14 | makeBinPath 15 | mapAttrs 16 | mkIf 17 | ; 18 | 19 | animations = cfg.desktop.hyprland.settings.animations; 20 | cfg = config.icedos; 21 | monitors = cfg.hardware.monitors; 22 | 23 | getMonitorRotation = 24 | m: 25 | if (m.name == "eDP-1" && cfg.hardware.devices.steamdeck) then 26 | ",transform,3" 27 | else 28 | ",transform,${toString m.rotation}"; 29 | 30 | workspaceBinds = 31 | bind: command: 32 | (concatLists ( 33 | imap ( 34 | i: _: 35 | genList ( 36 | w: 37 | let 38 | cw = toString ((w + 1) + ((i - 1) * 10)); 39 | cb = if (w == 9) then "0" else "${toString (w + 1)}"; 40 | 41 | extraBind = 42 | if (i == 4) then 43 | "CTRL ALT" 44 | else if (i == 3) then 45 | "ALT" 46 | else if (i == 2) then 47 | "CTRL" 48 | else 49 | ""; 50 | in 51 | if (i < 5) then "$mainMod ${bind} ${extraBind},${cb},${command},${cw}" else "" 52 | ) 10 53 | ) (filter (m: !m.disable) monitors) 54 | )); 55 | in 56 | { 57 | home-manager.users = mapAttrs (user: _: { 58 | wayland.windowManager.hyprland = { 59 | enable = true; 60 | settings = { 61 | "$mainMod" = "SUPER"; 62 | 63 | animation = 64 | if (animations.enable) then "global, 1, ${toString (animations.speed)}, bezier" else "global, 0"; 65 | 66 | bezier = mkIf (animations.enable) "bezier, ${animations.bezierCurve}"; 67 | 68 | bind = 69 | [ 70 | "$mainMod, Q, killactive" 71 | "$mainMod, T, togglefloating" 72 | "$mainMod, S, togglesplit" 73 | "$mainMod, F, fullscreen, 0" 74 | "$mainMod, M, fullscreen, 1" 75 | "$mainMod, left, movefocus, l" 76 | "$mainMod, right, movefocus, r" 77 | "$mainMod, up, movefocus, u" 78 | "$mainMod, down, movefocus, d" 79 | "$mainMod SHIFT, left, movewindow, l" 80 | "$mainMod SHIFT, right, movewindow, r" 81 | "$mainMod SHIFT, up, movewindow, u" 82 | "$mainMod SHIFT, down, movewindow, d" 83 | "$mainMod ALT, left, workspace, e-1" 84 | "$mainMod ALT, right, workspace, e+1" 85 | "$mainMod SHIFT ALT, left, movetoworkspace, e-1" 86 | "$mainMod SHIFT ALT, right, movetoworkspace, e+1" 87 | "$mainMod, mouse_down, workspace, e-1" 88 | "$mainMod, mouse_up, workspace, e+1" 89 | ] 90 | ++ workspaceBinds "" "workspace" 91 | ++ workspaceBinds "SHIFT" "movetoworkspace"; 92 | 93 | bindel = [ 94 | ", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ -l 1" 95 | ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" 96 | ]; 97 | 98 | bindl = [ ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" ]; 99 | 100 | bindm = [ 101 | "$mainMod, mouse:272, movewindow" 102 | "$mainMod, mouse:273, resizewindow" 103 | ]; 104 | 105 | decoration = { 106 | rounding = 5; 107 | }; 108 | 109 | env = [ 110 | "QT_AUTO_SCREEN_SCALE_FACTOR,1" 111 | "WLR_DRM_NO_ATOMIC,1" 112 | "XDG_CURRENT_DESKTOP,Hyprland" 113 | "XDG_SESSION_DESKTOP,Hyprland" 114 | "XDG_SESSION_TYPE,wayland" 115 | ]; 116 | 117 | exec-once = [ 118 | '' 119 | ${ 120 | makeBinPath [ 121 | (pkgs.writeShellScriptBin "hyprland-startup" cfg.desktop.hyprland.settings.startupScript) 122 | ] 123 | }/hyprland-startup 124 | '' 125 | ]; 126 | 127 | general = { 128 | allow_tearing = true; 129 | "col.active_border" = "rgb(505050)"; 130 | "col.inactive_border" = "rgb(000000)"; 131 | gaps_in = 0; 132 | gaps_out = 0; 133 | resize_on_border = true; 134 | }; 135 | 136 | input = { 137 | accel_profile = "flat"; 138 | follow_mouse = cfg.desktop.hyprland.settings.followMouse; 139 | kb_layout = "us,gr"; 140 | kb_options = "grp:win_space_toggle"; 141 | }; 142 | 143 | misc = { 144 | "col.splash" = "rgb(000000)"; 145 | disable_hyprland_logo = true; 146 | disable_splash_rendering = true; 147 | key_press_enables_dpms = true; 148 | mouse_move_enables_dpms = true; 149 | new_window_takes_over_fullscreen = 1; 150 | }; 151 | 152 | monitor = ( 153 | map ( 154 | m: 155 | let 156 | name = m.name; 157 | resolution = m.resolution; 158 | refreshRate = toString (m.refreshRate); 159 | position = toString (m.position); 160 | scaling = toString (m.scaling); 161 | rotation = getMonitorRotation m; 162 | bitDepth = if (m.tenBit) then ",bitdepth,10" else ""; 163 | in 164 | if (m.disable) then 165 | "${name},disable" 166 | else 167 | "${name},${resolution}@${refreshRate},${position},${scaling}${rotation}${bitDepth}" 168 | ) monitors 169 | ); 170 | 171 | windowrulev2 = [ 172 | "noborder, fullscreen:1" # Hide maximized window borders 173 | ] ++ cfg.desktop.hyprland.settings.windowRules; 174 | 175 | workspace = ( 176 | concatLists ( 177 | imap ( 178 | i: m: 179 | let 180 | name = m.name; 181 | in 182 | genList ( 183 | w: 184 | let 185 | cw = toString ((w + 1) + ((i - 1) * 10)); 186 | default = if (w == 0) then ",default:true" else ""; 187 | in 188 | "${cw},monitor:${name}${default}" 189 | ) 10 190 | ) (filter (m: !m.disable) monitors) 191 | ) 192 | ); 193 | }; 194 | }; 195 | }) cfg.system.users; 196 | } 197 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/hypridle/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs optional; 10 | cfg = config.icedos; 11 | in 12 | { 13 | environment.systemPackages = [ pkgs.brightnessctl ]; 14 | 15 | home-manager.users = mapAttrs ( 16 | user: _: 17 | let 18 | idle = cfg.system.users.${user}.desktop.idle; 19 | in 20 | { 21 | services.hypridle = { 22 | enable = true; 23 | 24 | settings = { 25 | general = { 26 | lock_cmd = "pidof hyprlock || hyprlock"; 27 | before_sleep_cmd = "loginctl lock-session"; 28 | after_sleep_cmd = ''hyprctl dispatch dpms on''; 29 | }; 30 | 31 | listener = 32 | [ 33 | { 34 | timeout = toString (cfg.desktop.hyprland.settings.secondsToLowerBrightness); 35 | on-timeout = "brightnessctl -s set 10 && brightnessctl -sd rgb:kbd_backlight set 0"; 36 | on-resume = "brightnessctl -r && brightnessctl -rd rgb:kbd_backlight"; 37 | } 38 | ] 39 | ++ optional (idle.lock.enable) { 40 | timeout = toString (idle.lock.seconds); 41 | on-timeout = "loginctl lock-session"; 42 | } 43 | ++ optional (idle.disableMonitors.enable) { 44 | timeout = toString (idle.disableMonitors.seconds); 45 | on-timeout = "hyprctl dispatch dpms off"; 46 | on-resume = "hyprctl dispatch dpms on"; 47 | } 48 | ++ optional (idle.suspend.enable) { 49 | timeout = toString (idle.suspend.seconds); 50 | on-timeout = "systemctl suspend"; 51 | }; 52 | }; 53 | }; 54 | } 55 | ) cfg.system.users; 56 | } 57 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/hyprland-per-window-layout/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs; 10 | cfg = config.icedos; 11 | package = pkgs.hyprland-per-window-layout; 12 | in 13 | { 14 | environment.systemPackages = [ package ]; 15 | 16 | home-manager.users = mapAttrs (user: _: { 17 | systemd.user.services.hyprland-per-window-layout = { 18 | Unit.Description = "Hyprland per window layout"; 19 | Install.WantedBy = [ "graphical-session.target" ]; 20 | 21 | Service = { 22 | ExecStart = "${package}/bin/hyprland-per-window-layout"; 23 | Nice = "-20"; 24 | Restart = "on-failure"; 25 | StartLimitIntervalSec = 60; 26 | StartLimitBurst = 60; 27 | }; 28 | }; 29 | }) cfg.system.users; 30 | } 31 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/hyprlock/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs; 10 | cfg = config.icedos; 11 | in 12 | { 13 | environment.systemPackages = [ pkgs.jq ]; 14 | security.pam.services.hyprlock = { }; 15 | 16 | home-manager.users = mapAttrs (user: _: { 17 | wayland.windowManager.hyprland.settings.bind = [ 18 | "$mainMod, L, exec, ${pkgs.writeShellScript "lock" "loginctl lock-session"}" 19 | ]; 20 | 21 | programs.hyprlock = { 22 | enable = true; 23 | 24 | settings = { 25 | general = { 26 | hide_cursor = true; 27 | }; 28 | 29 | background = { 30 | blur_passes = 5; 31 | blur_size = 1; 32 | brightness = 0.6; 33 | color = "rgba(25, 20, 20, 1.0)"; 34 | contrast = 0.8; 35 | noise = 0; 36 | path = "screenshot"; 37 | vibrancy = 0.2; 38 | vibrancy_darkness = 0.0; 39 | }; 40 | 41 | input-field = { 42 | capslock_color = "rgb(76,175,80)"; 43 | dots_center = true; 44 | dots_rounding = -2; 45 | dots_size = 0.25; 46 | dots_spacing = 0.15; 47 | fade_on_empty = false; 48 | font_color = "rgb(255, 255, 255)"; 49 | halign = "center"; 50 | hide_input = false; 51 | inner_color = "rgb(52, 52, 52)"; 52 | outer_color = "rgba(0, 0 , 0, 0)"; 53 | outline_thickness = 2; 54 | placeholder_text = "Enter password..."; 55 | position = "0, 0"; 56 | rounding = -1; 57 | size = "230, 50"; 58 | valign = "center"; 59 | }; 60 | 61 | label = [ 62 | { 63 | color = "rgba(200, 200, 200, 1.0)"; 64 | font_size = 24; 65 | halign = "center"; 66 | position = "0, 50"; 67 | text = ''cmd[update:1000] echo "$(date +%H:%M:%S)"''; 68 | valign = "center"; 69 | } 70 | { 71 | color = "rgba(200, 200, 200, 1.0)"; 72 | font_size = 14; 73 | halign = "center"; 74 | position = "0, -45"; 75 | text = ''cmd[update:500] echo $(hyprctl devices -j | jq -r '.'keyboards' | .[] | select(.main==true) | .'active_keymap''')''; 76 | valign = "center"; 77 | } 78 | ]; 79 | }; 80 | }; 81 | }) cfg.system.users; 82 | } 83 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/hyproled/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) 10 | makeBinPath 11 | mapAttrs 12 | mkIf 13 | ; 14 | 15 | cfg = config.icedos; 16 | hyproled = cfg.desktop.hyprland.plugins.hyproled; 17 | startWidth = toString (hyproled.startWidth); 18 | startHeight = toString (hyproled.startHeight); 19 | endWidth = toString (hyproled.endWidth); 20 | endHeight = toString (hyproled.endHeight); 21 | area = "-a ${startWidth}:${startHeight}:${endWidth}:${endHeight}"; 22 | in 23 | mkIf (hyproled.enable) { 24 | environment.systemPackages = [ pkgs.hyproled ]; 25 | 26 | home-manager.users = mapAttrs (user: _: { 27 | systemd.user = { 28 | services.hyproled = { 29 | Unit.Description = "Hyproled - Prevents OLED burn-in"; 30 | Install.WantedBy = [ "graphical-session.target" ]; 31 | 32 | Service = { 33 | ExecStart = '' 34 | ${ 35 | makeBinPath [ 36 | (pkgs.writeShellScriptBin "hyproled-wrapper" '' 37 | hyproled ${area} 38 | hyproled -s ${area} 39 | hyproled off 40 | '') 41 | ] 42 | }/hyproled-wrapper 43 | ''; 44 | 45 | Nice = "-20"; 46 | }; 47 | }; 48 | 49 | timers.hyproled = { 50 | Unit.Description = "Timer for hyproled"; 51 | 52 | Timer = { 53 | Unit = "hyproled"; 54 | Persistent = true; 55 | OnCalendar = "hourly"; 56 | AccuracySec = "1h"; 57 | }; 58 | 59 | Install.WantedBy = [ "timers.target" ]; 60 | }; 61 | }; 62 | }) cfg.system.users; 63 | } 64 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/hyprpanel/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDBorn/IceDOS/e959907b3328f04ed238efcc683fab13d4296df4/system/desktop/hyprland/modules/hyprpanel/profile.png -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/hyprpaper/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | config, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs; 10 | cfg = config.icedos; 11 | package = pkgs.hyprpaper; 12 | in 13 | { 14 | environment.systemPackages = [ package ]; 15 | 16 | home-manager.users = mapAttrs (user: _: { 17 | home.file.".config/hypr/hyprpaper.jpg".source = ./hyprpaper.jpg; 18 | 19 | services.hyprpaper = { 20 | enable = true; 21 | 22 | settings = { 23 | preload = "~/.config/hypr/hyprpaper.jpg"; 24 | wallpaper = ", ~/.config/hypr/hyprpaper.jpg"; 25 | ipc = "off"; 26 | }; 27 | }; 28 | }) cfg.system.users; 29 | } 30 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/hyprpaper/hyprpaper.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IceDBorn/IceDOS/e959907b3328f04ed238efcc683fab13d4296df4/system/desktop/hyprland/modules/hyprpaper/hyprpaper.jpg -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/hyprpicker/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs; 10 | cfg = config.icedos; 11 | in 12 | { 13 | environment.systemPackages = [ pkgs.hyprpicker ]; 14 | 15 | home-manager.users = mapAttrs (user: _: { 16 | wayland.windowManager.hyprland.settings.bind = [ "$mainMod, C, exec, hyprpicker --autocopy" ]; 17 | }) cfg.system.users; 18 | } 19 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/hyprpolkitagent/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs; 10 | cfg = config.icedos; 11 | package = pkgs.hyprpolkitagent; 12 | in 13 | { 14 | environment.systemPackages = [ package ]; 15 | 16 | home-manager.users = mapAttrs (user: _: { 17 | systemd.user.services.hyprpolkitagent = { 18 | Unit.Description = "Hyprpolkitagent - Polkit authentication agent"; 19 | Install.WantedBy = [ "graphical-session.target" ]; 20 | 21 | Service = { 22 | ExecStart = "${package}/libexec/hyprpolkitagent"; 23 | Nice = "-20"; 24 | Restart = "on-failure"; 25 | StartLimitIntervalSec = 60; 26 | StartLimitBurst = 60; 27 | }; 28 | }; 29 | }) cfg.system.users; 30 | } 31 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/hyprspace/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) 10 | mapAttrs 11 | mkIf 12 | ; 13 | 14 | cfg = config.icedos; 15 | 16 | accentColor = 17 | if (!cfg.desktop.gnome.enable) then 18 | "0xee${cfg.desktop.accentColor}" 19 | else 20 | { 21 | blue = "0xee3584e4"; 22 | green = "0xee3a944a"; 23 | orange = "0xeeed5b00"; 24 | pink = "0xeed56199"; 25 | purple = "0xee9141ac"; 26 | red = "0xeee62d42"; 27 | slate = "0xee6f8396"; 28 | teal = "0xee2190a4"; 29 | yellow = "0xeec88800"; 30 | } 31 | .${cfg.desktop.gnome.accentColor}; 32 | in 33 | mkIf (cfg.desktop.hyprland.plugins.hyprspace) { 34 | home-manager.users = mapAttrs (user: _: { 35 | wayland.windowManager.hyprland = { 36 | plugins = [ pkgs.hyprlandPlugins.hyprspace ]; 37 | 38 | settings = { 39 | bind = [ 40 | "$mainMod, TAB, overview:toggle" 41 | "$mainMod SHIFT, TAB, overview:toggle, all" 42 | ]; 43 | 44 | plugin = [ 45 | { 46 | overview = { 47 | gapsIn = 5; 48 | gapsOut = 5; 49 | panelHeight = 100; 50 | showEmptyWorkspace = false; 51 | showNewWorkspace = false; 52 | workspaceActiveBorder = accentColor; 53 | }; 54 | } 55 | ]; 56 | }; 57 | }; 58 | }) cfg.system.users; 59 | } 60 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/playerctl/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs; 10 | cfg = config.icedos; 11 | in 12 | { 13 | environment.systemPackages = [ pkgs.playerctl ]; 14 | 15 | home-manager.users = mapAttrs (user: _: { 16 | wayland.windowManager.hyprland.settings.bindl = [ 17 | ", XF86AudioPlay, exec, playerctl play-pause" 18 | ", XF86AudioPrev, exec, playerctl previous" 19 | ", XF86AudioNext, exec, playerctl next" 20 | ]; 21 | }) cfg.system.users; 22 | } 23 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/poweralertd/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs; 10 | cfg = config.icedos; 11 | package = pkgs.poweralertd; 12 | in 13 | { 14 | environment.systemPackages = [ package ]; 15 | 16 | home-manager.users = mapAttrs (user: _: { 17 | systemd.user.services.poweralertd = { 18 | Unit.Description = "Poweralertd - UPower-powered power alerter"; 19 | Install.WantedBy = [ "graphical-session.target" ]; 20 | 21 | Service = { 22 | ExecStart = "${package}/bin/poweralertd"; 23 | Nice = "-20"; 24 | Restart = "on-failure"; 25 | StartLimitIntervalSec = 60; 26 | StartLimitBurst = 60; 27 | }; 28 | }; 29 | }) cfg.system.users; 30 | } 31 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/valent/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs mkIf; 10 | cfg = config.icedos; 11 | deviceId = cfg.applications.valent.deviceId; 12 | in 13 | mkIf (cfg.applications.valent.enable) { 14 | environment.systemPackages = [ pkgs.valent ]; 15 | 16 | home-manager.users = mapAttrs (user: _: { 17 | dconf.settings = { 18 | "ca/andyholmes/valent/device/${deviceId}/plugin/battery" = { 19 | full-notification = true; 20 | full-notification-level = 80.0; 21 | }; 22 | 23 | "ca/andyholmes/valent/device/${deviceId}/plugin/connectivity_report" = { 24 | offline-notification = true; 25 | }; 26 | 27 | "ca/andyholmes/valent/device/${deviceId}/plugin/telephony" = { 28 | ringing-volume = -1; 29 | ringing-pause = true; 30 | }; 31 | 32 | "ca/andyholmes/valent/device/${deviceId}/plugin/clipboard" = { 33 | auto-pull = true; 34 | auto-push = true; 35 | }; 36 | 37 | "ca/andyholmes/valent/device/${deviceId}/plugin/contacts" = { 38 | enabled = false; 39 | }; 40 | 41 | "ca/andyholmes/valent/device/${deviceId}/plugin/notification" = { 42 | enabled = false; 43 | }; 44 | 45 | "ca/andyholmes/valent/device/${deviceId}/plugin/sms" = { 46 | enabled = false; 47 | }; 48 | }; 49 | }) cfg.system.users; 50 | } 51 | -------------------------------------------------------------------------------- /system/desktop/hyprland/modules/walker/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) 10 | mapAttrs 11 | readFile 12 | replaceStrings 13 | ; 14 | 15 | cfg = config.icedos; 16 | accentColor = cfg.internals.accentColor; 17 | package = pkgs.walker; 18 | in 19 | { 20 | environment.systemPackages = with pkgs; [ 21 | package 22 | wl-clipboard 23 | ]; 24 | 25 | home-manager.users = mapAttrs (user: _: { 26 | wayland.windowManager.hyprland.settings.bind = [ 27 | "$mainMod, E, exec, walker -s theme -m emojis" 28 | "$mainMod, R, exec, walker -s theme -m applications" 29 | "$mainMod, V, exec, walker -s theme -m clipboard" 30 | ]; 31 | 32 | home.file = { 33 | ".config/walker/config.toml" = { 34 | text = 35 | replaceStrings 36 | [ ''app_launch_prefix = ""'' ] 37 | [ ''app_launch_prefix = "${pkgs.uwsm}/bin/uwsm app -- "'' ] 38 | (readFile ("${package.src}/internal/config/config.default.toml")); 39 | 40 | force = true; 41 | }; 42 | 43 | ".config/walker/themes/theme.css".text = '' 44 | #window, 45 | #box, 46 | #search, 47 | #password, 48 | #input, 49 | #typeahead, 50 | #spinner, 51 | #list, 52 | child, 53 | scrollbar, 54 | slider, 55 | #item, 56 | #text, 57 | #bar, 58 | #listplaceholder, 59 | #label, 60 | #sub, 61 | #activationlabel { 62 | all: unset; 63 | } 64 | 65 | #window { 66 | color: #ffffff; 67 | } 68 | 69 | #box { 70 | background: #242424; 71 | border-radius: 10px; 72 | padding: 20px; 73 | } 74 | 75 | #search { 76 | padding-top: 0px; 77 | padding-bottom: 0px; 78 | padding-left: 5px; 79 | padding-right: 5px; 80 | background: #3a3a3a; 81 | border-radius: 5px; 82 | margin-bottom: 20px; 83 | border: 2px solid ${accentColor}; 84 | } 85 | 86 | #password, 87 | #input, 88 | #typeahead { 89 | padding: 5px; 90 | border-radius: 10px; 91 | } 92 | 93 | #input > *:first-child, 94 | #typeahead > *:first-child { 95 | margin-right: 10px; 96 | } 97 | 98 | #typeahead { 99 | color: #c4c4c4; 100 | } 101 | 102 | #input placeholder { 103 | opacity: 0.5; 104 | } 105 | 106 | #list { 107 | background: #363636; 108 | border-radius: 10px; 109 | } 110 | 111 | child:selected, 112 | child:hover { 113 | background: #3c3c3c; 114 | } 115 | 116 | #item { 117 | padding: 10px; 118 | border-bottom: 1px solid #242424; 119 | } 120 | 121 | #sub { 122 | font-size: smaller; 123 | color: #8e8e8e; 124 | } 125 | 126 | #activationlabel { 127 | opacity: 0.5; 128 | } 129 | 130 | .activation #activationlabel { 131 | opacity: 1; 132 | color: ${accentColor}; 133 | } 134 | 135 | .activation #text, 136 | .activation #icon, 137 | .activation #search { 138 | opacity: 0.5; 139 | } 140 | ''; 141 | 142 | ".config/walker/themes/theme.json".text = '' 143 | { 144 | "ui": { 145 | "anchors": { 146 | "top": true, 147 | "bottom": true 148 | }, 149 | "window": { 150 | "v_align": "center", 151 | "box": { 152 | "width": 400, 153 | "margins": { 154 | "top": 200 155 | }, 156 | "v_align": "center", 157 | "h_align": "center", 158 | "search": { 159 | "width": 400, 160 | "spacing": 5 161 | }, 162 | "scroll": { 163 | "list": { 164 | "width": 400, 165 | "marker_color": "${accentColor}", 166 | "max_height": 300, 167 | "min_width": 400, 168 | "max_width": 400, 169 | "item": { 170 | "spacing": 10, 171 | "activation_label": { 172 | "x_align": 1.0, 173 | "width": 20 174 | }, 175 | "icon": { 176 | "theme": "Theme" 177 | } 178 | } 179 | } 180 | } 181 | } 182 | } 183 | } 184 | } 185 | ''; 186 | }; 187 | 188 | systemd.user.services.walker = { 189 | Unit.Description = "Walker - Application Runner"; 190 | Install.WantedBy = [ "graphical-session.target" ]; 191 | 192 | Service = { 193 | ExecStart = "${package}/bin/walker --gapplication-service"; 194 | Nice = "-20"; 195 | Restart = "on-failure"; 196 | StartLimitIntervalSec = 60; 197 | StartLimitBurst = 60; 198 | }; 199 | }; 200 | }) cfg.system.users; 201 | } 202 | -------------------------------------------------------------------------------- /system/desktop/modules/adwaita-qt/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs; 10 | cfg = config.icedos; 11 | accentColor = cfg.internals.accentColor; 12 | 13 | accentColorPatch = '' 14 | diff --git a/src/lib/stylesheet/processed/Adwaita-dark.css b/src/lib/stylesheet/processed/Adwaita-dark.css 15 | index 619bb32..27d5745 100644 16 | --- a/src/lib/stylesheet/processed/Adwaita-dark.css 17 | +++ b/src/lib/stylesheet/processed/Adwaita-dark.css 18 | @@ -3,13 +3,13 @@ 19 | @define-color bg_color #353535; 20 | @define-color fg_color #eeeeec; 21 | @define-color selected_fg_color #ffffff; 22 | -@define-color selected_bg_color #15539e; 23 | +@define-color selected_bg_color ${accentColor}; 24 | @define-color selected_borders_color #030c17; 25 | @define-color borders_color #1b1b1b; 26 | @define-color alt_borders_color #070707; 27 | @define-color borders_edge rgba(238, 238, 236, 0.07); 28 | -@define-color link_color #3584e4; 29 | -@define-color link_visited_color #1b6acb; 30 | +@define-color link_color ${accentColor}; 31 | +@define-color link_visited_color ${accentColor}; 32 | @define-color top_hilight rgba(238, 238, 236, 0.07); 33 | @define-color dark_fill #282828; 34 | @define-color headerbar_bg_color #2d2d2d; 35 | @@ -18,7 +18,7 @@ 36 | @define-color scrollbar_bg_color #313131; 37 | @define-color scrollbar_slider_color #a4a4a3; 38 | @define-color scrollbar_slider_hover_color #c9c9c7; 39 | -@define-color scrollbar_slider_active_color #1b6acb; 40 | +@define-color scrollbar_slider_active_color ${accentColor}; 41 | @define-color warning_color #f57900; 42 | @define-color error_color #cc0000; 43 | @define-color success_color #26ab62; 44 | @@ -44,16 +44,16 @@ 45 | @define-color backdrop_selected_fg_color #d6d6d6; 46 | @define-color backdrop_borders_color #202020; 47 | @define-color backdrop_dark_fill #2e2e2e; 48 | -@define-color suggested_bg_color #15539e; 49 | +@define-color suggested_bg_color ${accentColor}; 50 | @define-color suggested_border_color #030c17; 51 | -@define-color progress_bg_color #15539e; 52 | +@define-color progress_bg_color ${accentColor}; 53 | @define-color progress_border_color #030c17; 54 | -@define-color checkradio_bg_color #15539e; 55 | +@define-color checkradio_bg_color ${accentColor}; 56 | @define-color checkradio_fg_color #ffffff; 57 | -@define-color checkradio_borders_color #092444; 58 | -@define-color switch_bg_color #15539e; 59 | +@define-color checkradio_borders_color ${accentColor}; 60 | +@define-color switch_bg_color ${accentColor}; 61 | @define-color switch_borders_color #030c17; 62 | -@define-color focus_border_color rgba(21, 83, 158, 0.7); 63 | +@define-color focus_border_color ${accentColor}; 64 | @define-color alt_focus_border_color rgba(255, 255, 255, 0.3); 65 | @define-color dim_label_opacity 0.55; 66 | button { color: #eeeeec; outline-color: rgba(21, 83, 158, 0.7); border-color: #1b1b1b; background-image: linear-gradient(to top, #373737 2px, #3a3a3a); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07); } 67 | @@ -86,10 +86,10 @@ checkradio:active { box-shadow: inset 0 1px black; background-image: image(#2828 68 | 69 | checkradio:disabled { box-shadow: none; color: rgba(255, 255, 255, 0.7); } 70 | 71 | -checkradio:checked { background-clip: border-box; background-image: linear-gradient(to bottom, #185fb4 20%, #15539e 90%); border-color: #092444; box-shadow: 0 1px rgba(0, 0, 0, 0.05); color: #ffffff; } 72 | +checkradio:checked { background-clip: border-box; background-image: ${accentColor}; border-color: #092444; box-shadow: 0 1px rgba(0, 0, 0, 0.05); color: #ffffff; } 73 | 74 | -checkradio:checked:hover { background-image: linear-gradient(to bottom, #1b68c6 10%, #185cb0 90%); } 75 | +checkradio:checked:hover { background-image: ${accentColor}; } 76 | 77 | -checkradio:checked:active { box-shadow: inset 0 1px black; background-image: image(#124787); } 78 | +checkradio:checked:active { box-shadow: inset 0 1px black; background-image: image(${accentColor}); } 79 | 80 | checkradio:checked:disabled { box-shadow: none; color: rgba(255, 255, 255, 0.7); } 81 | ''; 82 | 83 | adwaitaQtBuilder = ( 84 | let 85 | inherit accentColorPatch; 86 | in 87 | p: 88 | p.overrideAttrs ( 89 | _: old: { 90 | patches = (old.patches or [ ]) ++ [ (builtins.toFile "adwaita-qt-accent.patch" accentColorPatch) ]; 91 | } 92 | ) 93 | ); 94 | in 95 | { 96 | environment.systemPackages = with pkgs; [ 97 | (adwaitaQtBuilder adwaita-qt) 98 | (adwaitaQtBuilder adwaita-qt6) 99 | kdePackages.qt6ct 100 | libsForQt5.qt5ct 101 | ]; 102 | 103 | home-manager.users = mapAttrs (user: _: { 104 | home.file = { 105 | ".config/qt5ct/qt5ct.conf".source = ./qt5ct.conf; 106 | ".config/qt6ct/qt6ct.conf".source = ./qt6ct.conf; 107 | }; 108 | }) cfg.system.users; 109 | } 110 | -------------------------------------------------------------------------------- /system/desktop/modules/adwaita-qt/qt5ct.conf: -------------------------------------------------------------------------------- 1 | [Appearance] 2 | custom_palette=false 3 | icon_theme=Tela-black-dark 4 | standard_dialogs=default 5 | style=Adwaita-Dark 6 | 7 | [Fonts] 8 | fixed="Cantarell,12,-1,5,50,0,0,0,0,0" 9 | general="Cantarell,12,-1,5,50,0,0,0,0,0" 10 | 11 | [Interface] 12 | activate_item_on_single_click=1 13 | buttonbox_layout=3 14 | cursor_flash_time=1000 15 | dialog_buttons_have_icons=1 16 | double_click_interval=400 17 | gui_effects=@Invalid() 18 | keyboard_scheme=4 19 | menus_have_icons=true 20 | show_shortcuts_in_context_menus=true 21 | stylesheets=@Invalid() 22 | toolbutton_style=4 23 | underline_shortcut=1 24 | wheel_scroll_lines=3 25 | 26 | [SettingsWindow] 27 | geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\x3\xbd\0\0\x4\x1d\0\0\0\0\0\0\0\0\0\0\x3\xbf\0\0\x4\x1f\0\0\0\0\x2\0\0\0\a\x80\0\0\0\0\0\0\0\0\0\0\x3\xbd\0\0\x4\x1d) 28 | 29 | [Troubleshooting] 30 | force_raster_widgets=1 31 | ignored_applications=@Invalid() 32 | -------------------------------------------------------------------------------- /system/desktop/modules/adwaita-qt/qt6ct.conf: -------------------------------------------------------------------------------- 1 | [Appearance] 2 | custom_palette=false 3 | icon_theme=Tela-black-dark 4 | standard_dialogs=default 5 | style=Adwaita-Dark 6 | 7 | [Fonts] 8 | fixed="Cantarell,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1,Regular" 9 | general="Cantarell,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1,Regular" 10 | 11 | [Interface] 12 | activate_item_on_single_click=1 13 | buttonbox_layout=3 14 | cursor_flash_time=1000 15 | dialog_buttons_have_icons=1 16 | double_click_interval=400 17 | gui_effects=@Invalid() 18 | keyboard_scheme=4 19 | menus_have_icons=true 20 | show_shortcuts_in_context_menus=true 21 | stylesheets=@Invalid() 22 | toolbutton_style=4 23 | underline_shortcut=1 24 | wheel_scroll_lines=3 25 | 26 | [SettingsWindow] 27 | geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\x3\xbd\0\0\x4\x1d\0\0\0\0\0\0\0\0\0\0\x3\xbf\0\0\x4\x1f\0\0\0\0\x2\0\0\0\a\x80\0\0\0\0\0\0\0\0\0\0\x3\xbd\0\0\x4\x1d) 28 | 29 | [Troubleshooting] 30 | force_raster_widgets=1 31 | ignored_applications=@Invalid() 32 | -------------------------------------------------------------------------------- /system/desktop/modules/clear-xdg-portals/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | ... 4 | }: 5 | 6 | let 7 | command = "clear-portals"; 8 | in 9 | { 10 | icedos.internals.toolset.commands = [ 11 | { 12 | bin = "${pkgs.writeShellScript command '' 13 | PORTAL="xdg-desktop-portal" 14 | 15 | rm -rf "$HOME/.config/$PORTAL" 16 | rm -rf "$HOME/.cache/$PORTAL" 17 | sudo rm -rf "/etc/xdg/$PORTAL" 18 | sudo rm -rf "/usr/share/$PORTAL" 19 | ''}"; 20 | 21 | command = command; 22 | help = "remove all xdg portal files, useful if portals are malfunctioning"; 23 | } 24 | ]; 25 | } 26 | -------------------------------------------------------------------------------- /system/desktop/modules/displays/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) 10 | concatMapStrings 11 | head 12 | mapAttrs 13 | mkIf 14 | optional 15 | sort 16 | ; 17 | 18 | cfg = config.icedos; 19 | command = "displays"; 20 | gnome = cfg.desktop.gnome.enable; 21 | hyprland = cfg.desktop.hyprland.enable; 22 | tempConfigPath = "/tmp/icedos"; 23 | primaryDisplayPath = "${tempConfigPath}/primary-display"; 24 | in 25 | { 26 | icedos.internals.toolset.commands = mkIf (gnome || hyprland) [ 27 | ( 28 | let 29 | commands = 30 | [ 31 | ( 32 | let 33 | command = "info"; 34 | in 35 | { 36 | bin = "${pkgs.writeShellScript command '' 37 | ${ 38 | if (gnome) then 39 | ''[ "$XDG_CURRENT_DESKTOP" = "GNOME" ] && "${pkgs.gnome-randr}/bin/gnome-randr"'' 40 | else 41 | "" 42 | } 43 | 44 | ${ 45 | if (hyprland) then 46 | ''[ "$XDG_CURRENT_DESKTOP" = "Hyprland" ] && "${pkgs.hyprland}/bin/hyprctl" monitors'' 47 | else 48 | "" 49 | } 50 | ''}"; 51 | 52 | command = command; 53 | help = "print displays information"; 54 | } 55 | ) 56 | ] 57 | ++ optional (cfg.desktop.hyprland.enable) ( 58 | let 59 | command = "xprimary"; 60 | in 61 | { 62 | bin = "${pkgs.writeShellScript command '' 63 | [ "$XDG_CURRENT_DESKTOP" = "GNOME" ] && echo "error: not supported by gnome" && exit 1 64 | 65 | ACTIVE_MONITORS=($(xrandr --listactivemonitors | grep '+0' | awk '{ print $4 }' | sort)) 66 | TEMP_CONFIG_PATH="${tempConfigPath}" 67 | PRIMARY_DISPLAY_PATH="${primaryDisplayPath}" 68 | 69 | mkdir -p "$TEMP_CONFIG_PATH" 70 | echo "Select a display:" 71 | 72 | select monitor in "''${ACTIVE_MONITORS[@]}"; do 73 | [ "$monitor" != "" ] && echo "$monitor" > "$PRIMARY_DISPLAY_PATH" && exit 0 74 | echo "error: not a valid selection, try again" 75 | done 76 | ''}"; 77 | 78 | command = command; 79 | help = "set primary monitor for xwayland"; 80 | } 81 | ); 82 | 83 | purpleString = string: ''''${PURPLE}${string}''${NC}''; 84 | in 85 | { 86 | bin = "${pkgs.writeShellScript command '' 87 | 88 | PURPLE='\033[0;35m' 89 | NC='\033[0m' 90 | 91 | if [[ "$1" == "" || "$1" == "help" ]]; then 92 | echo "Available commands:" 93 | 94 | ${concatMapStrings (tool: '' 95 | echo -e "> ${purpleString tool.command}: ${tool.help} " 96 | '') (sort (a: b: a.command < b.command) (commands))} 97 | 98 | exit 0 99 | fi 100 | 101 | case "$1" in 102 | ${concatMapStrings (tool: '' 103 | ${tool.command}) 104 | shift 105 | exec ${tool.bin} "$@" 106 | ;; 107 | '') commands} 108 | *|-*|--*) 109 | echo "Unknown arg: $1" >&2 110 | exit 1 111 | ;; 112 | esac 113 | ''}"; 114 | 115 | command = command; 116 | help = "print displays related commands"; 117 | } 118 | ) 119 | ]; 120 | 121 | home-manager.users = mapAttrs (user: _: { 122 | systemd.user.services.xprimary = mkIf (cfg.desktop.hyprland.enable) { 123 | Unit.Description = "X11 primary display watcher"; 124 | Install.WantedBy = [ 125 | "graphical-session.target" 126 | "hyprland-session.target" 127 | ]; 128 | 129 | Service = { 130 | ExecStart = 131 | let 132 | coreutils = pkgs.coreutils-full; 133 | echo = "${coreutils}/bin/echo"; 134 | xrandr = "${pkgs.xorg.xrandr}/bin/xrandr"; 135 | in 136 | "${pkgs.writeShellScript "xprimary" '' 137 | TEMP_CONFIG_PATH="${tempConfigPath}" 138 | PRIMARY_DISPLAY_PATH="${primaryDisplayPath}" 139 | PRIMARY_DISPLAY="${(head (cfg.hardware.monitors)).name}" 140 | 141 | function setPrimaryMonitor () { 142 | ${echo} "$1" > "$PRIMARY_DISPLAY_PATH" 143 | ${xrandr} --output "$1" --primary || exit 1 144 | ${pkgs.libnotify}/bin/notify-send "System" "Set X11 primary display to $1" 145 | ${echo} "Set X11 primary display to $PRIMARY_DISPLAY" 146 | } 147 | 148 | setPrimaryMonitor "$PRIMARY_DISPLAY" 149 | 150 | while :; do 151 | ${coreutils}/bin/mkdir -p "$TEMP_CONFIG_PATH" 152 | 153 | CURRENT_PRIMARY_DISPLAY="$PRIMARY_DISPLAY" 154 | [ -f "$PRIMARY_DISPLAY_PATH" ] && CURRENT_PRIMARY_DISPLAY=$(${coreutils}/bin/cat "$PRIMARY_DISPLAY_PATH") 155 | 156 | [[ "$CURRENT_PRIMARY_DISPLAY" == "$PRIMARY_DISPLAY" && "$(${xrandr} --current | ${pkgs.gnugrep}/bin/grep primary | ${pkgs.gawk}/bin/awk '{print $1}')" == "$CURRENT_PRIMARY_DISPLAY" ]] && continue 157 | 158 | PRIMARY_DISPLAY="$CURRENT_PRIMARY_DISPLAY" 159 | setPrimaryMonitor "$PRIMARY_DISPLAY" 160 | 161 | ${coreutils}/bin/sleep 1 162 | done 163 | ''}"; 164 | 165 | Nice = "-20"; 166 | Restart = "on-failure"; 167 | StartLimitIntervalSec = 60; 168 | StartLimitBurst = 60; 169 | }; 170 | }; 171 | }) cfg.system.users; 172 | } 173 | -------------------------------------------------------------------------------- /system/desktop/modules/home/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs; 10 | cfg = config.icedos; 11 | accentColor = cfg.internals.accentColor; 12 | audioPlayer = "io.bassi.Amberol.desktop"; 13 | 14 | browser = 15 | { 16 | librewolf = "librewolf.desktop"; 17 | zen = "zen.desktop"; 18 | } 19 | .${cfg.applications.defaultBrowser}; 20 | 21 | editor = 22 | { 23 | codium = "codium.desktop"; 24 | zed = "dev.zed.Zed.desktop"; 25 | } 26 | .${cfg.applications.defaultEditor}; 27 | 28 | gtkCss = '' 29 | @define-color accent_bg_color ${accentColor}; 30 | @define-color accent_color @accent_bg_color; 31 | 32 | :root { 33 | --accent-bg-color: @accent_bg_color; 34 | } 35 | ''; 36 | 37 | imageViewer = "org.gnome.Loupe.desktop"; 38 | videoPlayer = "io.github.celluloid_player.Celluloid.desktop"; 39 | in 40 | { 41 | home-manager.users = mapAttrs (user: _: { 42 | gtk = { 43 | enable = true; 44 | 45 | theme = { 46 | name = "adw-gtk3-dark"; 47 | package = pkgs.adw-gtk3; 48 | }; 49 | 50 | cursorTheme = { 51 | name = "Bibata-Modern-Classic"; 52 | package = pkgs.bibata-cursors; 53 | }; 54 | 55 | iconTheme = { 56 | name = "Tela-black-dark"; 57 | package = pkgs.tela-icon-theme; 58 | }; 59 | 60 | gtk3.extraCss = gtkCss; 61 | }; 62 | 63 | dconf.settings = { 64 | # Enable dark mode 65 | "org/gnome/desktop/interface".color-scheme = "prefer-dark"; 66 | 67 | # GTK file picker 68 | "org/gtk/settings/file-chooser" = { 69 | sort-directories-first = true; 70 | date-format = "with-time"; 71 | show-type-column = false; 72 | show-hidden = true; 73 | }; 74 | }; 75 | 76 | xdg = { 77 | configFile = { 78 | "gtk-4.0/gtk.css".enable = false; 79 | "mimeapps.list".force = true; 80 | }; 81 | 82 | # Default apps 83 | mimeApps = { 84 | enable = true; 85 | 86 | defaultApplications = { 87 | "application/json" = editor; 88 | "application/pdf" = browser; 89 | "application/x-bittorrent" = "de.haeckerfelix.Fragments.desktop"; 90 | "application/x-ms-dos-executable" = "wine.desktop"; 91 | "application/x-shellscript" = editor; 92 | "application/x-wine-extension-ini" = editor; 93 | "application/x-zerosize" = editor; 94 | "application/xhtml_xml" = browser; 95 | "application/xhtml+xml" = browser; 96 | "application/zip" = "org.gnome.FileRoller.desktop"; 97 | "audio/aac" = audioPlayer; 98 | "audio/flac" = audioPlayer; 99 | "audio/m4a" = audioPlayer; 100 | "audio/mp3" = audioPlayer; 101 | "audio/wav" = audioPlayer; 102 | "image/avif" = imageViewer; 103 | "image/jpeg" = imageViewer; 104 | "image/png" = imageViewer; 105 | "image/svg+xml" = imageViewer; 106 | "text/html" = browser; 107 | "text/plain" = editor; 108 | "video/mp4" = videoPlayer; 109 | "video/quicktime" = videoPlayer; 110 | "video/x-matroska" = videoPlayer; 111 | "video/x-ms-wmv" = videoPlayer; 112 | "x-scheme-handler/about" = browser; 113 | "x-scheme-handler/http" = browser; 114 | "x-scheme-handler/https" = browser; 115 | "x-scheme-handler/unknown" = browser; 116 | "x-www-browser" = browser; 117 | }; 118 | }; 119 | 120 | userDirs = { 121 | enable = true; 122 | createDirectories = true; 123 | }; 124 | }; 125 | 126 | home = { 127 | pointerCursor = { 128 | gtk.enable = true; 129 | x11.enable = true; 130 | package = pkgs.bibata-cursors; 131 | name = "Bibata-Modern-Classic"; 132 | size = 24; 133 | }; 134 | 135 | file.".config/gtk-4.0/gtk.css".text = gtkCss; 136 | }; 137 | }) cfg.system.users; 138 | } 139 | -------------------------------------------------------------------------------- /system/desktop/modules/nautilus/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs makeSearchPathOutput mkIf; 10 | cfg = config.icedos; 11 | in 12 | { 13 | environment = mkIf (cfg.applications.nautilus) { 14 | systemPackages = [ pkgs.nautilus ]; 15 | 16 | gnome.excludePackages = mkIf (!cfg.applications.nautilus && cfg.desktop.gnome.enable) [ 17 | pkgs.nautilus 18 | ]; 19 | 20 | sessionVariables = { 21 | # Fix for missing audio/video information in properties https://github.com/NixOS/nixpkgs/issues/53631 22 | GST_PLUGIN_SYSTEM_PATH_1_0 = makeSearchPathOutput "lib" "lib/gstreamer-1.0" ( 23 | with pkgs.gst_all_1; 24 | [ 25 | gst-plugins-good 26 | gst-plugins-bad 27 | gst-plugins-ugly 28 | gst-libav 29 | ] 30 | ); # Fix from https://github.com/NixOS/nixpkgs/issues/195936#issuecomment-1366902737 31 | }; 32 | }; 33 | 34 | services.gvfs.enable = cfg.applications.nautilus; 35 | 36 | home-manager.users = mapAttrs (user: _: { 37 | dconf.settings = mkIf (cfg.applications.nautilus) { 38 | "org/gnome/nautilus/preferences" = { 39 | always-use-location-entry = true; 40 | show-create-link = true; 41 | show-delete-permanently = true; 42 | }; 43 | 44 | "org/gnome/nautilus/icon-view" = { 45 | default-zoom-level = "small-plus"; 46 | }; 47 | 48 | "org/gtk/gtk4/settings/file-chooser" = { 49 | sort-directories-first = true; 50 | show-hidden = true; 51 | }; 52 | 53 | "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = 54 | mkIf (cfg.desktop.gnome.enable) 55 | { 56 | binding = "e"; 57 | command = "nautilus ."; 58 | name = "Nautilus"; 59 | }; 60 | 61 | "org/gnome/settings-daemon/plugins/media-keys".custom-keybindings = mkIf (cfg.desktop.gnome.enable 62 | ) [ "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/" ]; 63 | }; 64 | 65 | home.file = mkIf (cfg.applications.nautilus) { 66 | "Templates/new".text = ""; 67 | "Templates/new.cfg".text = ""; 68 | "Templates/new.ini".text = ""; 69 | "Templates/new.sh".text = ""; 70 | "Templates/new.txt".text = ""; 71 | }; 72 | }) cfg.system.users; 73 | } 74 | -------------------------------------------------------------------------------- /system/desktop/modules/pipewire/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs; 10 | cfg = config.icedos.system; 11 | in 12 | { 13 | services = { 14 | pipewire = { 15 | enable = true; 16 | alsa.enable = true; 17 | alsa.support32Bit = true; 18 | pulse.enable = true; 19 | }; 20 | 21 | pulseaudio.enable = false; 22 | }; 23 | 24 | # Enable service which hands out realtime scheduling priority to user processes on demand 25 | security.rtkit.enable = true; 26 | 27 | environment.systemPackages = with pkgs; [ pwvucontrol ]; 28 | 29 | home-manager.users = mapAttrs (user: _: { 30 | home.file.".config/pipewire/pipewire.conf.d/99-input-denoising.conf".text = '' 31 | context.modules = [ 32 | { 33 | name = libpipewire-module-filter-chain 34 | args = { 35 | node.description = "Noise Canceling source" 36 | media.name = "Noise Canceling source" 37 | filter.graph = { 38 | nodes = [ 39 | { 40 | type = ladspa 41 | name = rnnoise 42 | plugin = ${pkgs.rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so 43 | label = noise_suppressor_mono 44 | control = { 45 | "VAD Threshold (%)" 95.0 46 | "VAD Grace Period (ms)" 200 47 | "Retroactive VAD Grace (ms)" 0 48 | } 49 | } 50 | ] 51 | } 52 | capture.props = { 53 | node.name = "capture.rnnoise_source" 54 | node.passive = true 55 | audio.rate = 48000 56 | } 57 | playback.props = { 58 | node.name = "rnnoise_source" 59 | media.class = Audio/Source 60 | audio.rate = 48000 61 | } 62 | } 63 | } 64 | ] 65 | ''; 66 | }) cfg.users; 67 | } 68 | -------------------------------------------------------------------------------- /system/desktop/modules/sd-inhibitor/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) 10 | attrNames 11 | filterAttrs 12 | mapAttrs 13 | mkIf 14 | optional 15 | readFile 16 | ; 17 | 18 | cfg = config.icedos; 19 | 20 | getModules = 21 | path: 22 | map (dir: ./. + ("/modules/" + dir)) ( 23 | attrNames (filterAttrs (_: v: v == "directory") (builtins.readDir path)) 24 | ); 25 | in 26 | { 27 | imports = getModules (./modules); 28 | 29 | home-manager.users = mapAttrs (user: _: { 30 | systemd.user.services.sd-inhibitor = 31 | let 32 | watchers = cfg.system.users.${user}.desktop.idle.sd-inhibitor.watchers; 33 | in 34 | mkIf 35 | ( 36 | cfg.system.users.${user}.desktop.idle.sd-inhibitor.enable 37 | && ( 38 | watchers.cpu.enable || watchers.disk.enable || watchers.network.enable || watchers.pipewire.enable 39 | ) 40 | ) 41 | { 42 | Unit = { 43 | Description = "service to inhibit idle, sleep and shutdown based on device usage limits"; 44 | After = "graphical-session.target"; 45 | PartOf = "graphical-session.target"; 46 | }; 47 | 48 | Install.WantedBy = 49 | [ ] 50 | ++ optional (cfg.desktop.hyprland.enable) "hyprland-session.target" 51 | ++ optional (cfg.desktop.gnome.enable) "gnome-session.target"; 52 | 53 | Service = { 54 | ExecStart = with pkgs; "${writeShellScript "sd-inhibitor" (readFile ./sd-inhibitor.sh)}"; 55 | Nice = "-20"; 56 | Restart = "on-failure"; 57 | StartLimitBurst = 60; 58 | }; 59 | }; 60 | }) cfg.system.users; 61 | } 62 | -------------------------------------------------------------------------------- /system/desktop/modules/sd-inhibitor/modules/cpu-watcher/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs mkIf; 10 | cfg = config.icedos; 11 | in 12 | { 13 | home-manager.users = mapAttrs (user: _: { 14 | home.packages = 15 | let 16 | watcher = cfg.system.users.${user}.desktop.idle.sd-inhibitor.watchers.cpu; 17 | in 18 | mkIf (cfg.system.users.${user}.desktop.idle.sd-inhibitor.enable && watcher.enable) [ 19 | (pkgs.writeShellScriptBin "cpu-watcher" '' 20 | UTILIZATION="$((100-$(vmstat 1 2|tail -1|awk '{print $15}')))" 21 | CPU_THRESOLD=${toString (watcher.threshold)} 22 | 23 | if (( UTILIZATION > CPU_THRESOLD )) then 24 | printf true 25 | else 26 | printf false 27 | fi 28 | '') 29 | ]; 30 | }) cfg.system.users; 31 | } 32 | -------------------------------------------------------------------------------- /system/desktop/modules/sd-inhibitor/modules/disk-watcher/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs mkIf; 10 | cfg = config.icedos; 11 | in 12 | { 13 | home-manager.users = mapAttrs (user: _: { 14 | home.packages = 15 | let 16 | watcher = cfg.system.users.${user}.desktop.idle.sd-inhibitor.watchers.disk; 17 | in 18 | mkIf (cfg.system.users.${user}.desktop.idle.sd-inhibitor.enable && watcher.enable) [ 19 | (pkgs.writeShellScriptBin "disk-watcher" '' 20 | DISKS=($(lsblk -d -io NAME | tail -n +2)) 21 | READ_QUERY=".sysstat.hosts[].statistics[].disk[].MB_read" 22 | WRITE_QUERY=".sysstat.hosts[].statistics[].disk[].MB_wrtn" 23 | DISK_THRESHOLD=${toString (watcher.threshold)} 24 | 25 | diskstats () { 26 | iostat -d -m -z -o JSON "$1" 27 | } 28 | 29 | read=() 30 | written=() 31 | for disk in "''${DISKS[@]}" 32 | do 33 | json="$(diskstats "$disk")" 34 | read+=($(echo "$json" | jq "$READ_QUERY")) 35 | written+=($(echo "$json" | jq "$WRITE_QUERY")) 36 | done 37 | 38 | sleep 1 39 | 40 | i=0 41 | for disk in "''${DISKS[@]}" 42 | do 43 | json="$(diskstats "$disk")" 44 | current_read=($(echo "$json" | jq "$READ_QUERY")) 45 | current_written=($(echo "$json" | jq "$WRITE_QUERY")) 46 | 47 | READ_PER_SECOND=$(( current_read - read[i] )) 48 | WRITE_PER_SECOND=$(( current_written - written[i] )) 49 | 50 | if (( READ_PER_SECOND > DISK_THRESHOLD )) || (( WRITE_PER_SECOND > DISK_THRESHOLD )); then 51 | printf true 52 | exit 53 | fi 54 | ((i++)) 55 | done 56 | 57 | printf false 58 | '') 59 | 60 | pkgs.jq 61 | pkgs.sysstat 62 | ]; 63 | }) cfg.system.users; 64 | } 65 | -------------------------------------------------------------------------------- /system/desktop/modules/sd-inhibitor/modules/network-watcher/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) mapAttrs mkIf; 10 | cfg = config.icedos; 11 | in 12 | { 13 | home-manager.users = mapAttrs (user: _: { 14 | home.packages = 15 | let 16 | watcher = cfg.system.users.${user}.desktop.idle.sd-inhibitor.watchers.network; 17 | in 18 | mkIf (cfg.system.users.${user}.desktop.idle.sd-inhibitor.enable && watcher.enable) [ 19 | (pkgs.writeShellScriptBin "network-watcher" '' 20 | NETWORK_THRESHOLD=${toString (watcher.threshold)} 21 | INTERFACE=$(ip route | head -n 1 | grep -oP 'dev \K\S+') 22 | NETWORK_USAGE=($(awk '{if(l1){print ($2-l1),($10-l2)} else{l1=$2; l2=$10;}}' \ 23 | <(grep "$INTERFACE" /proc/net/dev) <(sleep 1; grep "$INTERFACE" /proc/net/dev))) 24 | 25 | if (( NETWORK_USAGE[0] > NETWORK_THRESHOLD )) || (( NETWORK_USAGE[1] > NETWORK_THRESHOLD )); then 26 | printf true 27 | else 28 | printf false 29 | fi 30 | '') 31 | ]; 32 | }) cfg.system.users; 33 | } 34 | -------------------------------------------------------------------------------- /system/desktop/modules/sd-inhibitor/modules/pipewire-watcher/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: 7 | 8 | let 9 | inherit (lib) concatMapStrings mapAttrs mkIf; 10 | cfg = config.icedos; 11 | in 12 | { 13 | home-manager.users = mapAttrs (user: _: { 14 | home.packages = 15 | let 16 | watcher = cfg.system.users.${user}.desktop.idle.sd-inhibitor.watchers.pipewire; 17 | strListItem = item: "'${item}',"; 18 | in 19 | mkIf (cfg.system.users.${user}.desktop.idle.sd-inhibitor.enable && watcher.enable) [ 20 | (pkgs.writeScriptBin "pipewire-watcher" '' 21 | #!/usr/bin/env wpexec 22 | local INPUT = "Stream/Input/Audio" 23 | local OUTPUT = "Stream/Output/Audio" 24 | 25 | local INPUTS_TO_IGNORE = { 26 | ${concatMapStrings (input: strListItem (input)) watcher.inputsToIgnore} 27 | } 28 | 29 | local OUTPUTS_TO_IGNORE = { 30 | ${concatMapStrings (output: strListItem (output)) watcher.outputsToIgnore} 31 | } 32 | 33 | local INHIBIT_LOCK = false 34 | 35 | local nodeManager = ObjectManager({ 36 | Interest({ 37 | type = "node", 38 | Constraint({ "media.class", "in-list", OUTPUT, INPUT }), 39 | }), 40 | }) 41 | 42 | local linkManager = ObjectManager({ 43 | Interest({ 44 | type = "link", 45 | }), 46 | }) 47 | 48 | local function hasActiveLinks(nodeId, linkType) 49 | local constraint = Constraint({ linkType, "=", tostring(nodeId) }) 50 | for link in linkManager:iterate({ type = "link", constraint }) do 51 | if link.state == "active" then 52 | return true 53 | end 54 | end 55 | return false 56 | end 57 | 58 | local function hasValue (val, tab) 59 | for index, value in ipairs(tab) do 60 | if string.find(val, value) then 61 | return true 62 | end 63 | end 64 | return false 65 | end 66 | 67 | nodeManager:connect("installed", function(nodeManager) 68 | for node in nodeManager:iterate() do 69 | local mediaName = node.properties["media.name"] 70 | local mediaClass = node.properties["media.class"] 71 | local skip = false 72 | 73 | if ((mediaClass == INPUT and hasValue(mediaName, INPUTS_TO_IGNORE)) or (mediaClass == OUTPUT and hasValue(mediaName, OUTPUTS_TO_IGNORE))) then 74 | skip = true 75 | end 76 | 77 | if (hasActiveLinks(node.bound_id, "link.input.node") or hasActiveLinks(node.bound_id, "link.output.node")) and skip == false then 78 | INHIBIT_LOCK = true 79 | break 80 | end 81 | end 82 | 83 | print(INHIBIT_LOCK) 84 | Core.quit() 85 | end) 86 | 87 | linkManager:activate() 88 | nodeManager:activate() 89 | '') 90 | ]; 91 | }) cfg.system.users; 92 | } 93 | -------------------------------------------------------------------------------- /system/desktop/modules/sd-inhibitor/sd-inhibitor.sh: -------------------------------------------------------------------------------- 1 | command -v cpu-watcher &>/dev/null && CPU_WATCHER="true" 2 | command -v disk-watcher &>/dev/null && DISK_WATCHER="true" 3 | command -v network-watcher &>/dev/null && NETWORK_WATCHER="true" 4 | command -v pipewire-watcher &>/dev/null && PIPEWIRE_WATCHER="true" 5 | 6 | while true; do 7 | [[ "$CPU_WATCHER" == "true" && `cpu-watcher` = "true" ]] && cpu="cpu " || cpu="" 8 | [[ "$DISK_WATCHER" == "true" && `disk-watcher` = "true" ]] && disk="disk " || disk="" 9 | [[ "$NETWORK_WATCHER" == "true" && `network-watcher` = "true" ]] && network="network " || network="" 10 | [[ "$PIPEWIRE_WATCHER" == "true" && `pipewire-watcher` = "true" ]] && pipewire="pipewire" || pipewire="" 11 | [[ "$cpu" == "" && "$disk" == "" && "$network" == "" && "$pipewire" == "" ]] && passed="true" || passed="" 12 | 13 | # Skip when all watchers pass and no inhibitor is active 14 | [[ "$passed" == "true" && "$PID" == "" ]] && continue 15 | [[ "$passed" == "true" ]] && echo "killing inhibitor: $PID" && kill -9 "$PID" && PID="" && LAST_INHIBIT="" && continue 16 | 17 | inhibit="sleep:shutdown" 18 | 19 | # inhibit idle if pipewire has active inputs, outputs 20 | [ "$pipewire" != "" ] && inhibit="idle:$inhibit" 21 | 22 | [ "$LAST_INHIBIT" == "$inhibit" ] && continue 23 | kill -9 "$PID" &>/dev/null && PID="" 24 | 25 | LAST_INHIBIT="$inhibit" 26 | reason="failed: $cpu$disk$network$pipewire" 27 | 28 | echo "ihibiting $inhibit, $reason" 29 | systemd-inhibit --what="$inhibit" --why="$reason" --who="sd-inhibitor" sh -c "while :; do sleep 1; done" & 30 | PID="$!" 31 | done 32 | -------------------------------------------------------------------------------- /system/desktop/steam-session/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) mkIf; 9 | cfg = config.icedos; 10 | session = cfg.applications.steam.session; 11 | in 12 | mkIf (session.enable) { 13 | jovian = { 14 | devices.steamdeck = mkIf (cfg.hardware.devices.steamdeck && !cfg.internals.isFirstBuild) { 15 | enable = true; 16 | enableGyroDsuService = true; 17 | autoUpdate = true; 18 | }; 19 | 20 | hardware.has.amd.gpu = cfg.hardware.graphics.amd.enable; 21 | 22 | steam = { 23 | enable = true; 24 | autoStart = session.autoStart.enable; 25 | desktopSession = session.autoStart.desktopSession; 26 | updater.splash = if (cfg.hardware.devices.steamdeck) then "jovian" else "vendor"; 27 | user = session.user; 28 | }; 29 | 30 | steamos.useSteamOSConfig = true; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /system/users/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | 7 | let 8 | inherit (lib) 9 | attrNames 10 | mapAttrs 11 | foldl' 12 | ; 13 | 14 | cfg = config.icedos.system; 15 | in 16 | { 17 | nix.settings.trusted-users = [ 18 | "root" 19 | ] ++ (foldl' (acc: user: acc ++ [ user ]) [ ] (attrNames cfg.users)); 20 | 21 | users.users = mapAttrs ( 22 | user: _: 23 | let 24 | description = cfg.users.${user}.description; 25 | in 26 | { 27 | createHome = true; 28 | home = "${cfg.home}/${user}"; 29 | useDefaultShell = true; 30 | # Default password used for first login, change later using passwd 31 | password = "1"; 32 | isNormalUser = true; 33 | description = "${description}"; 34 | extraGroups = [ "wheel" ]; 35 | } 36 | ) cfg.users; 37 | 38 | home-manager.users = mapAttrs (user: _: { home.stateVersion = cfg.version; }) cfg.users; 39 | } 40 | -------------------------------------------------------------------------------- /system/users/icedborn/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | ... 4 | }: 5 | 6 | let 7 | launchers = with pkgs; [ 8 | # cemu 9 | # duckstation 10 | # heroic 11 | # pcsx2 12 | # ppsspp 13 | # prismlauncher 14 | # rpcs3 15 | ]; 16 | in 17 | { 18 | users.users.icedborn.packages = 19 | with pkgs; 20 | [ 21 | appimage-run 22 | blanket 23 | faugus-launcher 24 | fragments 25 | gimp 26 | harmony-music 27 | newsflash 28 | umu-launcher 29 | warp 30 | ] 31 | ++ launchers; 32 | } 33 | --------------------------------------------------------------------------------