Restructuring #1
| @ -1,244 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   config, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   imports = [ |  | ||||||
|     # Import environment |  | ||||||
|     ./vm-base.nix |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   config = { |  | ||||||
|     # Machine hostname |  | ||||||
|     networking.hostName = "vm-audio"; |  | ||||||
| 
 |  | ||||||
|     # Enabled modules |  | ||||||
|     modules = { |  | ||||||
|       pipewire.enable = true; |  | ||||||
|       spotifyd.enable = true; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Install system packages |  | ||||||
|     environment.systemPackages = with pkgs; [ |  | ||||||
|       carla |  | ||||||
|       xpra |  | ||||||
|       alsa-utils |  | ||||||
|       pulsemixer |  | ||||||
|       adwaita-icon-theme |  | ||||||
|       open-stage-control |  | ||||||
|       carla_osc_bridge |  | ||||||
| 
 |  | ||||||
|       # Add LV2 plugins |  | ||||||
|       lsp-plugins |  | ||||||
|       airwindows-lv2 |  | ||||||
|       distrho-ports |  | ||||||
|       cardinal |  | ||||||
|       calf |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # Setup firewall |  | ||||||
|     networking.firewall = { |  | ||||||
|       allowedTCPPorts = [ |  | ||||||
|         8080 |  | ||||||
|         10402 |  | ||||||
|         15151 |  | ||||||
|         22752 |  | ||||||
|       ]; |  | ||||||
|       allowedUDPPorts = [ |  | ||||||
|         8080 |  | ||||||
|         10402 |  | ||||||
|         15151 |  | ||||||
|         22752 |  | ||||||
|       ]; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Setup dependencies |  | ||||||
|     environment.variables.LD_LIBRARY_PATH = lib.mkForce "${lib.makeLibraryPath ( |  | ||||||
|       with pkgs; |  | ||||||
|       [ |  | ||||||
|         cairo |  | ||||||
|         pipewire.jack |  | ||||||
|       ] |  | ||||||
|     )}"; |  | ||||||
|     qt = { |  | ||||||
|       enable = true; |  | ||||||
|       style = "adwaita"; |  | ||||||
|     }; |  | ||||||
|     xdg.icons = { |  | ||||||
|       enable = true; |  | ||||||
|       fallbackCursorThemes = [ "Adwaita" ]; |  | ||||||
|     }; |  | ||||||
|     hardware.graphics.enable = true; |  | ||||||
| 
 |  | ||||||
|     # User for audio mixing |  | ||||||
|     users.users.mixer = { |  | ||||||
|       isNormalUser = true; |  | ||||||
|       group = "mixer"; |  | ||||||
|       extraGroups = [ "systemd-journal" ]; |  | ||||||
|       openssh.authorizedKeys.keys = [ |  | ||||||
|         "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKKxoQSxfYqf9ITN8Fhckk8WbY4dwtBAXOhC9jxihJvq jan@bulthuis.dev" |  | ||||||
|       ]; |  | ||||||
|     }; |  | ||||||
|     users.groups.mixer = { }; |  | ||||||
|     users.groups.audio = { |  | ||||||
|       members = [ |  | ||||||
|         "mixer" |  | ||||||
|       ]; |  | ||||||
|     }; |  | ||||||
|     users.groups.bluetooth = { |  | ||||||
|       members = [ |  | ||||||
|         "mixer" |  | ||||||
|       ]; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Xpra service |  | ||||||
|     systemd.user.services.xpra = { |  | ||||||
|       description = "Xpra Service"; |  | ||||||
|       wantedBy = [ "default.target" ]; |  | ||||||
|       after = [ |  | ||||||
|         "network.target" |  | ||||||
|       ]; |  | ||||||
|       unitConfig = { |  | ||||||
|         ConditionUser = "mixer"; |  | ||||||
|       }; |  | ||||||
|       serviceConfig = { |  | ||||||
|         ExecStart = "${pkgs.xpra}/bin/xpra start :7 --bind-tcp=0.0.0.0:15151 --daemon=no"; |  | ||||||
|         Restart = "always"; |  | ||||||
|         RestartSec = 5; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Carla service |  | ||||||
|     systemd.user.services.carla = { |  | ||||||
|       description = "Carla Service"; |  | ||||||
|       wantedBy = [ "default.target" ]; |  | ||||||
|       after = [ |  | ||||||
|         "network.target" |  | ||||||
|         "sound.target" |  | ||||||
|       ]; |  | ||||||
|       requires = [ |  | ||||||
|         "xpra.service" |  | ||||||
|       ]; |  | ||||||
|       unitConfig = { |  | ||||||
|         ConditionUser = "mixer"; |  | ||||||
|       }; |  | ||||||
|       serviceConfig = { |  | ||||||
|         ExecStart = "${pkgs.carla}/bin/carla /home/mixer/Default.carxp -platform xcb"; |  | ||||||
|         Environment = "\"DISPLAY=:7\""; |  | ||||||
|         Restart = "always"; |  | ||||||
|         RestartSec = 5; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Carla service |  | ||||||
|     systemd.user.services.carla-bridge = { |  | ||||||
|       description = "Carla OSC Bridge"; |  | ||||||
|       wantedBy = [ "default.target" ]; |  | ||||||
|       after = [ |  | ||||||
|         "network.target" |  | ||||||
|         "sound.target" |  | ||||||
|       ]; |  | ||||||
|       requires = [ |  | ||||||
|         "carla.service" |  | ||||||
|       ]; |  | ||||||
|       unitConfig = { |  | ||||||
|         ConditionUser = "mixer"; |  | ||||||
|       }; |  | ||||||
|       serviceConfig = { |  | ||||||
|         ExecStart = "${pkgs.carla_osc_bridge}/bin/carla_osc_bridge --clients \"127.0.0.1:8080\""; |  | ||||||
|         Restart = "always"; |  | ||||||
|         RestartSec = 5; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Open stage control service |  | ||||||
|     systemd.user.services.osc = { |  | ||||||
|       description = "OSC Service"; |  | ||||||
|       wantedBy = [ "default.target" ]; |  | ||||||
|       after = [ |  | ||||||
|         "network.target" |  | ||||||
|       ]; |  | ||||||
|       requires = [ |  | ||||||
|         "carla.service" |  | ||||||
|       ]; |  | ||||||
|       unitConfig = { |  | ||||||
|         ConditionUser = "mixer"; |  | ||||||
|       }; |  | ||||||
|       serviceConfig = { |  | ||||||
|         ExecStart = "${pkgs.open-stage-control}/bin/open-stage-control --no-gui --send 127.0.0.1:10402 --load /home/mixer/open-stage-control/session.json --theme /home/mixer/open-stage-control/theme.css"; |  | ||||||
|         Environment = "\"ELECTRON_RUN_AS_NODE=1\""; |  | ||||||
|         Restart = "always"; |  | ||||||
|         RestartSec = 5; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Create bluetooth A2DP source |  | ||||||
|     hardware.bluetooth = { |  | ||||||
|       enable = true; |  | ||||||
|       disabledPlugins = [ "hostname" ]; |  | ||||||
|       settings.General = { |  | ||||||
|         Name = "Linox"; |  | ||||||
|         Class = "0x240414"; |  | ||||||
|         DiscoverableTimeout = 0; |  | ||||||
|         AlwaysPairable = true; |  | ||||||
|         PairableTimeout = 0; |  | ||||||
|         FastConnectable = true; |  | ||||||
|         JustWorksRepairing = "always"; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|     services.pipewire.wireplumber.extraConfig."50-bluetooth-a2dp" = { |  | ||||||
|       "monitor.bluez.properties" = { |  | ||||||
|         "bluez5.roles" = [ "a2dp_source" ]; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Create null sinks |  | ||||||
|     services.pipewire.extraConfig.pipewire."91-null-sinks" = { |  | ||||||
|       "context.objects" = [ |  | ||||||
|         { |  | ||||||
|           factory = "adapter"; |  | ||||||
|           args = { |  | ||||||
|             "factory.name" = "support.null-audio-sink"; |  | ||||||
|             "node.name" = "Speaker-Proxy"; |  | ||||||
|             "node.description" = "Proxy for Speaker Output"; |  | ||||||
|             "media.class" = "Audio/Sink"; |  | ||||||
|             "audio.position" = "L,R"; |  | ||||||
|           }; |  | ||||||
|         } |  | ||||||
|         { |  | ||||||
|           factory = "adapter"; |  | ||||||
|           args = { |  | ||||||
|             "factory.name" = "support.null-audio-sink"; |  | ||||||
|             "node.name" = "Headphone-Proxy"; |  | ||||||
|             "node.description" = "Proxy for Headphone Output"; |  | ||||||
|             "media.class" = "Audio/Sink"; |  | ||||||
|             "audio.position" = "L,R"; |  | ||||||
|           }; |  | ||||||
|         } |  | ||||||
|         { |  | ||||||
|           factory = "adapter"; |  | ||||||
|           args = { |  | ||||||
|             "factory.name" = "support.null-audio-sink"; |  | ||||||
|             "node.name" = "SpotifyD-Proxy"; |  | ||||||
|             "node.description" = "Proxy for SpotifyD"; |  | ||||||
|             "media.class" = "Audio/Sink"; |  | ||||||
|             "audio.position" = "L,R"; |  | ||||||
|           }; |  | ||||||
|         } |  | ||||||
|         { |  | ||||||
|           factory = "adapter"; |  | ||||||
|           args = { |  | ||||||
|             "factory.name" = "support.null-audio-sink"; |  | ||||||
|             "node.name" = "AnalogIn-Proxy"; |  | ||||||
|             "node.description" = "Proxy for the analog input"; |  | ||||||
|             "media.class" = "Audio/Source/Virtual"; |  | ||||||
|             "audio.position" = "L,R"; |  | ||||||
|           }; |  | ||||||
|         } |  | ||||||
|       ]; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,63 +0,0 @@ | |||||||
| { lib, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   imports = [ |  | ||||||
|     # Import environment |  | ||||||
|     ../default.nix |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   config = { |  | ||||||
|     # State version |  | ||||||
|     system.stateVersion = "24.11"; |  | ||||||
| 
 |  | ||||||
|     # Machine hostname |  | ||||||
|     networking.hostName = lib.mkDefault "vm-base"; |  | ||||||
| 
 |  | ||||||
|     # Enabled modules |  | ||||||
|     modules = { |  | ||||||
|       base.enable = true; |  | ||||||
|       ssh.enable = true; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Enable qemu guest agent |  | ||||||
|     services.qemuGuest.enable = true; |  | ||||||
| 
 |  | ||||||
|     # Hardware configuration |  | ||||||
|     hardware.enableRedistributableFirmware = true; |  | ||||||
|     boot.initrd.availableKernelModules = [ |  | ||||||
|       "ata_piix" |  | ||||||
|       "uhci_hcd" |  | ||||||
|       "virtio_pci" |  | ||||||
|       "virtio_scsi" |  | ||||||
|       "sd_mod" |  | ||||||
|       "sr_mod" |  | ||||||
|     ]; |  | ||||||
|     boot.initrd.kernelModules = [ ]; |  | ||||||
|     boot.kernelModules = [ "kvm-intel" ]; |  | ||||||
|     boot.extraModulePackages = [ ]; |  | ||||||
|     hardware.cpu.intel.updateMicrocode = true; |  | ||||||
| 
 |  | ||||||
|     # Filesystems |  | ||||||
|     fileSystems."/" = { |  | ||||||
|       device = "/dev/disk/by-partlabel/root"; |  | ||||||
|       fsType = "ext4"; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     fileSystems."/boot" = { |  | ||||||
|       device = "/dev/disk/by-partlabel/EFI"; |  | ||||||
|       fsType = "vfat"; |  | ||||||
|       options = [ |  | ||||||
|         "fmask=0077" |  | ||||||
|         "dmask=0077" |  | ||||||
|       ]; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Swapfile |  | ||||||
|     swapDevices = [ |  | ||||||
|       { |  | ||||||
|         device = "/var/lib/swapfile"; |  | ||||||
|         size = 6 * 1024; |  | ||||||
|       } |  | ||||||
|     ]; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,60 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.base; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.base = { |  | ||||||
|     enable = mkEnableOption "base"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     environment.systemPackages = with pkgs; [ |  | ||||||
|       # Add base linux utilities |  | ||||||
|       git |  | ||||||
|       wget |  | ||||||
|       curl |  | ||||||
|       dig |  | ||||||
|       procps |  | ||||||
|       wireguard-tools |  | ||||||
|       usbutils |  | ||||||
|       pciutils |  | ||||||
|       zip |  | ||||||
|       unzip |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     modules = { |  | ||||||
|       # Enable base modules |  | ||||||
|       clean-tmp.enable = true; |  | ||||||
|       neovim.enable = true; |  | ||||||
|       systemd-boot.enable = true; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # TODO: Remove everything below, it is here out of convenience and should be elsewhere |  | ||||||
|     # networking.nameservers = [ |  | ||||||
|     #   "9.9.9.9" |  | ||||||
|     #   "149.112.112.112" |  | ||||||
|     # ]; |  | ||||||
|     # programs.captive-browser.enable = true; |  | ||||||
|     services.resolved = { |  | ||||||
|       enable = true; |  | ||||||
|     }; |  | ||||||
|     networking.firewall.enable = true; |  | ||||||
|     modules.unfree.enable = true; |  | ||||||
|     nix.settings.experimental-features = "nix-command flakes"; |  | ||||||
|     nixpkgs.hostPlatform = "x86_64-linux"; |  | ||||||
| 
 |  | ||||||
|     console.packages = [ |  | ||||||
|       pkgs.dina-psfu |  | ||||||
|     ]; |  | ||||||
|     console.font = "dina"; |  | ||||||
|     console.earlySetup = true; |  | ||||||
|     boot.loader.timeout = 0; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,93 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.base.desktop; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.base.desktop = { |  | ||||||
|     enable = mkEnableOption "desktop"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     environment.systemPackages = with pkgs; [ |  | ||||||
|       # TODO: MOVE |  | ||||||
|       quickemu # TODO: Reenable once building this is fixed |  | ||||||
|       pdftk |  | ||||||
| 
 |  | ||||||
|       # TODO: Move to USB module |  | ||||||
|       # usbutils |  | ||||||
|       # udiskie |  | ||||||
|       # udisks |  | ||||||
|       brightnessctl |  | ||||||
| 
 |  | ||||||
|       wireshark |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # Move to Realm module |  | ||||||
|     security.krb5 = { |  | ||||||
|       enable = true; |  | ||||||
|       settings = { |  | ||||||
|         libdefaults = { |  | ||||||
|           rdns = false; |  | ||||||
|         }; |  | ||||||
|         realms = { |  | ||||||
|           "GEWISWG.GEWIS.NL" = { |  | ||||||
|             kdc = [ |  | ||||||
|               "https://gewisvdesktop.gewis.nl/KdcProxy" |  | ||||||
|             ]; |  | ||||||
|           }; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     modules = { |  | ||||||
|       # Enable base modules |  | ||||||
|       base.enable = true; |  | ||||||
|       fontconfig.enable = true; |  | ||||||
|       nixgreety.enable = true; |  | ||||||
|       pipewire.enable = true; |  | ||||||
|       graphics.enable = true; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     programs.dconf.enable = true; |  | ||||||
|     services.libinput.enable = true; |  | ||||||
|     networking.firewall = { |  | ||||||
|       enable = true; |  | ||||||
|       logRefusedConnections = true; |  | ||||||
|       logRefusedPackets = true; |  | ||||||
|       logReversePathDrops = true; |  | ||||||
|       logRefusedUnicastsOnly = false; |  | ||||||
|     }; |  | ||||||
|     programs.wireshark.enable = true; |  | ||||||
|     machine.sudo-groups = [ "wireshark" ]; |  | ||||||
|     services.upower.enable = true; # For battery percentage in gnome |  | ||||||
|     modules.unfree.allowedPackages = [ |  | ||||||
|       "nvidia-x11" |  | ||||||
|       "nvidia-settings" |  | ||||||
|     ]; |  | ||||||
|     networking.firewall.allowedTCPPortRanges = [ |  | ||||||
|       { |  | ||||||
|         from = 10000; |  | ||||||
|         to = 11000; |  | ||||||
|       } |  | ||||||
|     ]; |  | ||||||
|     networking.firewall.allowedUDPPortRanges = [ |  | ||||||
|       { |  | ||||||
|         from = 10000; |  | ||||||
|         to = 11000; |  | ||||||
|       } |  | ||||||
|     ]; |  | ||||||
|     security.rtkit.enable = true; |  | ||||||
|     security.polkit.enable = true; |  | ||||||
| 
 |  | ||||||
|     # TODO: Move to USB module |  | ||||||
|     # services.gvfs.enable = true; |  | ||||||
|     services.udisks2.enable = true; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,23 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.bluetooth; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.bluetooth = { |  | ||||||
|     enable = mkEnableOption "bluetooth"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     environment.systemPackages = with pkgs; [ bluez ]; |  | ||||||
| 
 |  | ||||||
|     hardware.bluetooth.enable = true; |  | ||||||
|     hardware.bluetooth.powerOnBoot = true; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,18 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.clean-tmp; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.clean-tmp = { |  | ||||||
|     enable = mkEnableOption "clean-tmp"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { boot.tmp.cleanOnBoot = true; }; |  | ||||||
| } |  | ||||||
| @ -1,37 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.silent-boot; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.silent-boot = { |  | ||||||
|     enable = mkEnableOption "silent-boot"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     boot = { |  | ||||||
|       loader.timeout = 0; |  | ||||||
| 
 |  | ||||||
|       consoleLogLevel = 0; |  | ||||||
|       initrd.verbose = false; |  | ||||||
|       initrd.checkJournalingFS = false; |  | ||||||
| 
 |  | ||||||
|       kernelParams = [ |  | ||||||
|         "quiet" |  | ||||||
|         "boot.shell_on_fail" |  | ||||||
|         "loglevel=3" |  | ||||||
|         "rd.systemd.show_status=false" |  | ||||||
|         "rd.udev.log_level=3" |  | ||||||
|         "udev.log_priority=3" |  | ||||||
|         "video=efifb:nobgrt" |  | ||||||
|         "bgrt_disable" |  | ||||||
|       ]; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,24 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.systemd-boot; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.systemd-boot = { |  | ||||||
|     enable = mkEnableOption "systemd-boot"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     boot.loader = { |  | ||||||
|       systemd-boot.enable = true; |  | ||||||
|       systemd-boot.editor = false; |  | ||||||
|       efi.canTouchEfiVariables = true; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,18 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.brightnessctl; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.brightnessctl = { |  | ||||||
|     enable = mkEnableOption "brightnessctl"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { environment.systemPackages = [ pkgs.brightnessctl ]; }; |  | ||||||
| } |  | ||||||
| @ -1,39 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| { |  | ||||||
|   imports = [ |  | ||||||
|     # Import modules |  | ||||||
|     ./base/default.nix |  | ||||||
|     ./base/desktop.nix |  | ||||||
|     ./bluetooth/default.nix |  | ||||||
|     ./boot/clean-tmp.nix |  | ||||||
|     ./boot/silent-boot.nix |  | ||||||
|     ./boot/systemd-boot.nix |  | ||||||
|     ./brightnessctl/default.nix |  | ||||||
|     ./fontconfig/default.nix |  | ||||||
|     ./graphics/default.nix |  | ||||||
|     ./grdp/default.nix |  | ||||||
|     ./greeter/greetd/default.nix |  | ||||||
|     ./greeter/greetd/nixgreety.nix |  | ||||||
|     ./greeter/greetd/tuigreet.nix |  | ||||||
|     ./greeter/ly/default.nix |  | ||||||
|     ./locale/default.nix |  | ||||||
|     ./neovim/default.nix |  | ||||||
|     ./networkmanager/default.nix |  | ||||||
|     ./power-saving/default.nix |  | ||||||
|     ./printing/default.nix |  | ||||||
|     ./sound/pipewire.nix |  | ||||||
|     ./spotifyd/default.nix |  | ||||||
|     ./ssh/default.nix |  | ||||||
|     ./users/default.nix |  | ||||||
|     ./unfree/default.nix |  | ||||||
|     ./vpn/tailscale.nix |  | ||||||
|     ./wifi/wpa_supplicant.nix |  | ||||||
|   ]; |  | ||||||
| } |  | ||||||
| @ -1,27 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.fontconfig; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.fontconfig = { |  | ||||||
|     enable = mkEnableOption "fontconfig"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = { |  | ||||||
|     fonts.fontconfig.enable = cfg.enable; |  | ||||||
|     fonts.enableDefaultPackages = false; |  | ||||||
|     fonts.fontconfig.defaultFonts = { |  | ||||||
|       serif = mkDefault [ ]; |  | ||||||
|       sansSerif = mkDefault [ ]; |  | ||||||
|       monospace = mkDefault [ ]; |  | ||||||
|       emoji = mkDefault [ ]; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,39 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.fontconfig; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.graphics = { |  | ||||||
|     enable = mkEnableOption "graphics"; |  | ||||||
|   }; |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     # TODO: Modularize further, especially modesetting should be its own module. |  | ||||||
|     # Set up graphics |  | ||||||
|     hardware.graphics.enable32Bit = true; |  | ||||||
|     hardware.graphics.enable = true; |  | ||||||
|     services.xserver.videoDrivers = [ "nvidia" ]; |  | ||||||
|     hardware.nvidia = { |  | ||||||
|       modesetting.enable = true; |  | ||||||
|       powerManagement.enable = false; |  | ||||||
|       powerManagement.finegrained = false; |  | ||||||
|       open = false; |  | ||||||
|       nvidiaSettings = true; |  | ||||||
|       package = config.boot.kernelPackages.nvidiaPackages.beta; |  | ||||||
|       prime = { |  | ||||||
|         intelBusId = "PCI:0:2:0"; |  | ||||||
|         nvidiaBusId = "PCI:1:0:0"; |  | ||||||
|         offload = { |  | ||||||
|           enable = true; |  | ||||||
|           enableOffloadCmd = true; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,50 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| { |  | ||||||
|   options.modules.grdp = { |  | ||||||
|     enable = mkEnableOption "grdp"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf config.modules.grdp.enable { |  | ||||||
|     services.gnome.gnome-remote-desktop.enable = true; |  | ||||||
|     environment.systemPackages = with pkgs; [ |  | ||||||
|       gnome-remote-desktop |  | ||||||
|       gnome-control-center |  | ||||||
|       gnome-session |  | ||||||
|       gnome-shell |  | ||||||
|       gnome-settings-daemon |  | ||||||
|       gdm |  | ||||||
|     ]; |  | ||||||
|     systemd.services."gnome-remote-desktop".wantedBy = [ "graphical.target" ]; |  | ||||||
|     networking.firewall = { |  | ||||||
|       allowedTCPPorts = [ 3389 ]; |  | ||||||
|       allowedUDPPorts = [ 3389 ]; |  | ||||||
|     }; |  | ||||||
|     services.xserver.displayManager.gdm.enable = true; |  | ||||||
|     modules.greetd.enable = mkForce false; |  | ||||||
| 
 |  | ||||||
|     # security.polkit.extraConfig = '' |  | ||||||
|     #   polkit.addRule(function(action, subject) { |  | ||||||
|     #     if (action.id == "org.gnome.controlcenter.remote-session-helper" && |  | ||||||
|     #         subject.isInGroup("wheel")) { |  | ||||||
|     #       return polkit.Result.YES; |  | ||||||
|     #     } |  | ||||||
|     #   });''; |  | ||||||
|     # programs.dconf.profiles.user.databases = [ |  | ||||||
|     #   { |  | ||||||
|     #     settings = with lib.gvariant; { |  | ||||||
|     #       "org/gnome/desktop/remote-desktop/rdp" = { |  | ||||||
|     #         enable = true; |  | ||||||
|     #         view-only = false; |  | ||||||
|     #       }; |  | ||||||
|     #     }; |  | ||||||
|     #   } |  | ||||||
|     # ]; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,31 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.greetd; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.greetd = { |  | ||||||
|     enable = mkEnableOption "greetd"; |  | ||||||
|     command = mkOption { |  | ||||||
|       type = types.str; |  | ||||||
|       default = ""; |  | ||||||
|       description = "Command to run to show greeter."; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     services.greetd = { |  | ||||||
|       enable = true; |  | ||||||
|       settings.default_session = { |  | ||||||
|         command = cfg.command; |  | ||||||
|         user = mkDefault "greeter"; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,30 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.nixgreety; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.nixgreety = { |  | ||||||
|     enable = mkEnableOption "nixgreety"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     # Enable greetd |  | ||||||
|     modules.greetd = { |  | ||||||
|       enable = true; |  | ||||||
|       command = "${pkgs.nixgreety}/bin/nixgreety"; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     services.greetd.settings.default_session.user = "root"; |  | ||||||
| 
 |  | ||||||
|     environment.systemPackages = with pkgs; [ |  | ||||||
|       nixgreety |  | ||||||
|     ]; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,37 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.tuigreet; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.tuigreet = { |  | ||||||
|     enable = mkEnableOption "tuigreet"; |  | ||||||
|     greeting = mkOption { |  | ||||||
|       type = types.str; |  | ||||||
|       default = "Hewwo! >_< :3"; |  | ||||||
|       description = "Greeting message to show."; |  | ||||||
|     }; |  | ||||||
|     command = mkOption { |  | ||||||
|       type = types.str; |  | ||||||
|       default = "~/.initrc"; |  | ||||||
|       description = "Command to run after logging in."; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     # Enable greetd |  | ||||||
|     modules.greetd = { |  | ||||||
|       enable = true; |  | ||||||
|       command = "${pkgs.greetd.tuigreet}/bin/tuigreet --remember --greeting \"${cfg.greeting}\" --time --cmd \"${cfg.command}\" --asterisks"; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Enable silent boot to prevent late log messages from messing up tuigreet |  | ||||||
|     modules.silent-boot.enable = true; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,30 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.ly; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.ly = { |  | ||||||
|     enable = mkEnableOption "ly"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     services.displayManager.ly = { |  | ||||||
|       enable = true; |  | ||||||
|       settings = { |  | ||||||
|         animation = "matrix"; |  | ||||||
|         animation_refresh_ms = 32; |  | ||||||
|         box_title = "Hewwo! >_< :3"; |  | ||||||
|         clear_password = true; |  | ||||||
|         load = true; |  | ||||||
|         save = true; |  | ||||||
|         xinitrc = "null"; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,14 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   config = { |  | ||||||
|     time.timeZone = "Europe/Amsterdam"; |  | ||||||
|     i18n.defaultLocale = "en_US.UTF-8"; |  | ||||||
|     console.keyMap = "us"; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,23 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.neovim; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.neovim = { |  | ||||||
|     enable = mkEnableOption "neovim"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     programs.neovim = { |  | ||||||
|       enable = true; |  | ||||||
|       defaultEditor = true; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,29 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.networkmanager; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.networkmanager = { |  | ||||||
|     enable = mkEnableOption "networkmanager"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     machine.sudo-groups = [ "networkmanager" ]; |  | ||||||
|     networking = { |  | ||||||
|       networkmanager = { |  | ||||||
|         enable = true; |  | ||||||
|         wifi.powersave = true; |  | ||||||
|       }; |  | ||||||
|       firewall = { |  | ||||||
|         # Fix for wireguard |  | ||||||
|         checkReversePath = false; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,36 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.power-saving; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.power-saving = { |  | ||||||
|     enable = mkEnableOption "power-saving"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     powerManagement.enable = true; |  | ||||||
|     services.thermald.enable = true; |  | ||||||
|     services.tlp = { |  | ||||||
|       enable = true; |  | ||||||
| 
 |  | ||||||
|       settings = { |  | ||||||
|         CPU_SCALING_GOVERNOR_ON_AC = "performance"; |  | ||||||
|         CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; |  | ||||||
| 
 |  | ||||||
|         CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; |  | ||||||
|         CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; |  | ||||||
| 
 |  | ||||||
|         CPU_MIN_PERF_ON_AC = 0; |  | ||||||
|         CPU_MAX_PERF_ON_AC = 100; |  | ||||||
|         CPU_MIN_PERF_ON_BAT = 0; |  | ||||||
|         CPU_MAX_PERF_ON_BAT = 20; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,27 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.printing; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.printing = { |  | ||||||
|     enable = mkEnableOption "printing"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     services.printing = { |  | ||||||
|       enable = true; |  | ||||||
|       # drivers = with pkgs; []; |  | ||||||
|     }; |  | ||||||
|     services.avahi = { |  | ||||||
|       enable = true; |  | ||||||
|       nssmdns4 = true; |  | ||||||
|       openFirewall = true; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,27 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.pipewire; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.pipewire = { |  | ||||||
|     enable = mkEnableOption "pipewire"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     security.rtkit.enable = true; |  | ||||||
|     services.pipewire = { |  | ||||||
|       enable = true; |  | ||||||
|       alsa.enable = true; |  | ||||||
|       alsa.support32Bit = true; |  | ||||||
|       pulse.enable = true; |  | ||||||
|       jack.enable = true; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,64 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.spotifyd; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.spotifyd = { |  | ||||||
|     enable = mkEnableOption "spotifyd"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     # User for spotifyd |  | ||||||
|     users.users.mixer = { |  | ||||||
|       group = "mixer"; |  | ||||||
|     }; |  | ||||||
|     users.groups.mixer = { }; |  | ||||||
| 
 |  | ||||||
|     # Spotifyd service |  | ||||||
|     systemd.user.services.spotifyd = { |  | ||||||
|       description = "SpotifyD Service"; |  | ||||||
|       wantedBy = [ "default.target" ]; |  | ||||||
|       after = [ |  | ||||||
|         "network.target" |  | ||||||
|         "sound.target" |  | ||||||
|       ]; |  | ||||||
|       unitConfig = { |  | ||||||
|         ConditionUser = "mixer"; # TODO: Allow user configuration |  | ||||||
|       }; |  | ||||||
|       serviceConfig = { |  | ||||||
|         ExecStart = "${pkgs.spotifyd}/bin/spotifyd --no-daemon --config-path /etc/spotifyd/spotifyd.conf"; |  | ||||||
|         Restart = "always"; |  | ||||||
|         RestartSec = 5; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Set up config |  | ||||||
|     environment.etc = { |  | ||||||
|       "spotifyd/spotifyd.conf" = { |  | ||||||
|         source = ./spotifyd.conf; |  | ||||||
|         mode = "0444"; |  | ||||||
|         user = "mixer"; # TODO: Make user configurable |  | ||||||
|         group = "mixer"; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Set up firewall |  | ||||||
|     networking.firewall = { |  | ||||||
|       allowedTCPPorts = [ |  | ||||||
|         5353 |  | ||||||
|         5454 |  | ||||||
|       ]; |  | ||||||
|       allowedUDPPorts = [ |  | ||||||
|         5353 |  | ||||||
|         5454 |  | ||||||
|       ]; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,118 +0,0 @@ | |||||||
| [global] |  | ||||||
| 
 |  | ||||||
| #---------# |  | ||||||
| # GENERAL # |  | ||||||
| #---------# |  | ||||||
| 
 |  | ||||||
| # The name that gets displayed under the connect tab on |  | ||||||
| # official clients. |  | ||||||
| device_name = "Linox" |  | ||||||
| 
 |  | ||||||
| # The displayed device type in Spotify clients. |  | ||||||
| # Can be unknown, computer, tablet, smartphone, speaker, t_v, |  | ||||||
| # a_v_r (Audio/Video Receiver), s_t_b (Set-Top Box), and audio_dongle. |  | ||||||
| device_type = "a_v_r" |  | ||||||
| 
 |  | ||||||
| # The directory used to store credentials and audio cache. |  | ||||||
| # Default: infers a sensible cache directory (e.g. on Linux: $XDG_CACHE_HOME) |  | ||||||
| # |  | ||||||
| # Note: The file path does not get expanded. Environment variables and |  | ||||||
| # shell placeholders like $HOME or ~ don't work! |  | ||||||
| #cache_path = "/full/path/to/cache/directory" |  | ||||||
| 
 |  | ||||||
| # If set to true, audio data does NOT get cached. |  | ||||||
| # In this case, the cache is only used for credentials. |  | ||||||
| #no_audio_cache = true |  | ||||||
| 
 |  | ||||||
| # The maximal size of the cache directory in bytes |  | ||||||
| # The example value corresponds to ~ 1GB |  | ||||||
| #max_cache_size = 1000000000 |  | ||||||
| 
 |  | ||||||
| # If set to true, `spotifyd` tries to bind to dbus (default is the session bus) |  | ||||||
| # and expose MPRIS controls. When running headless, without the session bus, |  | ||||||
| # you should set this to false, to avoid errors. If you still want to use MPRIS, |  | ||||||
| # have a look at the `dbus_type` option. |  | ||||||
| use_mpris = false |  | ||||||
| 
 |  | ||||||
| # The bus to bind to with the MPRIS interface. |  | ||||||
| # Possible values: "session", "system" |  | ||||||
| # The system bus can be used if no graphical session is available |  | ||||||
| # (e.g. on headless systems) but you still want to be able to use MPRIS. |  | ||||||
| # NOTE: You might need to add appropriate policies to allow spotifyd to |  | ||||||
| # own the name. |  | ||||||
| #dbus_type = "session" |  | ||||||
| 
 |  | ||||||
| #-----------# |  | ||||||
| # DISCOVERY # |  | ||||||
| #-----------# |  | ||||||
| 
 |  | ||||||
| # If set to true, this disables zeroconf discovery. |  | ||||||
| # This can be useful, if one prefers to run a single-user instance. |  | ||||||
| #disable_discovery = false |  | ||||||
| 
 |  | ||||||
| # The port at which `spotifyd` is going to offer its service over the network (TCP). |  | ||||||
| # If not set, a random port > 1024 is used. For the service to be discoverable on the |  | ||||||
| # local network via mDNS, both the mDNS port (5353 UDP) and the random or fixed |  | ||||||
| # zeroconf port need to be allowed through any active firewall. |  | ||||||
| zeroconf_port = 5454 |  | ||||||
| 
 |  | ||||||
| #-------# |  | ||||||
| # AUDIO # |  | ||||||
| #-------# |  | ||||||
| 
 |  | ||||||
| # The audio backend used to play music. To get |  | ||||||
| # a list of possible backends, run `spotifyd --help`. |  | ||||||
| #backend = "alsa" # use portaudio for macOS [homebrew] |  | ||||||
| backend = "pulseaudio" |  | ||||||
| 
 |  | ||||||
| # The alsa audio device to stream audio. To get a |  | ||||||
| # list of valid devices, run `aplay -L`, |  | ||||||
| #device = "default"  # omit for macOS |  | ||||||
| device = "SpotifyD-Proxy" |  | ||||||
| 
 |  | ||||||
| # The PCM sample format to use. Possible values  |  | ||||||
| # are F32, S32, S24, S24_3, S16.  |  | ||||||
| # Change this value if you encounter errors like |  | ||||||
| # "Alsa error PCM open ALSA function 'snd_pcm_hw_params_set_format' failed with error 'EINVAL: Invalid argument'" |  | ||||||
| #audio_format = "S16" |  | ||||||
| 
 |  | ||||||
| # The volume controller. Each one behaves different to |  | ||||||
| # volume increases. For possible values, run |  | ||||||
| # `spotifyd --help`. |  | ||||||
| #volume_controller = "softvol"  # use softvol for macOS |  | ||||||
| 
 |  | ||||||
| # ! Only relevant for ALSA ! |  | ||||||
| # The alsa control device. By default this is the same |  | ||||||
| # name as the `device` field. |  | ||||||
| #control = "default" |  | ||||||
| 
 |  | ||||||
| # ! Only relevant for ALSA ! |  | ||||||
| # The alsa mixer used by `spotifyd`. |  | ||||||
| #mixer = "PCM"  # omit for macOS |  | ||||||
| 
 |  | ||||||
| # The audio bitrate. 96, 160 or 320 kbit/s |  | ||||||
| #bitrate = 160 |  | ||||||
| 
 |  | ||||||
| # Volume on startup between 0 and 100 |  | ||||||
| #initial_volume = 90 |  | ||||||
| initial_volume = 100 |  | ||||||
| 
 |  | ||||||
| # If set to true, enables volume normalisation between songs. |  | ||||||
| # volume_normalisation = true |  | ||||||
| 
 |  | ||||||
| # The normalisation pregain that is applied for each song. |  | ||||||
| #normalisation_pregain = -10 |  | ||||||
| 
 |  | ||||||
| #-------ä |  | ||||||
| # OTHER # |  | ||||||
| #-------# |  | ||||||
| 
 |  | ||||||
| # After the music playback has ended, start playing similar songs based on the previous tracks. |  | ||||||
| # By default, `spotifyd` infers this setting from the user settings. |  | ||||||
| autoplay = true |  | ||||||
| 
 |  | ||||||
| # A command that gets executed in your shell after each song changes. |  | ||||||
| #on_song_change_hook = "echo \"hook executed on $PLAYER_EVENT\"" |  | ||||||
| 
 |  | ||||||
| # The proxy `spotifyd` will use to connect to spotify. |  | ||||||
| #proxy = "http://proxy.example.org:8080" |  | ||||||
| @ -1,20 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.ssh; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.ssh = { |  | ||||||
|     enable = mkEnableOption "ssh"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     services.openssh.enable = true; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,24 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.unfree; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.unfree = { |  | ||||||
|     enable = mkEnableOption "unfree"; |  | ||||||
|     allowedPackages = mkOption { |  | ||||||
|       type = types.listOf types.str; |  | ||||||
|       default = [ ]; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (getName pkg) cfg.allowedPackages; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,79 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   # User configuration |  | ||||||
|   userModule = types.submodule { |  | ||||||
|     options = { |  | ||||||
|       sudo = mkOption { |  | ||||||
|         type = types.bool; |  | ||||||
|         default = false; |  | ||||||
|         example = true; |  | ||||||
|         description = "Whether the user is allowed sudo access."; |  | ||||||
|       }; |  | ||||||
|       configuration = mkOption { |  | ||||||
|         type = types.path; |  | ||||||
|         default = ./users/base.nix; |  | ||||||
|         description = "What home manager configuration to use for this user."; |  | ||||||
|       }; |  | ||||||
|       desktopInit = mkOption { |  | ||||||
|         type = types.lines; |  | ||||||
|         default = ""; |  | ||||||
|         description = "Bash script to execute after initial log in."; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   imports = [ |  | ||||||
|     # Import systemwide configuration |  | ||||||
|     ./systemwide.nix |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   options = { |  | ||||||
|     machine.sudo-groups = mkOption { |  | ||||||
|       type = types.listOf types.str; |  | ||||||
|       default = [ ]; |  | ||||||
|       description = "Groups assigned to sudo users."; |  | ||||||
|     }; |  | ||||||
|     machine.users = mkOption { |  | ||||||
|       type = types.attrsOf userModule; |  | ||||||
|       default = { }; |  | ||||||
|       description = "Users configured on this system."; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = { |  | ||||||
|     # Add required home manager modules |  | ||||||
|     home-manager.sharedModules = [ |  | ||||||
|       # Modules |  | ||||||
|       ../../user-modules/default.nix |  | ||||||
| 
 |  | ||||||
|       # Custom packages |  | ||||||
|       ../../pkgs/default.nix |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # Create users |  | ||||||
|     users.users = attrsets.concatMapAttrs (name: value: { |  | ||||||
|       ${name} = { |  | ||||||
|         isNormalUser = true; |  | ||||||
|         extraGroups = mkIf value.sudo ( |  | ||||||
|           [ |  | ||||||
|             "wheel" |  | ||||||
|           ] |  | ||||||
|           ++ config.machine.sudo-groups |  | ||||||
|         ); |  | ||||||
|       }; |  | ||||||
|     }) config.machine.users; |  | ||||||
| 
 |  | ||||||
|     # Create home manager configuration for users |  | ||||||
|     home-manager.users = attrsets.concatMapAttrs (name: value: { |  | ||||||
|       ${name} = value.configuration; |  | ||||||
|     }) config.machine.users; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,42 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   moduleFiles = [ |  | ||||||
|     ../../user-modules/desktop/systemwide.nix |  | ||||||
|     ../../user-modules/development/systemwide.nix |  | ||||||
|     ../../user-modules/gaming/systemwide.nix |  | ||||||
|     ../../user-modules/keyring/systemwide.nix |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   moduleConfig = lists.foldr (file: acc: recursiveUpdate acc (import file)) { } moduleFiles; |  | ||||||
| 
 |  | ||||||
|   moduleNames = attrNames moduleConfig; |  | ||||||
| 
 |  | ||||||
|   mkModule = |  | ||||||
|     name: moduleConfig: |  | ||||||
|     { pkgs, ... }: |  | ||||||
|     { |  | ||||||
|       config = |  | ||||||
|         mkIf |  | ||||||
|           (any ( |  | ||||||
|             user: |  | ||||||
|             ( |  | ||||||
|               config.home-manager.users.${user}.modules.${name}.enable |  | ||||||
|               || (any (specialisation: specialisation.configuration.modules.${name}.enable) ( |  | ||||||
|                 attrValues config.home-manager.users.${user}.specialisation |  | ||||||
|               )) |  | ||||||
|             ) |  | ||||||
|           ) (attrNames config.home-manager.users)) |  | ||||||
|           (if (isAttrs moduleConfig) then moduleConfig else (moduleConfig { inherit config pkgs; })); |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|   imports = map (name: mkModule name moduleConfig."${name}") moduleNames; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   imports = imports; |  | ||||||
| } |  | ||||||
| @ -1,23 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.tailscale; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.tailscale = { |  | ||||||
|     enable = mkEnableOption "tailscale"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     services.tailscale = { |  | ||||||
|       enable = true; |  | ||||||
|       useRoutingFeatures = "client"; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,24 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.wpa_supplicant; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.wpa_supplicant = { |  | ||||||
|     enable = mkEnableOption "wpa_supplicant"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     networking.wireless = { |  | ||||||
|       enable = true; |  | ||||||
|       userControlled.enable = true; |  | ||||||
|       allowAuxiliaryImperativeNetworks = true; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,21 +0,0 @@ | |||||||
| { |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| let |  | ||||||
|   overlay = final: prev: { |  | ||||||
|     dina-psfu = prev.callPackage ./fonts/dina-psfu.nix { }; |  | ||||||
|     ttf2psf = prev.callPackage ./fonts/ttf2psf.nix { }; |  | ||||||
|     wqy-zenhei = prev.callPackage ./fonts/wqy-zenhei.nix { }; |  | ||||||
|     wqy-microhei = prev.callPackage ./fonts/wqy-microhei.nix { }; |  | ||||||
|     wqy-bitmapsong = prev.callPackage ./fonts/wqy-bitmapsong.nix { }; |  | ||||||
| 
 |  | ||||||
|     wprs = prev.callPackage ./programs/wprs/default.nix { }; |  | ||||||
|     nixgreety = prev.callPackage ./programs/nixgreety.nix { }; |  | ||||||
|     carla_osc_bridge = prev.callPackage ./programs/carla_osc_bridge.nix { }; |  | ||||||
|     # ly = prev.callPackage ./programs/ly/default.nix { }; |  | ||||||
|   }; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   nixpkgs.overlays = [ overlay ]; |  | ||||||
| } |  | ||||||
| @ -1,31 +0,0 @@ | |||||||
| { |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| pkgs.stdenv.mkDerivation { |  | ||||||
|   pname = "ttf2psf"; |  | ||||||
|   version = "1.0.0"; |  | ||||||
| 
 |  | ||||||
|   src = pkgs.fetchFromGitHub { |  | ||||||
|     owner = "NateChoe1"; |  | ||||||
|     repo = "ttf2psf"; |  | ||||||
|     rev = "8db09d05385f595c320eccae4c48ff4393ca5bde"; |  | ||||||
|     sha256 = "v52TZp+GyXHBAMsIoHFA8ZIMPsDVls13WW29vpesCig="; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   buildInputs = with pkgs; [ |  | ||||||
|     pkg-config |  | ||||||
|     freetype |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   buildPhase = '' |  | ||||||
|     make build/ttf2psf |  | ||||||
|   ''; |  | ||||||
| 
 |  | ||||||
|   installPhase = '' |  | ||||||
|     install -Dm 755 -t $out/bin build/ttf2psf |  | ||||||
|     install -Dm 644 -t $out/share/ttf2psf data/*.* |  | ||||||
|     install -Dm 644 -t $out/share/ttf2psf/fontsets data/fontsets/* |  | ||||||
|   ''; |  | ||||||
| } |  | ||||||
| @ -1,35 +0,0 @@ | |||||||
| { |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| pkgs.stdenv.mkDerivation rec { |  | ||||||
|   pname = "wqy-bitmapsong-pcf"; |  | ||||||
|   version = "1.0.0-RC1"; |  | ||||||
| 
 |  | ||||||
|   src = pkgs.fetchurl { |  | ||||||
|     url = "mirror://sourceforge/wqy/${pname}-${version}.tar.gz"; |  | ||||||
|     hash = "sha256-0uvwkRUbvJ0remTnlP8dElRjaBVd6iukNYBTE/CTO7s="; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   buildInputs = [ pkgs.fontforge ]; |  | ||||||
|   buildPhase = '' |  | ||||||
|     newName() { |  | ||||||
|     test "''${1:5:1}" = i && _it=Italic || _it= |  | ||||||
|     case ''${1:6:3} in |  | ||||||
|         400) test -z $it && _weight=Medium ;; |  | ||||||
|         700) _weight=Bold ;; |  | ||||||
|     esac |  | ||||||
|     _pt=''${1%.pcf} |  | ||||||
|     _pt=''${_pt#*-} |  | ||||||
|     echo "WenQuanYi_Bitmap_Song$_weight$_it$_pt" |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     for i in *.pcf; do |  | ||||||
|     fontforge -lang=ff -c "Open(\"$i\"); Generate(\"$(newName $i).otb\")" |  | ||||||
|     done |  | ||||||
|   ''; |  | ||||||
|   installPhase = '' |  | ||||||
|     install -Dm644 *.otb -t $out/share/fonts/ |  | ||||||
|   ''; |  | ||||||
| } |  | ||||||
| @ -1,22 +0,0 @@ | |||||||
| { |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| pkgs.stdenv.mkDerivation rec { |  | ||||||
|   pname = "wqy-microhei"; |  | ||||||
|   version = "0.2.0-beta"; |  | ||||||
| 
 |  | ||||||
|   src = pkgs.fetchurl { |  | ||||||
|     url = "mirror://sourceforge/wqy/${pname}-${version}.tar.gz"; |  | ||||||
|     hash = "sha256-KAKsgCOqNqZupudEWFTjoHjTd///QhaTQb0jeHH3IT4="; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   installPhase = '' |  | ||||||
|     runHook preInstall |  | ||||||
| 
 |  | ||||||
|     install -Dm644 *.ttc -t $out/share/fonts/ |  | ||||||
| 
 |  | ||||||
|     runHook postInstall |  | ||||||
|   ''; |  | ||||||
| } |  | ||||||
| @ -1,22 +0,0 @@ | |||||||
| { |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| pkgs.stdenv.mkDerivation rec { |  | ||||||
|   pname = "wqy-zenhei"; |  | ||||||
|   version = "0.9.45"; |  | ||||||
| 
 |  | ||||||
|   src = pkgs.fetchurl { |  | ||||||
|     url = "mirror://sourceforge/wqy/${pname}-${version}.tar.gz"; |  | ||||||
|     hash = "sha256-5LfjBkdb+UJ9F1dXjw5FKJMMhMROqj8WfUxC8RDuddY="; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   installPhase = '' |  | ||||||
|     runHook preInstall |  | ||||||
| 
 |  | ||||||
|     install -Dm644 *.ttc -t $out/share/fonts/ |  | ||||||
| 
 |  | ||||||
|     runHook postInstall |  | ||||||
|   ''; |  | ||||||
| } |  | ||||||
| @ -1,19 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| with pkgs; |  | ||||||
| rustPlatform.buildRustPackage { |  | ||||||
|   pname = "carla_osc_bridge"; |  | ||||||
|   version = "master"; |  | ||||||
| 
 |  | ||||||
|   src = fetchFromGitea { |  | ||||||
|     domain = "git.bulthuis.dev"; |  | ||||||
|     owner = "Jan"; |  | ||||||
|     repo = "carla_osc_bridge"; |  | ||||||
|     rev = "c037e2d2a1b29b785d8acc10fa0cb761afdb3fcf"; |  | ||||||
|     hash = "sha256-Wvdfm+4dfygZwkvaUhO9w7DrrUl3ZYvtD7nYrPSD0eA="; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   cargoHash = "sha256-s1ZKbhHudgPOy7613zbT8TkbM6B7oloLEuTYHoWjX5o="; |  | ||||||
| 
 |  | ||||||
|   useFetchCargoVendor = true; |  | ||||||
| } |  | ||||||
| @ -1,47 +0,0 @@ | |||||||
| { |  | ||||||
|   stdenv, |  | ||||||
|   lib, |  | ||||||
|   fetchFromGitHub, |  | ||||||
|   linux-pam, |  | ||||||
|   libxcb, |  | ||||||
|   makeBinaryWrapper, |  | ||||||
|   zig_0_12, |  | ||||||
|   callPackage, |  | ||||||
|   nixosTests, |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| stdenv.mkDerivation { |  | ||||||
|   pname = "ly"; |  | ||||||
|   version = "1.0.2"; |  | ||||||
| 
 |  | ||||||
|   src = fetchFromGitHub { |  | ||||||
|     owner = "peterc-s"; |  | ||||||
|     repo = "ly"; |  | ||||||
|     rev = "e6d8bea236dd0097adb1c22e9a23d95102ebe9d9"; |  | ||||||
|     sha256 = "w9YdNVD+8UhrEbPJ7xqsd/WoxU2rlo2GXFtc9JpWHxo="; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   nativeBuildInputs = [ |  | ||||||
|     makeBinaryWrapper |  | ||||||
|     zig_0_12.hook |  | ||||||
|   ]; |  | ||||||
|   buildInputs = [ |  | ||||||
|     libxcb |  | ||||||
|     linux-pam |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   postPatch = '' |  | ||||||
|     ln -s ${callPackage ./deps.nix { }} $ZIG_GLOBAL_CACHE_DIR/p |  | ||||||
|   ''; |  | ||||||
| 
 |  | ||||||
|   passthru.tests = { inherit (nixosTests) ly; }; |  | ||||||
| 
 |  | ||||||
|   meta = with lib; { |  | ||||||
|     description = "TUI display manager"; |  | ||||||
|     license = licenses.wtfpl; |  | ||||||
|     homepage = "https://github.com/fairyglade/ly"; |  | ||||||
|     maintainers = [ maintainers.vidister ]; |  | ||||||
|     platforms = platforms.linux; |  | ||||||
|     mainProgram = "ly"; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,110 +0,0 @@ | |||||||
| # generated by zon2nix (https://github.com/Cloudef/zig2nix) |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   lib, |  | ||||||
|   linkFarm, |  | ||||||
|   fetchurl, |  | ||||||
|   fetchgit, |  | ||||||
|   runCommandLocal, |  | ||||||
|   zig, |  | ||||||
|   name ? "zig-packages", |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| let |  | ||||||
|   unpackZigArtifact = |  | ||||||
|     { name, artifact }: |  | ||||||
|     runCommandLocal name { nativeBuildInputs = [ zig ]; } '' |  | ||||||
|       hash="$(zig fetch --global-cache-dir "$TMPDIR" ${artifact})" |  | ||||||
|       mv "$TMPDIR/p/$hash" "$out" |  | ||||||
|       chmod 755 "$out" |  | ||||||
|     ''; |  | ||||||
| 
 |  | ||||||
|   fetchZig = |  | ||||||
|     { |  | ||||||
|       name, |  | ||||||
|       url, |  | ||||||
|       hash, |  | ||||||
|     }: |  | ||||||
|     let |  | ||||||
|       artifact = fetchurl { inherit url hash; }; |  | ||||||
|     in |  | ||||||
|     unpackZigArtifact { inherit name artifact; }; |  | ||||||
| 
 |  | ||||||
|   fetchGitZig = |  | ||||||
|     { |  | ||||||
|       name, |  | ||||||
|       url, |  | ||||||
|       hash, |  | ||||||
|     }: |  | ||||||
|     let |  | ||||||
|       parts = lib.splitString "#" url; |  | ||||||
|       base = lib.elemAt parts 0; |  | ||||||
|       rev = lib.elemAt parts 1; |  | ||||||
|     in |  | ||||||
|     fetchgit { |  | ||||||
|       inherit name rev hash; |  | ||||||
|       url = base; |  | ||||||
|       deepClone = false; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|   fetchZigArtifact = |  | ||||||
|     { |  | ||||||
|       name, |  | ||||||
|       url, |  | ||||||
|       hash, |  | ||||||
|     }: |  | ||||||
|     let |  | ||||||
|       parts = lib.splitString "://" url; |  | ||||||
|       proto = lib.elemAt parts 0; |  | ||||||
|       path = lib.elemAt parts 1; |  | ||||||
|       fetcher = { |  | ||||||
|         "git+http" = fetchGitZig { |  | ||||||
|           inherit name hash; |  | ||||||
|           url = "http://${path}"; |  | ||||||
|         }; |  | ||||||
|         "git+https" = fetchGitZig { |  | ||||||
|           inherit name hash; |  | ||||||
|           url = "https://${path}"; |  | ||||||
|         }; |  | ||||||
|         http = fetchZig { |  | ||||||
|           inherit name hash; |  | ||||||
|           url = "http://${path}"; |  | ||||||
|         }; |  | ||||||
|         https = fetchZig { |  | ||||||
|           inherit name hash; |  | ||||||
|           url = "https://${path}"; |  | ||||||
|         }; |  | ||||||
|         file = unpackZigArtifact { |  | ||||||
|           inherit name; |  | ||||||
|           artifact = /. + path; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|     in |  | ||||||
|     fetcher.${proto}; |  | ||||||
| in |  | ||||||
| linkFarm name [ |  | ||||||
|   { |  | ||||||
|     name = "122062d301a203d003547b414237229b09a7980095061697349f8bef41be9c30266b"; |  | ||||||
|     path = fetchZigArtifact { |  | ||||||
|       name = "clap"; |  | ||||||
|       url = "https://github.com/Hejsil/zig-clap/archive/refs/tags/0.9.1.tar.gz"; |  | ||||||
|       hash = "sha256-7qxm/4xb+58MGG+iUzssUtR97OG2dRjAqyS0BAet4HY="; |  | ||||||
|     }; |  | ||||||
|   } |  | ||||||
|   { |  | ||||||
|     name = "12209b971367b4066d40ecad4728e6fdffc4cc4f19356d424c2de57f5b69ac7a619a"; |  | ||||||
|     path = fetchZigArtifact { |  | ||||||
|       name = "zigini"; |  | ||||||
|       url = "https://github.com/Kawaii-Ash/zigini/archive/0bba97a12582928e097f4074cc746c43351ba4c8.tar.gz"; |  | ||||||
|       hash = "sha256-OdaJ5tqmk2MPwaAbpK4HRD/CcQCN+Cjj8U63BqUcFMs="; |  | ||||||
|     }; |  | ||||||
|   } |  | ||||||
|   { |  | ||||||
|     name = "1220b0979ea9891fa4aeb85748fc42bc4b24039d9c99a4d65d893fb1c83e921efad8"; |  | ||||||
|     path = fetchZigArtifact { |  | ||||||
|       name = "ini"; |  | ||||||
|       url = "https://github.com/ziglibs/ini/archive/e18d36665905c1e7ba0c1ce3e8780076b33e3002.tar.gz"; |  | ||||||
|       hash = "sha256-RQ6OPJBqqH7PCL+xiI58JT7vnIo6zbwpLWn+byZO5iM="; |  | ||||||
|     }; |  | ||||||
|   } |  | ||||||
| ] |  | ||||||
| @ -1,19 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| with pkgs; |  | ||||||
| rustPlatform.buildRustPackage { |  | ||||||
|   pname = "nixgreety"; |  | ||||||
|   version = "master"; |  | ||||||
| 
 |  | ||||||
|   src = fetchFromGitea { |  | ||||||
|     domain = "git.bulthuis.dev"; |  | ||||||
|     owner = "Jan"; |  | ||||||
|     repo = "nixgreety"; |  | ||||||
|     rev = "c7278a910a0238a53f23fe9a0ae881802a4bcb31"; |  | ||||||
|     hash = "sha256-kZB+iEFIDJ8pOJetu4Isu4oaktgIn14D4PcpDXLOXA8="; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   cargoHash = "sha256-pklKVzYoChRqPZ/D3BsMGnaBFd615TKbvoAy7iU8UtA="; |  | ||||||
| 
 |  | ||||||
|   useFetchCargoVendor = true; |  | ||||||
| } |  | ||||||
							
								
								
									
										2431
									
								
								unorganized/pkgs/programs/wprs/Cargo.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2431
									
								
								unorganized/pkgs/programs/wprs/Cargo.lock
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -1,50 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   rustPlatform, |  | ||||||
|   fetchFromGitHub, |  | ||||||
|   pkg-config, |  | ||||||
|   libxkbcommon, |  | ||||||
|   python3, |  | ||||||
|   runCommand, |  | ||||||
|   wprs, |  | ||||||
| }: |  | ||||||
| rustPlatform.buildRustPackage { |  | ||||||
|   pname = "wprs"; |  | ||||||
|   version = "0-unstable-2025-04-16"; |  | ||||||
| 
 |  | ||||||
|   src = fetchFromGitHub { |  | ||||||
|     owner = "wayland-transpositor"; |  | ||||||
|     repo = "wprs"; |  | ||||||
|     rev = "dfc1385bcb73734cd0d05a7e353522983c236562"; |  | ||||||
|     hash = "sha256-MrfYrKAVFoT453B2zED6Ax2coZ/KZ7CWYdZCx469Q/4="; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   nativeBuildInputs = [ |  | ||||||
|     pkg-config |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   buildInputs = [ |  | ||||||
|     libxkbcommon |  | ||||||
|     (python3.withPackages (pp: with pp; [ psutil ])) |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   useFetchCargoVendor = true; |  | ||||||
|   cargoHash = "sha256-01PTfgDeagC72z8XADXEn5Aio6UWQAAYgDP4zKFTPpY="; |  | ||||||
| 
 |  | ||||||
|   preFixup = '' |  | ||||||
|     cp  wprs "$out/bin/wprs" |  | ||||||
|   ''; |  | ||||||
| 
 |  | ||||||
|   passthru.tests.sanity = runCommand "wprs-sanity" { nativeBuildInputs = [ wprs ]; } '' |  | ||||||
|     ${wprs}/bin/wprs -h > /dev/null && touch $out |  | ||||||
|   ''; |  | ||||||
| 
 |  | ||||||
|   meta = with lib; { |  | ||||||
|     description = "rootless remote desktop access for remote Wayland"; |  | ||||||
|     license = licenses.asl20; |  | ||||||
|     maintainers = with maintainers; [ mksafavi ]; |  | ||||||
|     platforms = [ "x86_64-linux" ]; # The aarch64-linux support is not implemented in upstream yet. Also, the darwin platform is not supported as it requires wayland. |  | ||||||
|     homepage = "https://github.com/wayland-transpositor/wprs"; |  | ||||||
|     mainProgram = "wprs"; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,54 +0,0 @@ | |||||||
| { |  | ||||||
|   nixpkgs, |  | ||||||
|   flake-utils, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| let |  | ||||||
|   imports = [ |  | ||||||
|     ./shell.nix |  | ||||||
|     ./languages/python.nix |  | ||||||
|     ./languages/rust.nix |  | ||||||
|     ./utilities/cuda.nix |  | ||||||
|     ./utilities/jupyter.nix |  | ||||||
|   ]; |  | ||||||
| in |  | ||||||
| { |  | ||||||
| 
 |  | ||||||
|   mkShell = |  | ||||||
|     attrs: |  | ||||||
|     (flake-utils.lib.eachDefaultSystem ( |  | ||||||
|       system: |  | ||||||
|       let |  | ||||||
|         pkgs = import nixpkgs { |  | ||||||
|           inherit system; |  | ||||||
|           config.allowUnfree = true; |  | ||||||
|         }; |  | ||||||
|         evaluated = |  | ||||||
|           (nixpkgs.lib.evalModules { |  | ||||||
|             modules = [ attrs ] ++ imports; |  | ||||||
|             specialArgs = { |  | ||||||
|               pkgs = pkgs; |  | ||||||
|             }; |  | ||||||
|           }).config; |  | ||||||
|         recUpdate = nixpkgs.lib.recursiveUpdate; |  | ||||||
|         libPackages = evaluated.libPackages pkgs; |  | ||||||
|         shell = recUpdate { |  | ||||||
|           env = |  | ||||||
|             evaluated.env |  | ||||||
|             // ( |  | ||||||
|               if (libPackages != [ ]) then |  | ||||||
|                 { |  | ||||||
|                   LD_LIBRARY_PATH = nixpkgs.lib.makeLibraryPath libPackages; |  | ||||||
|                 } |  | ||||||
|               else |  | ||||||
|                 { } |  | ||||||
|             ); |  | ||||||
|           packages = evaluated.packages ++ (evaluated.extraPackages pkgs) ++ libPackages; |  | ||||||
|         } evaluated.override; |  | ||||||
|       in |  | ||||||
|       { |  | ||||||
|         devShells.default = pkgs.mkShell shell; |  | ||||||
|       } |  | ||||||
|     )); |  | ||||||
| } |  | ||||||
| @ -1,35 +0,0 @@ | |||||||
| { |  | ||||||
|   pkgs, |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   packages = config.python.packages; |  | ||||||
|   pythonPackage = pkgs.python3.withPackages packages; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.python = { |  | ||||||
|     enable = mkEnableOption "Python"; |  | ||||||
|     packages = mkOption { |  | ||||||
|       type = types.functionTo (types.listOf types.package) // { |  | ||||||
|         merge = |  | ||||||
|           loc: defs: p: |  | ||||||
|           lib.concatMap (def: (def.value p)) defs; |  | ||||||
|       }; |  | ||||||
|       default = p: [ ]; |  | ||||||
|       description = "Python packages to install"; |  | ||||||
|     }; |  | ||||||
|     # TODO: Add option to directly read from requirements.txt, maybe with mach-nix |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf config.python.enable { |  | ||||||
|     packages = [ |  | ||||||
|       pythonPackage |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     env.PYTHONINTERPRETER = "${pythonPackage}/bin/python"; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,37 +0,0 @@ | |||||||
| { |  | ||||||
|   pkgs, |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   rustPackage = pkgs.rustc; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.rust = { |  | ||||||
|     enable = mkEnableOption "Rust"; |  | ||||||
|     # TODO: Add option to specify toolchain file |  | ||||||
|     # See https://ayats.org/blog/nix-rustup |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf config.rust.enable { |  | ||||||
|     packages = with pkgs; [ |  | ||||||
|       rustPackage |  | ||||||
|       cargo |  | ||||||
|       clippy |  | ||||||
|       rustfmt |  | ||||||
|       cargo-audit |  | ||||||
| 
 |  | ||||||
|       bacon |  | ||||||
|       evcxr |  | ||||||
| 
 |  | ||||||
|       # TODO: Might be needed for bindgen |  | ||||||
|       # rustPlatform.bindgenHook |  | ||||||
|       # pkg-config |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # env.RUST_SRC_PATH = "${rustPackage}/lib/rustlib/src/rust/library"; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,43 +0,0 @@ | |||||||
| { lib, ... }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| { |  | ||||||
|   options = { |  | ||||||
|     env = mkOption { |  | ||||||
|       type = types.attrsOf types.str; |  | ||||||
|       default = { }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     packages = mkOption { |  | ||||||
|       type = types.listOf types.package; |  | ||||||
|       default = [ ]; |  | ||||||
|       description = "Packages to install"; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     extraPackages = mkOption { |  | ||||||
|       type = types.functionTo (types.listOf types.package) // { |  | ||||||
|         merge = |  | ||||||
|           loc: defs: p: |  | ||||||
|           lib.concatMap (def: (def.value p)) defs; |  | ||||||
|       }; |  | ||||||
|       default = p: [ ]; |  | ||||||
|       description = "Extra packages to install"; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     libPackages = mkOption { |  | ||||||
|       type = types.functionTo (types.listOf types.package) // { |  | ||||||
|         merge = |  | ||||||
|           loc: defs: p: |  | ||||||
|           lib.concatMap (def: (def.value p)) defs; |  | ||||||
|       }; |  | ||||||
|       default = p: [ ]; |  | ||||||
|       description = "Packages to install and add to library path"; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     override = mkOption { |  | ||||||
|       type = types.attrs; |  | ||||||
|       default = { }; |  | ||||||
|       description = "Settings in the mkShell call to override"; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,15 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| { |  | ||||||
|   options.cuda = { |  | ||||||
|     enable = mkEnableOption "CUDA"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf config.cuda.enable { |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,22 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| { |  | ||||||
|   options.jupyter = { |  | ||||||
|     enable = mkEnableOption "Jupyter"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf config.jupyter.enable { |  | ||||||
|     python.enable = mkDefault true; |  | ||||||
|     python.packages = |  | ||||||
|       p: with p; [ |  | ||||||
|         jupyter |  | ||||||
|         notebook |  | ||||||
|         ipykernel |  | ||||||
|       ]; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,28 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.bluetuith; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.bluetuith = { |  | ||||||
|     enable = mkEnableOption "bluetuith"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     home.packages = with pkgs; [ bluetuith ]; |  | ||||||
| 
 |  | ||||||
|     # Add nix tree |  | ||||||
|     xdg.desktopEntries.bluetuith = { |  | ||||||
|       exec = "${pkgs.bluetuith}/bin/bluetuith"; |  | ||||||
|       name = "Bluetuith"; |  | ||||||
|       terminal = true; |  | ||||||
|       type = "Application"; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,34 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| { |  | ||||||
|   imports = [ |  | ||||||
|     ./firefox/default.nix |  | ||||||
|     ./qutebrowser/default.nix |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   options.default.browser = mkOption { |  | ||||||
|     type = types.str; |  | ||||||
|     default = ""; |  | ||||||
|     description = "Default browser"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = { |  | ||||||
|     xdg.mimeApps = { |  | ||||||
|       enable = true; |  | ||||||
| 
 |  | ||||||
|       defaultApplications = { |  | ||||||
|         "text/html" = "${config.default.browser}"; |  | ||||||
|         "x-scheme-handler/http" = "${config.default.browser}"; |  | ||||||
|         "x-scheme-handler/https" = "${config.default.browser}"; |  | ||||||
|         "x-scheme-handler/about" = "${config.default.browser}"; |  | ||||||
|         "x-scheme-handler/unknown" = "${config.default.browser}"; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,76 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.firefox; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.firefox = { |  | ||||||
|     enable = lib.mkEnableOption "firefox"; |  | ||||||
|     default = lib.mkEnableOption "default"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = lib.mkIf cfg.enable { |  | ||||||
|     default.browser = mkIf cfg.default "firefox.desktop"; |  | ||||||
| 
 |  | ||||||
|     programs.firefox = { |  | ||||||
|       enable = true; |  | ||||||
| 
 |  | ||||||
|       policies = { |  | ||||||
|         AppAutoUpdate = false; |  | ||||||
|         BlockAboutAddons = false; |  | ||||||
|         BlockAboutConfig = true; |  | ||||||
|         BlockAboutProfiles = true; |  | ||||||
|         DisableAppUpdate = true; |  | ||||||
|         DisableFeedbackCommands = true; |  | ||||||
|         DisableMasterPasswordCreation = true; |  | ||||||
|         DisablePocket = true; |  | ||||||
|         DisableProfileImport = true; |  | ||||||
|         DisableProfileRefresh = true; |  | ||||||
|         DisableSetDesktopBackground = true; |  | ||||||
|         DisableTelemetry = true; |  | ||||||
|         DisplayBookmarksToolbar = "never"; |  | ||||||
|         DisplayMenuBar = "never"; |  | ||||||
|         DNSOverHTTPS = { |  | ||||||
|           Enabled = false; |  | ||||||
|         }; |  | ||||||
|         DontCheckDefaultBrowser = true; |  | ||||||
|         PasswordManagerEnabled = false; |  | ||||||
|         TranslateEnabled = true; |  | ||||||
|         UseSystemPrintDialog = true; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       profiles.nixos = { |  | ||||||
|         search.default = "ddg"; |  | ||||||
| 
 |  | ||||||
|         extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [ |  | ||||||
|           ublock-origin |  | ||||||
|         ]; |  | ||||||
| 
 |  | ||||||
|         # Theming |  | ||||||
|         userChrome = readFile ( |  | ||||||
|           pkgs.replaceVars ./userChrome.css { |  | ||||||
|             colors = config.desktop.theming.colorsCSS; |  | ||||||
|           } |  | ||||||
|         ); |  | ||||||
| 
 |  | ||||||
|         settings = { |  | ||||||
|           "browser.tabs.inTitlebar" = 0; |  | ||||||
|           "extensions.autoDisableScopes" = 0; |  | ||||||
|           "devtools.chrome.enabled" = true; |  | ||||||
|           "devtools.debugger.remote-enabled" = true; |  | ||||||
|           "toolkit.legacyUserProfileCustomizations.stylesheets" = true; |  | ||||||
|         }; |  | ||||||
| 
 |  | ||||||
|         # Force overwriting configuration file |  | ||||||
|         search.force = true; |  | ||||||
|         containersForce = true; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,73 +0,0 @@ | |||||||
| /* Import theme colors */ |  | ||||||
| @colors@ |  | ||||||
| 
 |  | ||||||
| /* Configure titlebar */ |  | ||||||
| #titlebar { |  | ||||||
|     /* Add consistent margins to tab bar */ |  | ||||||
|     padding: 0 2px !important; |  | ||||||
| 
 |  | ||||||
|     /* Add emphasized color to background of tab bar */ |  | ||||||
|     background-color: var(--nix-color-bg-status) !important; |  | ||||||
| 
 |  | ||||||
|     /* Set correct text color */ |  | ||||||
|     color: var(--nix-color-fg) !important; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| .tab-background:is([selected], [multiselected]) { |  | ||||||
|     /* Set correct background color */ |  | ||||||
|     background-color: var(--nix-color-bg) !important; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| .tab-content { |  | ||||||
|     /* Set correct text color */ |  | ||||||
|     color: var(--nix-color-fg) !important; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| /* Configure navigation bar */ |  | ||||||
| #nav-bar { |  | ||||||
|     /* Set correct background color */ |  | ||||||
|     background-color: var(--nix-color-bg) !important; |  | ||||||
| 
 |  | ||||||
|     /* Set correct text color */ |  | ||||||
|     color: var(--nix-color-fg) !important; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| #urlbar { |  | ||||||
|     /* Set correct text color */ |  | ||||||
|     color: var(--nix-color-fg) !important; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| #urlbar[open]>#urlbar-background { |  | ||||||
|     /* Set correct background color when opened */ |  | ||||||
|     background-color: var(--nix-color-bg) !important; |  | ||||||
| 
 |  | ||||||
|     /* Use same box-shadow as tabs when opened */ |  | ||||||
|     border: none !important; |  | ||||||
|     box-shadow: 0 0 4px rgba(0, 0, 0, .4) !important; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| #urlbar[focused]:not([suppress-focus-border])>#urlbar-background { |  | ||||||
|     /* Set better outline for focused urlbar */ |  | ||||||
|     outline-color: var(--nix-color-border-focused) !important; |  | ||||||
|     outline-width: 1px !important; |  | ||||||
|     outline-offset: 0 !important; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| #urlbar-background { |  | ||||||
|     /* Set the correct background color */ |  | ||||||
|     background-color: var(--nix-color-bg-status) !important; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| /* Configure popups */ |  | ||||||
| panelview { |  | ||||||
|     /* Set correct background color for popups */ |  | ||||||
|     background-color: var(--nix-color-bg) !important; |  | ||||||
| 
 |  | ||||||
|     /* Set correct text color */ |  | ||||||
|     color: var(--nix-color-fg) !important; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| menupopup { |  | ||||||
|     /* Set correct background color for context menus */ |  | ||||||
|     --panel-background: var(--nix-color-bg) !important; |  | ||||||
| } |  | ||||||
| @ -1,34 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.qutebrowser; |  | ||||||
|   theme = config.desktop.theming; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.qutebrowser = { |  | ||||||
|     enable = mkEnableOption "qutebrowser"; |  | ||||||
|     default = mkEnableOption "default"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     default.browser = mkIf cfg.default "org.qutebrowser.qutebrowser.desktop"; |  | ||||||
| 
 |  | ||||||
|     programs.qutebrowser = { |  | ||||||
|       enable = true; |  | ||||||
| 
 |  | ||||||
|       extraConfig = '' |  | ||||||
|         config.set("completion.web_history.max_items", 256) |  | ||||||
|         config.set("colors.webpage.darkmode.enabled", False) |  | ||||||
|         config.set("colors.webpage.preferred_color_scheme", "${if theme.darkMode then "dark" else "light"}") |  | ||||||
|         config.set("fonts.default_family", "${theme.fonts.interface.name}") |  | ||||||
|         config.set("fonts.default_size", "${toString theme.fonts.interface.recommendedSize}pt") |  | ||||||
|       ''; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,368 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.btop; |  | ||||||
|   colors = config.desktop.theming.schemeColors; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.btop = { |  | ||||||
|     enable = mkEnableOption "btop"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     home.packages = with pkgs; [ btop ]; |  | ||||||
| 
 |  | ||||||
|     xdg.configFile."btop/btop.conf" = { |  | ||||||
|       enable = true; |  | ||||||
|       text = '' |  | ||||||
|         #? Config file for btop v. 1.4.0 |  | ||||||
| 
 |  | ||||||
|         #* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. |  | ||||||
|         #* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" |  | ||||||
|         color_theme = "nixos" |  | ||||||
| 
 |  | ||||||
|         #* If the theme set background should be shown, set to False if you want terminal background transparency. |  | ||||||
|         theme_background = True |  | ||||||
| 
 |  | ||||||
|         #* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false. |  | ||||||
|         truecolor = True |  | ||||||
| 
 |  | ||||||
|         #* Set to true to force tty mode regardless if a real tty has been detected or not. |  | ||||||
|         #* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols. |  | ||||||
|         force_tty = False |  | ||||||
| 
 |  | ||||||
|         #* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets. |  | ||||||
|         #* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box. |  | ||||||
|         #* Use whitespace " " as separator between different presets. |  | ||||||
|         #* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty" |  | ||||||
|         presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty" |  | ||||||
| 
 |  | ||||||
|         #* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists. |  | ||||||
|         #* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. |  | ||||||
|         vim_keys = False |  | ||||||
| 
 |  | ||||||
|         #* Rounded corners on boxes, is ignored if TTY mode is ON. |  | ||||||
|         rounded_corners = False |  | ||||||
| 
 |  | ||||||
|         #* Default symbols to use for graph creation, "braille", "block" or "tty". |  | ||||||
|         #* "braille" offers the highest resolution but might not be included in all fonts. |  | ||||||
|         #* "block" has half the resolution of braille but uses more common characters. |  | ||||||
|         #* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY. |  | ||||||
|         #* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view. |  | ||||||
|         graph_symbol = "braille" |  | ||||||
| 
 |  | ||||||
|         # Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". |  | ||||||
|         graph_symbol_cpu = "default" |  | ||||||
| 
 |  | ||||||
|         # Graph symbol to use for graphs in gpu box, "default", "braille", "block" or "tty". |  | ||||||
|         graph_symbol_gpu = "default" |  | ||||||
| 
 |  | ||||||
|         # Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". |  | ||||||
|         graph_symbol_mem = "default" |  | ||||||
| 
 |  | ||||||
|         # Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". |  | ||||||
|         graph_symbol_net = "default" |  | ||||||
| 
 |  | ||||||
|         # Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". |  | ||||||
|         graph_symbol_proc = "default" |  | ||||||
| 
 |  | ||||||
|         #* Manually set which boxes to show. Available values are "cpu mem net proc" and "gpu0" through "gpu5", separate values with whitespace. |  | ||||||
|         shown_boxes = "cpu net proc mem" |  | ||||||
| 
 |  | ||||||
|         #* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs. |  | ||||||
|         update_ms = 500 |  | ||||||
| 
 |  | ||||||
|         #* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct", |  | ||||||
|         #* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly. |  | ||||||
|         proc_sorting = "cpu lazy" |  | ||||||
| 
 |  | ||||||
|         #* Reverse sorting order, True or False. |  | ||||||
|         proc_reversed = False |  | ||||||
| 
 |  | ||||||
|         #* Show processes as a tree. |  | ||||||
|         proc_tree = False |  | ||||||
| 
 |  | ||||||
|         #* Use the cpu graph colors in the process list. |  | ||||||
|         proc_colors = True |  | ||||||
| 
 |  | ||||||
|         #* Use a darkening gradient in the process list. |  | ||||||
|         proc_gradient = True |  | ||||||
| 
 |  | ||||||
|         #* If process cpu usage should be of the core it's running on or usage of the total available cpu power. |  | ||||||
|         proc_per_core = False |  | ||||||
| 
 |  | ||||||
|         #* Show process memory as bytes instead of percent. |  | ||||||
|         proc_mem_bytes = True |  | ||||||
| 
 |  | ||||||
|         #* Show cpu graph for each process. |  | ||||||
|         proc_cpu_graphs = True |  | ||||||
| 
 |  | ||||||
|         #* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate) |  | ||||||
|         proc_info_smaps = False |  | ||||||
| 
 |  | ||||||
|         #* Show proc box on left side of screen instead of right. |  | ||||||
|         proc_left = False |  | ||||||
| 
 |  | ||||||
|         #* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop). |  | ||||||
|         proc_filter_kernel = False |  | ||||||
| 
 |  | ||||||
|         #* In tree-view, always accumulate child process resources in the parent process. |  | ||||||
|         proc_aggregate = False |  | ||||||
| 
 |  | ||||||
|         #* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available. |  | ||||||
|         #* Select from a list of detected attributes from the options menu. |  | ||||||
|         cpu_graph_upper = "Auto" |  | ||||||
| 
 |  | ||||||
|         #* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available. |  | ||||||
|         #* Select from a list of detected attributes from the options menu. |  | ||||||
|         cpu_graph_lower = "Auto" |  | ||||||
| 
 |  | ||||||
|         #* If gpu info should be shown in the cpu box. Available values = "Auto", "On" and "Off". |  | ||||||
|         show_gpu_info = "Auto" |  | ||||||
| 
 |  | ||||||
|         #* Toggles if the lower CPU graph should be inverted. |  | ||||||
|         cpu_invert_lower = True |  | ||||||
| 
 |  | ||||||
|         #* Set to True to completely disable the lower CPU graph. |  | ||||||
|         cpu_single_graph = False |  | ||||||
| 
 |  | ||||||
|         #* Show cpu box at bottom of screen instead of top. |  | ||||||
|         cpu_bottom = False |  | ||||||
| 
 |  | ||||||
|         #* Shows the system uptime in the CPU box. |  | ||||||
|         show_uptime = True |  | ||||||
| 
 |  | ||||||
|         #* Show cpu temperature. |  | ||||||
|         check_temp = True |  | ||||||
| 
 |  | ||||||
|         #* Which sensor to use for cpu temperature, use options menu to select from list of available sensors. |  | ||||||
|         cpu_sensor = "Auto" |  | ||||||
| 
 |  | ||||||
|         #* Show temperatures for cpu cores also if check_temp is True and sensors has been found. |  | ||||||
|         show_coretemp = True |  | ||||||
| 
 |  | ||||||
|         #* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core. |  | ||||||
|         #* Use lm-sensors or similar to see which cores are reporting temperatures on your machine. |  | ||||||
|         #* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries. |  | ||||||
|         #* Example: "4:0 5:1 6:3" |  | ||||||
|         cpu_core_map = "" |  | ||||||
| 
 |  | ||||||
|         #* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine". |  | ||||||
|         temp_scale = "celsius" |  | ||||||
| 
 |  | ||||||
|         #* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024. |  | ||||||
|         base_10_sizes = False |  | ||||||
| 
 |  | ||||||
|         #* Show CPU frequency. |  | ||||||
|         show_cpu_freq = True |  | ||||||
| 
 |  | ||||||
|         #* Draw a clock at top of screen, formatting according to strftime, empty string to disable. |  | ||||||
|         #* Special formatting: /host = hostname | /user = username | /uptime = system uptime |  | ||||||
|         clock_format = "%X" |  | ||||||
| 
 |  | ||||||
|         #* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort. |  | ||||||
|         background_update = True |  | ||||||
| 
 |  | ||||||
|         #* Custom cpu model name, empty string to disable. |  | ||||||
|         custom_cpu_name = "" |  | ||||||
| 
 |  | ||||||
|         #* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ". |  | ||||||
|         #* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user". |  | ||||||
|         disks_filter = "" |  | ||||||
| 
 |  | ||||||
|         #* Show graphs instead of meters for memory values. |  | ||||||
|         mem_graphs = True |  | ||||||
| 
 |  | ||||||
|         #* Show mem box below net box instead of above. |  | ||||||
|         mem_below_net = False |  | ||||||
| 
 |  | ||||||
|         #* Count ZFS ARC in cached and available memory. |  | ||||||
|         zfs_arc_cached = True |  | ||||||
| 
 |  | ||||||
|         #* If swap memory should be shown in memory box. |  | ||||||
|         show_swap = True |  | ||||||
| 
 |  | ||||||
|         #* Show swap as a disk, ignores show_swap value above, inserts itself after first disk. |  | ||||||
|         swap_disk = True |  | ||||||
| 
 |  | ||||||
|         #* If mem box should be split to also show disks info. |  | ||||||
|         show_disks = True |  | ||||||
| 
 |  | ||||||
|         #* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar. |  | ||||||
|         only_physical = True |  | ||||||
| 
 |  | ||||||
|         #* Read disks list from /etc/fstab. This also disables only_physical. |  | ||||||
|         use_fstab = True |  | ||||||
| 
 |  | ||||||
|         #* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool) |  | ||||||
|         zfs_hide_datasets = False |  | ||||||
| 
 |  | ||||||
|         #* Set to true to show available disk space for privileged users. |  | ||||||
|         disk_free_priv = False |  | ||||||
| 
 |  | ||||||
|         #* Toggles if io activity % (disk busy time) should be shown in regular disk usage view. |  | ||||||
|         show_io_stat = True |  | ||||||
| 
 |  | ||||||
|         #* Toggles io mode for disks, showing big graphs for disk read/write speeds. |  | ||||||
|         io_mode = True |  | ||||||
| 
 |  | ||||||
|         #* Set to True to show combined read/write io graphs in io mode. |  | ||||||
|         io_graph_combined = False |  | ||||||
| 
 |  | ||||||
|         #* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ". |  | ||||||
|         #* Example: "/mnt/media:100 /:20 /boot:1". |  | ||||||
|         io_graph_speeds = "" |  | ||||||
| 
 |  | ||||||
|         #* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False. |  | ||||||
|         net_download = 100 |  | ||||||
| 
 |  | ||||||
|         net_upload = 100 |  | ||||||
| 
 |  | ||||||
|         #* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest. |  | ||||||
|         net_auto = True |  | ||||||
| 
 |  | ||||||
|         #* Sync the auto scaling for download and upload to whichever currently has the highest scale. |  | ||||||
|         net_sync = True |  | ||||||
| 
 |  | ||||||
|         #* Starts with the Network Interface specified here. |  | ||||||
|         net_iface = "" |  | ||||||
| 
 |  | ||||||
|         #* Show battery stats in top right if battery is present. |  | ||||||
|         show_battery = False |  | ||||||
| 
 |  | ||||||
|         #* Which battery to use if multiple are present. "Auto" for auto detection. |  | ||||||
|         selected_battery = "Auto" |  | ||||||
| 
 |  | ||||||
|         #* Show power stats of battery next to charge indicator. |  | ||||||
|         show_battery_watts = True |  | ||||||
| 
 |  | ||||||
|         #* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG". |  | ||||||
|         #* The level set includes all lower levels, i.e. "DEBUG" will show all logging info. |  | ||||||
|         log_level = "WARNING" |  | ||||||
| 
 |  | ||||||
|         #* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards. |  | ||||||
|         nvml_measure_pcie_speeds = True |  | ||||||
| 
 |  | ||||||
|         #* Horizontally mirror the GPU graph. |  | ||||||
|         gpu_mirror_graph = True |  | ||||||
| 
 |  | ||||||
|         #* Custom gpu0 model name, empty string to disable. |  | ||||||
|         custom_gpu_name0 = "" |  | ||||||
| 
 |  | ||||||
|         #* Custom gpu1 model name, empty string to disable. |  | ||||||
|         custom_gpu_name1 = "" |  | ||||||
| 
 |  | ||||||
|         #* Custom gpu2 model name, empty string to disable. |  | ||||||
|         custom_gpu_name2 = "" |  | ||||||
| 
 |  | ||||||
|         #* Custom gpu3 model name, empty string to disable. |  | ||||||
|         custom_gpu_name3 = "" |  | ||||||
| 
 |  | ||||||
|         #* Custom gpu4 model name, empty string to disable. |  | ||||||
|         custom_gpu_name4 = "" |  | ||||||
| 
 |  | ||||||
|         #* Custom gpu5 model name, empty string to disable. |  | ||||||
|         custom_gpu_name5 = "" |  | ||||||
|       ''; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     xdg.configFile."btop/themes/nixos.theme" = { |  | ||||||
|       enable = true; |  | ||||||
|       text = with colors; '' |  | ||||||
|         # Main background, empty for terminal default, need to be empty if you want transparent background |  | ||||||
|         theme[main_bg]="#${base00}" |  | ||||||
| 
 |  | ||||||
|         # Main text color |  | ||||||
|         theme[main_fg]="#${base05}" |  | ||||||
| 
 |  | ||||||
|         # Title color for boxes |  | ||||||
|         theme[title]="#${base05}" |  | ||||||
| 
 |  | ||||||
|         # Highlight color for keyboard shortcuts |  | ||||||
|         theme[hi_fg]="#${base0D}" |  | ||||||
| 
 |  | ||||||
|         # Background color of selected item in processes box |  | ||||||
|         theme[selected_bg]="#${base03}" |  | ||||||
| 
 |  | ||||||
|         # Foreground color of selected item in processes box |  | ||||||
|         theme[selected_fg]="#${base0D}" |  | ||||||
| 
 |  | ||||||
|         # Color of inactive/disabled text |  | ||||||
|         theme[inactive_fg]="#8c8fa1" |  | ||||||
| 
 |  | ||||||
|         # Color of text appearing on top of graphs, i.e uptime and current network graph scaling |  | ||||||
|         theme[graph_text]="#${base06}" |  | ||||||
| 
 |  | ||||||
|         # Background color of the percentage meters |  | ||||||
|         theme[meter_bg]="#${base03}" |  | ||||||
| 
 |  | ||||||
|         # Misc colors for processes box including mini cpu graphs, details memory graph and details status text |  | ||||||
|         theme[proc_misc]="#${base06}" |  | ||||||
| 
 |  | ||||||
|         # CPU, Memory, Network, Proc box outline colors |  | ||||||
|         theme[cpu_box]="#${base0E}" #Mauve |  | ||||||
|         theme[mem_box]="#${base0B}" #Green |  | ||||||
|         theme[net_box]="#e64553" #Maroon |  | ||||||
|         theme[proc_box]="#${colors.base0D}" #Blue |  | ||||||
| 
 |  | ||||||
|         # Box divider line and small boxes line color |  | ||||||
|         theme[div_line]="#9ca0b0" |  | ||||||
| 
 |  | ||||||
|         # Temperature graph color (Green -> Yellow -> Red) |  | ||||||
|         theme[temp_start]="#${base0B}" |  | ||||||
|         theme[temp_mid]="#${base0A}" |  | ||||||
|         theme[temp_end]="#${base08}" |  | ||||||
| 
 |  | ||||||
|         # CPU graph colors (Teal -> Lavender) |  | ||||||
|         theme[cpu_start]="#${base0C}" |  | ||||||
|         theme[cpu_mid]="#209fb5" |  | ||||||
|         theme[cpu_end]="#${base07}" |  | ||||||
| 
 |  | ||||||
|         # Mem/Disk free meter (Mauve -> Lavender -> Blue) |  | ||||||
|         theme[free_start]="#${base0E}" |  | ||||||
|         theme[free_mid]="#${base07}" |  | ||||||
|         theme[free_end]="#${base0D}" |  | ||||||
| 
 |  | ||||||
|         # Mem/Disk cached meter (Sapphire -> Lavender) |  | ||||||
|         theme[cached_start]="#209fb5" |  | ||||||
|         theme[cached_mid]="#${base0D}" |  | ||||||
|         theme[cached_end]="#${base07}" |  | ||||||
| 
 |  | ||||||
|         # Mem/Disk available meter (Peach -> Red) |  | ||||||
|         theme[available_start]="#${base09}" |  | ||||||
|         theme[available_mid]="#e64553" |  | ||||||
|         theme[available_end]="#${base08}" |  | ||||||
| 
 |  | ||||||
|         # Mem/Disk used meter (Green -> Sky) |  | ||||||
|         theme[used_start]="#${base0B}" |  | ||||||
|         theme[used_mid]="#${base0C}" |  | ||||||
|         theme[used_end]="#04a5e5" |  | ||||||
| 
 |  | ||||||
|         # Download graph colors (Peach -> Red) |  | ||||||
|         theme[download_start]="#${base09}" |  | ||||||
|         theme[download_mid]="#e64553" |  | ||||||
|         theme[download_end]="#${base08}" |  | ||||||
| 
 |  | ||||||
|         # Upload graph colors (Green -> Sky) |  | ||||||
|         theme[upload_start]="#${base0B}" |  | ||||||
|         theme[upload_mid]="#${base0C}" |  | ||||||
|         theme[upload_end]="#04a5e5" |  | ||||||
| 
 |  | ||||||
|         # Process box color gradient for threads, mem and cpu usage (Sapphire -> Mauve) |  | ||||||
|         theme[process_start]="#209fb5" |  | ||||||
|         theme[process_mid]="#${base07}" |  | ||||||
|         theme[process_end]="#${base0E}" |  | ||||||
|       ''; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     modules.shell.aliases = { |  | ||||||
|       top = "btop"; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,42 +0,0 @@ | |||||||
| { |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   imports = [ |  | ||||||
|     # Import all modules |  | ||||||
|     ./bluetuith/default.nix |  | ||||||
|     ./browser/default.nix |  | ||||||
|     ./btop/default.nix |  | ||||||
|     ./desktop/default.nix |  | ||||||
|     ./development/default.nix |  | ||||||
|     ./discord/default.nix |  | ||||||
|     ./eduvpn/default.nix |  | ||||||
|     ./feishin/default.nix |  | ||||||
|     ./fontconfig/default.nix |  | ||||||
|     ./gaming/default.nix |  | ||||||
|     ./git/default.nix |  | ||||||
|     ./keyring/default.nix |  | ||||||
|     ./mako/default.nix |  | ||||||
|     ./neovim/default.nix |  | ||||||
|     ./obsidian/default.nix |  | ||||||
|     ./rofi/default.nix |  | ||||||
|     ./rofi/rofi-rbw.nix |  | ||||||
|     ./scripts/default.nix |  | ||||||
|     ./shell/default.nix |  | ||||||
|     ./shell/bash.nix |  | ||||||
|     ./shell/fish.nix |  | ||||||
|     ./spotify/default.nix |  | ||||||
|     ./terminal/default.nix |  | ||||||
|     ./terminal/foot/default.nix |  | ||||||
|     ./vscode/default.nix |  | ||||||
|     ./whatsapp/default.nix |  | ||||||
|     ./wprs/default.nix |  | ||||||
|     ./winbox/default.nix |  | ||||||
|     ./xpra/default.nix |  | ||||||
|     ./zathura/default.nix |  | ||||||
| 
 |  | ||||||
|     # Import unfree helper |  | ||||||
|     ../modules/unfree/default.nix |  | ||||||
|   ]; |  | ||||||
| } |  | ||||||
| @ -1,164 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.waybar; |  | ||||||
|   theme = config.desktop.theming; |  | ||||||
|   colors = theme.colors; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.waybar = { |  | ||||||
|     enable = mkEnableOption "waybar"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     home.packages = with pkgs; [ |  | ||||||
|       pulsemixer |  | ||||||
|       playerctl |  | ||||||
|       networkmanagerapplet # TODO: Move |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     modules.desktop.reloadScript = '' |  | ||||||
|       # if ${pkgs.procps}/bin/pgrep waybar; then |  | ||||||
|       #   ${pkgs.procps}/bin/pkill waybar |  | ||||||
|       # fi |  | ||||||
|       ${pkgs.waybar}/bin/waybar & |  | ||||||
|     ''; |  | ||||||
| 
 |  | ||||||
|     programs.waybar = { |  | ||||||
|       enable = true; |  | ||||||
|       systemd.enable = false; |  | ||||||
|       settings = { |  | ||||||
|         mainBar = { |  | ||||||
|           layer = "top"; |  | ||||||
|           spacing = 16; |  | ||||||
|           modules-left = [ "river/tags" ]; |  | ||||||
|           modules-center = [ |  | ||||||
|             #"river/window" |  | ||||||
|             "mpris" |  | ||||||
|           ]; |  | ||||||
|           modules-right = [ |  | ||||||
|             "tray" |  | ||||||
|             "bluetooth" |  | ||||||
|             "network" |  | ||||||
|             "pulseaudio" |  | ||||||
|             "battery" |  | ||||||
|             "clock" |  | ||||||
|           ]; |  | ||||||
|           "river/window" = { |  | ||||||
|             max-length = 50; |  | ||||||
|           }; |  | ||||||
|           "river/tags" = { |  | ||||||
|             tag-labels = [ |  | ||||||
|               "一" |  | ||||||
|               "二" |  | ||||||
|               "三" |  | ||||||
|               "四" |  | ||||||
|               "五" |  | ||||||
|               "六" |  | ||||||
|               "七" |  | ||||||
|               "八" |  | ||||||
|               "九" |  | ||||||
|             ]; |  | ||||||
|             disable-click = false; |  | ||||||
|           }; |  | ||||||
|           network = { |  | ||||||
|             tooltip = false; |  | ||||||
|             on-click = "wpa_gui"; |  | ||||||
|             format-wifi = "直 {essid}"; # Spacing achieved using "Thin Space" |  | ||||||
|             format-ethernet = "TODO"; |  | ||||||
|             format-disconnected = "睊"; |  | ||||||
|           }; |  | ||||||
|           pulseaudio = { |  | ||||||
|             tooltip = false; |  | ||||||
|             format = "{icon}   {volume}%"; # Spacing achieved using "Thin Space" |  | ||||||
|             #format-muted = ""; |  | ||||||
|             format-muted = "{icon}  --%"; # Spacing achieved using "Thin Space" |  | ||||||
|             format-icons = { |  | ||||||
|               #headphone = ""; |  | ||||||
|               #default = [ "" "" ]; |  | ||||||
|               headphone = ""; |  | ||||||
|               headphone-muted = ""; |  | ||||||
|               default = [ |  | ||||||
|                 "" |  | ||||||
|                 "" |  | ||||||
|                 "" |  | ||||||
|               ]; |  | ||||||
|             }; |  | ||||||
|           }; |  | ||||||
|           battery = { |  | ||||||
|             format = "{icon} {capacity}%"; # Spacing achieved using "Thin Space" |  | ||||||
|             format-charging = " {capacity}%"; # Spacing achieved using "Thin Space" |  | ||||||
|             #format-icons = [ "" "" "" "" "" "" "" "" "" "" "" ]; |  | ||||||
|             format-icons = [ |  | ||||||
|               "" |  | ||||||
|               "" |  | ||||||
|               "" |  | ||||||
|               "" |  | ||||||
|               "" |  | ||||||
|               "" |  | ||||||
|               "" |  | ||||||
|               "" |  | ||||||
|               "" |  | ||||||
|               "" |  | ||||||
|               "" |  | ||||||
|             ]; |  | ||||||
|             interval = 1; |  | ||||||
|           }; |  | ||||||
|           clock = { |  | ||||||
|             #format = " {:%H:%M}"; |  | ||||||
|             #format = "   {:%H:%M}"; # Spacing achieved using "Thin Space" |  | ||||||
|             format = "{:%H:%M}"; |  | ||||||
|           }; |  | ||||||
|           mpris = { |  | ||||||
|             format = "{dynamic}"; |  | ||||||
|             tooltip-format = ""; |  | ||||||
|             interval = 1; |  | ||||||
|           }; |  | ||||||
|           bluetooth = { |  | ||||||
|             tooltip = false; |  | ||||||
|             format = "  {status}"; # Spacing achieved using "Thin Space" |  | ||||||
|             format-connected = "  {device_alias}"; # Spacing achieved using "Thin Space" |  | ||||||
|           }; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|       # TODO: Replace base03 color with named color |  | ||||||
|       style = '' |  | ||||||
|         window#waybar { |  | ||||||
|           color: #${colors.fg}; |  | ||||||
|           background-color: #${colors.bg}; |  | ||||||
|           border-style: none none solid none; |  | ||||||
|           border-width: ${toString theme.layout.borderSize}px; |  | ||||||
|           border-color: #${colors.border-unfocused}; |  | ||||||
|           font-size: 12px; |  | ||||||
|           font-family: "${theme.fonts.monospace.name}"; |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         .modules-right { |  | ||||||
|           margin: 0 8px 0 0; |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         #tags button { |  | ||||||
|           color: #${theme.schemeColors.base03}; |  | ||||||
|           padding: 0 5px 1px 5px; |  | ||||||
|           border-radius: 0; |  | ||||||
|           font-size: 16px; |  | ||||||
|           font-family: "wenquanyi bitmap song"; |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         #tags button.occupied { |  | ||||||
|           color: #${colors.fg}; |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         #tags button.focused { |  | ||||||
|           color: #${colors.accent}; |  | ||||||
|         } |  | ||||||
|       ''; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,89 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   config, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.desktop; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   imports = [ |  | ||||||
|     # Import desktop environment modules |  | ||||||
|     ./bar/waybar.nix |  | ||||||
|     ./lock-screen/waylock.nix |  | ||||||
|     ./window-manager/river.nix |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   options.modules.desktop = { |  | ||||||
|     wayland = mkEnableOption "wayland"; |  | ||||||
|     # TODO: Find a nicer way to do this as this is also executed on startup |  | ||||||
|     reloadScript = mkOption { |  | ||||||
|       type = types.lines; |  | ||||||
|       default = ""; |  | ||||||
|       description = "Shell script to execute after reload/rebuild."; |  | ||||||
|     }; |  | ||||||
|     decorations = mkOption { |  | ||||||
|       type = types.nullOr ( |  | ||||||
|         types.enum [ |  | ||||||
|           "csd" |  | ||||||
|           "ssd" |  | ||||||
|         ] |  | ||||||
|       ); |  | ||||||
|       default = null; |  | ||||||
|       description = "Window decorations to use."; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf config.desktop.enable ( |  | ||||||
|     lib.recursiveUpdate |  | ||||||
|       { |  | ||||||
|         # Ensure desktop related systemd services (xdg) have access to session variables. |  | ||||||
|         systemd.user.sessionVariables = config.home.sessionVariables; |  | ||||||
| 
 |  | ||||||
|         home.packages = optionals cfg.wayland ( |  | ||||||
|           with pkgs; |  | ||||||
|           [ |  | ||||||
|             wl-clipboard |  | ||||||
|             wtype |  | ||||||
|             grim |  | ||||||
|             slurp |  | ||||||
|           ] |  | ||||||
|         ); |  | ||||||
| 
 |  | ||||||
|         home.activation = { |  | ||||||
|           customReloadScript = lib.hm.dag.entryAfter [ "writeBoundary" ] ( |  | ||||||
|             '' |  | ||||||
|               #!${pkgs.bash}/bin/bash |  | ||||||
|             '' |  | ||||||
|             + cfg.reloadScript |  | ||||||
|           ); |  | ||||||
|         }; |  | ||||||
| 
 |  | ||||||
|         # home.file.".initrc" = { |  | ||||||
|         #   enable = true; |  | ||||||
|         #   executable = true; |  | ||||||
|         #   text = |  | ||||||
|         #     '' |  | ||||||
|         #       #!${pkgs.bash}/bin/bash |  | ||||||
| 
 |  | ||||||
|         #     '' |  | ||||||
|         #     + cfg.initScript; |  | ||||||
|         # }; |  | ||||||
|       } |  | ||||||
|       ( |  | ||||||
|         # TODO: Move to dedicated module within desktop or maybe theming? |  | ||||||
|         # if cfg.decorations == null then |  | ||||||
|         #   { } |  | ||||||
|         # else |  | ||||||
|         #   { |  | ||||||
|         #     csd = { }; |  | ||||||
|         #     ssd = { }; |  | ||||||
|         #   } |  | ||||||
|         #   ."${cfg.decorations}" |  | ||||||
|         { } |  | ||||||
|       ) |  | ||||||
|   ); |  | ||||||
| } |  | ||||||
| @ -1,20 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   config, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.waylock; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.waylock = { |  | ||||||
|     enable = mkEnableOption "waylock"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     home.packages = (with pkgs; [ waylock ]); |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,268 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| let |  | ||||||
|   cfg = config.modules.river; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.river.enable = lib.mkEnableOption "river"; |  | ||||||
| 
 |  | ||||||
|   # osConfig = lib.mkIf cfg.enable { |  | ||||||
|   #   programs.river.enable = true; |  | ||||||
|   # }; |  | ||||||
| 
 |  | ||||||
|   config = lib.mkIf cfg.enable { |  | ||||||
|     # Set desktop type to wayland |  | ||||||
|     modules.desktop.wayland = true; |  | ||||||
| 
 |  | ||||||
|     # TODO: Move elsewhere and make keybindings more configurable |  | ||||||
|     modules.rofi.enable = true; |  | ||||||
| 
 |  | ||||||
|     # TODO: Move elsewhere |  | ||||||
|     home.packages = with pkgs; [ |  | ||||||
|       brightnessctl |  | ||||||
|       river-filtile |  | ||||||
|       # owm |  | ||||||
| 
 |  | ||||||
|       udiskie # TODO: Move to USB module |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # Change desktop to execute river |  | ||||||
|     desktop.initScript = '' |  | ||||||
|       ${pkgs.river}/bin/river |  | ||||||
|     ''; |  | ||||||
| 
 |  | ||||||
|     desktop.session.type = "wayland"; |  | ||||||
|     desktop.session.desktop = "river"; |  | ||||||
| 
 |  | ||||||
|     # TODO: Fix this |  | ||||||
|     # modules.desktop.reloadScript = '' |  | ||||||
|     #   ${pkgs.river}/bin/riverctl background-color 0x${config.theming.colors.bg} |  | ||||||
|     # ''; |  | ||||||
| 
 |  | ||||||
|     # Update background after rebuild |  | ||||||
|     # home.activation = { |  | ||||||
|     #   river = lib.hm.dag.entryBetween [ "reloadSystemd" ] [ "installPackages" ] '' |  | ||||||
|     #     # Close waybar |  | ||||||
|     #     PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill waybar |  | ||||||
| 
 |  | ||||||
|     #     # Kill rivertile |  | ||||||
|     #     PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill rivertile |  | ||||||
| 
 |  | ||||||
|     #     # Kill glpaper |  | ||||||
|     #     PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill glpaper |  | ||||||
| 
 |  | ||||||
|     #     # Restart river |  | ||||||
|     #     PATH="${pkgs.river}/bin:${pkgs.systemd}/bin:${pkgs.waybar}/bin:$PATH" $DRY_RUN_CMD ~/.config/river/init |  | ||||||
|     #   ''; |  | ||||||
|     # }; |  | ||||||
| 
 |  | ||||||
|     # River setup |  | ||||||
|     wayland.windowManager.river = { |  | ||||||
|       enable = true; |  | ||||||
|       xwayland.enable = false; |  | ||||||
|       systemd.enable = true; |  | ||||||
|       settings = |  | ||||||
|         let |  | ||||||
|           layout = "filtile"; |  | ||||||
|           layoutOptions = "-outer-padding ${toString config.desktop.theming.layout.windowPadding} -view-padding ${toString config.desktop.theming.layout.windowPadding} -main-ratio 0.5"; |  | ||||||
|           modes = [ |  | ||||||
|             "normal" |  | ||||||
|             "locked" |  | ||||||
|           ]; |  | ||||||
|           tags = [ |  | ||||||
|             1 |  | ||||||
|             2 |  | ||||||
|             3 |  | ||||||
|             4 |  | ||||||
|             5 |  | ||||||
|             6 |  | ||||||
|             7 |  | ||||||
|             8 |  | ||||||
|             9 |  | ||||||
|           ]; |  | ||||||
|           waylockOptions = "-init-color 0x${colors.bg} -input-color 0x${colors.border-focused} -fail-color 0x${colors.bg}"; |  | ||||||
| 
 |  | ||||||
|           colors = config.desktop.theming.colors; |  | ||||||
| 
 |  | ||||||
|           # Quick pow function |  | ||||||
|           pow2 = power: if power != 0 then 2 * (pow2 (power - 1)) else 1; |  | ||||||
| 
 |  | ||||||
|           # Modifiers |  | ||||||
|           main = "Super"; |  | ||||||
|           ssm = "Super+Shift"; |  | ||||||
|           sas = "Super+Alt+Shift"; |  | ||||||
|           sam = "Super+Alt"; |  | ||||||
|           scm = "Super+Control"; |  | ||||||
|           scam = "Super+Control+Alt"; |  | ||||||
|           ssc = "Super+Shift+Control"; |  | ||||||
|         in |  | ||||||
|         { |  | ||||||
|           default-layout = "${layout}"; |  | ||||||
|           set-repeat = "50 300"; |  | ||||||
|           xcursor-theme = "BreezeX-RosePine-Linux 24"; |  | ||||||
|           keyboard-layout = "-options \"caps:escape\" us"; |  | ||||||
| 
 |  | ||||||
|           border-width = toString config.desktop.theming.layout.borderSize; |  | ||||||
|           background-color = "0x${colors.bg}"; |  | ||||||
|           border-color-focused = "0x${colors.fg}"; |  | ||||||
|           border-color-unfocused = "0x${colors.border-unfocused}"; # TODO: Change to use named color; |  | ||||||
|           border-color-urgent = "0x${colors.fg}"; |  | ||||||
| 
 |  | ||||||
|           # TODO: Make a desktop options for DE applications |  | ||||||
|           spawn = [ |  | ||||||
|             "\"${layout} ${layoutOptions}\"" |  | ||||||
|             "waybar" # TODO: Decouple |  | ||||||
|             # TODO: Generic background options |  | ||||||
|             # "\"glpaper eDP-1 ${toString config.modules.glpaper.shader}\"" |  | ||||||
|             "udiskie" |  | ||||||
|             # TODO: Should this be part of the keyring configuration directly? |  | ||||||
|             # "\"gnome-keyring-daemon --replace --components=pkcs11,secrets,ssh\"" |  | ||||||
|             "wpaperd" |  | ||||||
|           ]; |  | ||||||
|           map = ( |  | ||||||
|             lib.attrsets.recursiveUpdate |  | ||||||
|               { |  | ||||||
|                 "-repeat".normal = { |  | ||||||
|                   # Basic utilities |  | ||||||
|                   "${main} Q" = "close"; |  | ||||||
|                   "${ssm} Return" = "spawn foot"; |  | ||||||
| 
 |  | ||||||
|                   # Window focus |  | ||||||
|                   "${main} J" = "focus-view next"; |  | ||||||
|                   "${main} K" = "focus-view previous"; |  | ||||||
| 
 |  | ||||||
|                   # Swap windows |  | ||||||
|                   "${ssm} J" = "swap next"; |  | ||||||
|                   "${ssm} K" = "swap previous"; |  | ||||||
|                   "${main} Return" = "zoom"; |  | ||||||
| 
 |  | ||||||
|                   # Main ratio |  | ||||||
|                   "${main} H" = "send-layout-cmd ${layout} 'main-ratio -0.05'"; |  | ||||||
|                   "${main} L" = "send-layout-cmd ${layout} 'main-ratio +0.05'"; |  | ||||||
| 
 |  | ||||||
|                   # Main count |  | ||||||
|                   "${ssm} H" = "send-layout-cmd ${layout} 'main-count +1'"; |  | ||||||
|                   "${ssm} L" = "send-layout-cmd ${layout} 'main-count -1'"; |  | ||||||
| 
 |  | ||||||
|                   # Move floating windows |  | ||||||
|                   "${sam} H" = "move left 100"; |  | ||||||
|                   "${sam} J" = "move down 100"; |  | ||||||
|                   "${sam} K" = "move up 100"; |  | ||||||
|                   "${sam} L" = "move right 100"; |  | ||||||
| 
 |  | ||||||
|                   # Resize floating windows |  | ||||||
|                   "${sas} H" = "resize horizontal -100"; |  | ||||||
|                   "${sas} J" = "resize vertical 100"; |  | ||||||
|                   "${sas} K" = "resize vertical -100"; |  | ||||||
|                   "${sas} L" = "resize horizontal 100"; |  | ||||||
| 
 |  | ||||||
|                   # Toggle modes |  | ||||||
|                   "${main} Space" = "toggle-float"; |  | ||||||
|                   "${main} F" = "toggle-fullscreen"; |  | ||||||
|                 }; |  | ||||||
|                 normal = |  | ||||||
|                   { |  | ||||||
|                     # Basic utilities |  | ||||||
|                     "${ssm} E" = "exit"; |  | ||||||
|                     "${main} X " = "spawn \"waylock -fork-on-lock ${waylockOptions}\""; |  | ||||||
|                     "${main} P" = "spawn \"rofi -show drun\""; |  | ||||||
|                     "${ssm} P" = "spawn rofi-rbw"; |  | ||||||
|                     "${main} S" = |  | ||||||
|                       "spawn \"grim -g \\\"\\\$(slurp)\\\" ~/Images/Screenshots/\\\$(date +'%s_grim.png')\""; |  | ||||||
| 
 |  | ||||||
|                     # Tags |  | ||||||
|                     "${main} 0" = "set-focused-tags ${toString (pow2 32 - 1)}"; |  | ||||||
|                     "${ssm} 0" = "set-view-tags ${toString (pow2 32 - 1)}"; |  | ||||||
| 
 |  | ||||||
|                     # Orientation |  | ||||||
|                     "${main} Up" = "send-layout-cmd ${layout} \"main-location top\""; |  | ||||||
|                     "${main} Right" = "send-layout-cmd ${layout} \"main-location right\""; |  | ||||||
|                     "${main} Down" = "send-layout-cmd ${layout} \"main-location bottom\""; |  | ||||||
|                     "${main} Left" = "send-layout-cmd ${layout} \"main-location left\""; |  | ||||||
| 
 |  | ||||||
|                     # Snap floating windows |  | ||||||
|                     "${scam} H" = "snap left"; |  | ||||||
|                     "${scam} J" = "snap down"; |  | ||||||
|                     "${scam} K" = "snap up"; |  | ||||||
|                     "${scam} L" = "snap right"; |  | ||||||
|                   } |  | ||||||
|                   // builtins.listToAttrs ( |  | ||||||
|                     builtins.concatLists ( |  | ||||||
|                       map (tag: [ |  | ||||||
|                         { |  | ||||||
|                           name = "${main} ${toString tag}"; |  | ||||||
|                           value = "set-focused-tags ${toString (pow2 (tag - 1))}"; |  | ||||||
|                         } |  | ||||||
|                         { |  | ||||||
|                           name = "${ssm} ${toString tag}"; |  | ||||||
|                           value = "set-view-tags ${toString (pow2 (tag - 1))}"; |  | ||||||
|                         } |  | ||||||
|                         { |  | ||||||
|                           name = "${scm} ${toString tag}"; |  | ||||||
|                           value = "toggle-focused-tags ${toString (pow2 (tag - 1))}"; |  | ||||||
|                         } |  | ||||||
|                         { |  | ||||||
|                           name = "${ssc} ${toString tag}"; |  | ||||||
|                           value = "toggle-view-tags ${toString (pow2 (tag - 1))}"; |  | ||||||
|                         } |  | ||||||
|                       ]) tags |  | ||||||
|                     ) |  | ||||||
|                   ); |  | ||||||
|               } |  | ||||||
|               ( |  | ||||||
|                 builtins.listToAttrs ( |  | ||||||
|                   map (mode: { |  | ||||||
|                     name = "${mode}"; |  | ||||||
|                     value = { |  | ||||||
|                       # Control volume |  | ||||||
|                       "None XF86AudioRaiseVolume" = "spawn \"pulsemixer --change-volume +5\""; |  | ||||||
|                       "None XF86AudioLowerVolume" = "spawn \"pulsemixer --change-volume -5\""; |  | ||||||
|                       "None XF86AudioMute" = "spawn \"pulsemixer --toggle-mute\""; |  | ||||||
| 
 |  | ||||||
|                       # Control brightness |  | ||||||
|                       "None XF86MonBrightnessUp" = "spawn \"brightnessctl set +5%\""; |  | ||||||
|                       "None XF86MonBrightnessDown" = "spawn \"brightnessctl set 5%-\""; |  | ||||||
| 
 |  | ||||||
|                       # Control music playback |  | ||||||
|                       "None XF86Messenger" = "spawn \"playerctl previous\""; |  | ||||||
|                       "None XF86Go" = "spawn \"playerctl play-pause\""; |  | ||||||
|                       "None Cancel" = "spawn \"playerctl next\""; |  | ||||||
|                     }; |  | ||||||
|                   }) modes |  | ||||||
|                 ) |  | ||||||
|               ) |  | ||||||
|           ); |  | ||||||
|           map-pointer = { |  | ||||||
|             normal = { |  | ||||||
|               "${main} BTN_LEFT" = "move-view"; |  | ||||||
|               "${main} BTN_RIGHT" = "resize-view"; |  | ||||||
|               "${main} BTN_MIDDLE" = "toggle-float"; |  | ||||||
|             }; |  | ||||||
|           }; |  | ||||||
|           input = { |  | ||||||
|             "'*'" = { |  | ||||||
|               accel-profile = "adaptive"; |  | ||||||
|               pointer-accel = "0.5"; |  | ||||||
|               scroll-factor = "0.8"; |  | ||||||
|             }; |  | ||||||
|             "'*Synaptics*'" = { |  | ||||||
|               natural-scroll = "enabled"; |  | ||||||
|             }; |  | ||||||
|           }; |  | ||||||
|           rule-add = { |  | ||||||
|             "-app-id" = { |  | ||||||
|               "'bar'" = "csd"; |  | ||||||
|               "'*'" = "ssd"; |  | ||||||
|               "'wpa_gui'" = "float"; |  | ||||||
|               "'Xpra'" = "float"; |  | ||||||
|             }; |  | ||||||
|           }; |  | ||||||
|         }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,127 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   # Desktop configuration module |  | ||||||
|   desktopConfigurationModule = types.submodule { |  | ||||||
|     options = { |  | ||||||
|       name = mkOption { |  | ||||||
|         type = types.str; |  | ||||||
|         description = "Desktop environment name."; |  | ||||||
|       }; |  | ||||||
|       type = mkOption { |  | ||||||
|         type = types.enum [ |  | ||||||
|           "custom" |  | ||||||
|           "gnome" |  | ||||||
|         ]; |  | ||||||
|         description = "Desktop environment type."; |  | ||||||
|       }; |  | ||||||
|       config = mkOption { |  | ||||||
|         type = types.attrs; |  | ||||||
|         default = { }; |  | ||||||
|         description = "Desktop environment configuration"; |  | ||||||
|       }; |  | ||||||
|       extraConfig = mkOption { |  | ||||||
|         type = types.attrs; |  | ||||||
|         default = { }; |  | ||||||
|         description = "Extra configuration for the configured desktop environment"; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   customBuilder = |  | ||||||
|     config: |  | ||||||
|     recursiveUpdate { |  | ||||||
|       desktop.name = config.name; |  | ||||||
|     } config.extraConfig; |  | ||||||
| 
 |  | ||||||
|   # Environment builders |  | ||||||
|   environmentBuilders = { |  | ||||||
|     custom = customBuilder; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   cfg = config.desktop; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   imports = [ |  | ||||||
|     ./custom/default.nix |  | ||||||
|     ./theming/default.nix |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   options.desktop = { |  | ||||||
|     enable = mkEnableOption "desktop"; |  | ||||||
|     name = mkOption { |  | ||||||
|       type = types.str; |  | ||||||
|       default = "Shell"; |  | ||||||
|       description = "Desktop configuration name."; |  | ||||||
|     }; |  | ||||||
|     initScript = mkOption { |  | ||||||
|       type = types.lines; |  | ||||||
|       default = '' |  | ||||||
|         ${pkgs.ncurses}/bin/clear |  | ||||||
|         ${pkgs.bashInteractive}/bin/bash |  | ||||||
|       ''; |  | ||||||
|       description = "Bash script to execute after logging in."; |  | ||||||
|     }; |  | ||||||
|     session = { |  | ||||||
|       type = mkOption { |  | ||||||
|         type = types.enum [ |  | ||||||
|           "wayland" |  | ||||||
|           "x11" |  | ||||||
|           "tty" |  | ||||||
|         ]; |  | ||||||
|         default = "tty"; |  | ||||||
|         description = "Session type."; |  | ||||||
|       }; |  | ||||||
|       desktop = mkOption { |  | ||||||
|         type = types.str; |  | ||||||
|         default = "tty"; |  | ||||||
|         description = "Desktop environment name."; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|     environments = mkOption { |  | ||||||
|       type = types.attrsOf desktopConfigurationModule; |  | ||||||
|       default = { }; |  | ||||||
|       description = "Desktop environments. Every environment will be built as a specialization."; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     specialisation = mapAttrs (name: value: { |  | ||||||
|       configuration = (environmentBuilders."${value.type}" value); |  | ||||||
|     }) cfg.environments; |  | ||||||
| 
 |  | ||||||
|     # Create session files |  | ||||||
|     home.extraBuilderCommands = '' |  | ||||||
|       mkdir $out/session |  | ||||||
|       echo "${cfg.name}" > $out/session/name |  | ||||||
|       ln -s ${ |  | ||||||
|         pkgs.writeTextFile { |  | ||||||
|           name = "desktop-init"; |  | ||||||
|           text = |  | ||||||
|             '' |  | ||||||
|               #!${pkgs.bash}/bin/bash |  | ||||||
| 
 |  | ||||||
|             '' |  | ||||||
|             + cfg.initScript; |  | ||||||
|           executable = true; |  | ||||||
|         } |  | ||||||
|       } $out/session/init |  | ||||||
|       ln -s ${ |  | ||||||
|         pkgs.writeTextFile { |  | ||||||
|           name = "session-env"; |  | ||||||
|           text = '' |  | ||||||
|             XDG_SESSION_TYPE=${cfg.session.type} |  | ||||||
|             XDG_CURRENT_DESKTOP=${cfg.session.desktop} |  | ||||||
|             XDG_SESSION_DESKTOP=${cfg.session.desktop} |  | ||||||
|           ''; |  | ||||||
|         } |  | ||||||
|       } $out/session/env |  | ||||||
|     ''; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { |  | ||||||
|   waylock = { |  | ||||||
|     security.pam.services.waylock = { }; |  | ||||||
|   }; |  | ||||||
|   river = { |  | ||||||
|     programs.river.enable = true; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,133 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   lib, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.desktop.theming.background; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.desktop.theming.background = { |  | ||||||
|     image = { |  | ||||||
|       url = mkOption { |  | ||||||
|         type = types.str; |  | ||||||
|         default = "https://raw.githubusercontent.com/dharmx/walls/refs/heads/main/digital/a_drawing_of_a_spider_on_a_white_surface.png"; |  | ||||||
|         description = "URL to the background image."; |  | ||||||
|       }; |  | ||||||
|       hash = mkOption { |  | ||||||
|         type = types.str; |  | ||||||
|         default = "sha256-eCEjM7R9yeHNhZZtvHjrgkfwT25JA7FeMoVwnQ887CQ="; |  | ||||||
|         description = "SHA256 hash of the background image."; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|     themed = mkEnableOption "themed background"; |  | ||||||
|     inverted = mkEnableOption "invert background"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = |  | ||||||
|     with pkgs; |  | ||||||
|     let |  | ||||||
|       src = pkgs.fetchurl { |  | ||||||
|         url = cfg.image.url; |  | ||||||
|         hash = cfg.image.hash; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       theme = writeTextFile { |  | ||||||
|         name = "gowall-theme"; |  | ||||||
|         text = builtins.toJSON { |  | ||||||
|           name = "NixOS"; |  | ||||||
|           colors = |  | ||||||
|             let |  | ||||||
|               colors = config.desktop.theming.schemeColors; |  | ||||||
|             in |  | ||||||
|             [ |  | ||||||
|               "#${colors.base00}" |  | ||||||
|               "#${colors.base01}" |  | ||||||
|               "#${colors.base02}" |  | ||||||
|               "#${colors.base03}" |  | ||||||
|               "#${colors.base04}" |  | ||||||
|               "#${colors.base05}" |  | ||||||
|               "#${colors.base06}" |  | ||||||
|               "#${colors.base07}" |  | ||||||
|               "#${colors.base08}" |  | ||||||
|               "#${colors.base09}" |  | ||||||
|               "#${colors.base0A}" |  | ||||||
|               "#${colors.base0B}" |  | ||||||
|               "#${colors.base0C}" |  | ||||||
|               "#${colors.base0D}" |  | ||||||
|               "#${colors.base0E}" |  | ||||||
|               "#${colors.base0F}" |  | ||||||
|             ]; |  | ||||||
|         }; |  | ||||||
|         executable = true; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       fileExtension = |  | ||||||
|         name: |  | ||||||
|         let |  | ||||||
|           parts = splitString "." name; |  | ||||||
|         in |  | ||||||
|         if length parts > 1 then lists.last parts else ""; |  | ||||||
| 
 |  | ||||||
|       fileName = |  | ||||||
|         name: |  | ||||||
|         let |  | ||||||
|           parts = splitString "/" name; |  | ||||||
|         in |  | ||||||
|         if length parts > 1 then lists.last parts else name; |  | ||||||
| 
 |  | ||||||
|       image = fileName cfg.image.url; |  | ||||||
| 
 |  | ||||||
|       background-themed = stdenv.mkDerivation { |  | ||||||
|         name = "background-themed-1.0.0"; |  | ||||||
|         src = src; |  | ||||||
| 
 |  | ||||||
|         buildInputs = [ |  | ||||||
|           gowall |  | ||||||
|           imagemagick |  | ||||||
|           (writeShellScriptBin "xdg-open" "") |  | ||||||
|           tree |  | ||||||
|         ]; |  | ||||||
| 
 |  | ||||||
|         unpackPhase = '' |  | ||||||
|           cp ${src} ./${image} |  | ||||||
|           chmod u+w ./${image} |  | ||||||
|         ''; |  | ||||||
| 
 |  | ||||||
|         buildPhase = '' |  | ||||||
|           ${optionalString cfg.inverted '' |  | ||||||
|             convert ./${image} -channel RGB -negate ./${image} |  | ||||||
|           ''} |  | ||||||
|           ${optionalString cfg.themed '' |  | ||||||
|             cp ${theme} ./theme.json |  | ||||||
| 
 |  | ||||||
|             export HOME=$PWD |  | ||||||
| 
 |  | ||||||
|             gowall convert ./${image} --output themed -t ./theme.json |  | ||||||
|             tree |  | ||||||
|             mv ./themed/*.* ./ |  | ||||||
|           ''} |  | ||||||
|           mv ./${image} themed.${fileExtension image} |  | ||||||
|           ${optionalString (fileExtension image != "png") '' |  | ||||||
|             mogrify -format png themed.* |  | ||||||
|           ''} |  | ||||||
|         ''; |  | ||||||
| 
 |  | ||||||
|         installPhase = '' |  | ||||||
|           install -Dm644 -t $out themed.png |  | ||||||
|         ''; |  | ||||||
|       }; |  | ||||||
|     in |  | ||||||
|     { |  | ||||||
|       services.wpaperd = { |  | ||||||
|         enable = true; |  | ||||||
|         settings.default = { |  | ||||||
|           path = "${background-themed}/"; |  | ||||||
|           mode = "center"; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| } |  | ||||||
| @ -1,159 +0,0 @@ | |||||||
| { |  | ||||||
|   pkgs, |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.desktop.theming; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   imports = [ |  | ||||||
|     # Import all themes |  | ||||||
|     ./themes/catppuccin.nix |  | ||||||
|     ./themes/gruvbox.nix |  | ||||||
|     ./themes/oxocarbon.nix |  | ||||||
|     ./themes/papercolor.nix |  | ||||||
|     ./themes/sakura.nix |  | ||||||
|     ./themes/nord.nix |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   options.desktop.theming = |  | ||||||
|     let |  | ||||||
|       colors = config.desktop.theming.schemeColors; |  | ||||||
|     in |  | ||||||
|     { |  | ||||||
|       darkMode = mkOption { |  | ||||||
|         type = types.bool; |  | ||||||
|         default = false; |  | ||||||
|         example = true; |  | ||||||
|         description = "Whether the app should use dark mode."; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       colorScheme = mkOption { |  | ||||||
|         type = types.nullOr types.str; |  | ||||||
|         default = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; |  | ||||||
|         description = "Base 16 color scheme to use for styling. See stylix documentation for more information."; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       schemeColors = mkOption { |  | ||||||
|         type = types.attrsOf types.anything; |  | ||||||
|         default = config.lib.stylix.colors; |  | ||||||
|         description = "Generated colors from scheme"; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       colors = { |  | ||||||
|         bg = mkOption { |  | ||||||
|           type = types.str; |  | ||||||
|           default = colors.base00; |  | ||||||
|         }; |  | ||||||
|         fg = mkOption { |  | ||||||
|           type = types.str; |  | ||||||
|           default = colors.base05; |  | ||||||
|         }; |  | ||||||
|         bg-status = mkOption { |  | ||||||
|           type = types.str; |  | ||||||
|           default = colors.base01; |  | ||||||
|         }; |  | ||||||
|         fg-status = mkOption { |  | ||||||
|           type = types.str; |  | ||||||
|           default = colors.base04; |  | ||||||
|         }; |  | ||||||
|         bg-selection = mkOption { |  | ||||||
|           type = types.str; |  | ||||||
|           default = colors.base02; |  | ||||||
|         }; |  | ||||||
|         bg-highlight = mkOption { |  | ||||||
|           type = types.str; |  | ||||||
|           default = colors.base03; |  | ||||||
|         }; |  | ||||||
|         fg-search = mkOption { |  | ||||||
|           type = types.str; |  | ||||||
|           default = colors.base0A; |  | ||||||
|         }; |  | ||||||
|         accent = mkOption { |  | ||||||
|           type = types.str; |  | ||||||
|           default = colors.base0E; |  | ||||||
|         }; |  | ||||||
|         border-focused = mkOption { |  | ||||||
|           type = types.str; |  | ||||||
|           default = cfg.colors.fg; |  | ||||||
|         }; |  | ||||||
|         border-unfocused = mkOption { |  | ||||||
|           type = types.str; |  | ||||||
|           default = cfg.colors.bg-selection; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       colorsCSS = mkOption { |  | ||||||
|         type = types.lines; |  | ||||||
|         default = |  | ||||||
|           ":root {\n" |  | ||||||
|           + concatStrings ( |  | ||||||
|             map (color: "  --nix-color-${color.name}: #${color.value};\n") (attrsToList cfg.colors) |  | ||||||
|           ) |  | ||||||
|           + "}\n\n"; |  | ||||||
|         description = "Colors as css variables"; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|   config = { |  | ||||||
|     # Configure gnome theme |  | ||||||
|     dconf.settings = mkIf config.desktop.enable { |  | ||||||
|       "org/gnome/desktop/interface" = { |  | ||||||
|         color-scheme = if cfg.darkMode then "prefer-dark" else "prefer-light"; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Configure qt theme |  | ||||||
|     qt = mkIf config.desktop.enable { |  | ||||||
|       enable = true; |  | ||||||
|       platformTheme.name = "gtk"; |  | ||||||
|       style = { |  | ||||||
|         name = if cfg.darkMode then "adwaita-dark" else "adwaita-light"; |  | ||||||
|         package = pkgs.adwaita-qt; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Configure gtk theme |  | ||||||
|     gtk = mkIf config.desktop.enable { |  | ||||||
|       enable = true; |  | ||||||
|       theme = { |  | ||||||
|         name = if cfg.darkMode then "Adwaita-dark" else "Adwaita-light"; |  | ||||||
|         package = pkgs.gnome-themes-extra; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # TODO: This should just straight up not be here |  | ||||||
|     programs.direnv = { |  | ||||||
|       enable = true; |  | ||||||
|       nix-direnv.enable = true; |  | ||||||
|     }; |  | ||||||
|     modules.git.ignores = [ |  | ||||||
|       ".direnv" |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # Enable stylix |  | ||||||
|     # TODO: Move to own module |  | ||||||
|     stylix = { |  | ||||||
|       enable = true; |  | ||||||
|       autoEnable = false; |  | ||||||
| 
 |  | ||||||
|       targets = { |  | ||||||
|         foot.enable = true; |  | ||||||
|         nixvim.enable = true; |  | ||||||
|         qutebrowser.enable = true; |  | ||||||
|         vscode = { |  | ||||||
|           enable = true; |  | ||||||
|           profileNames = [ "default" ]; |  | ||||||
|         }; |  | ||||||
|         zathura.enable = true; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       base16Scheme = cfg.colorScheme; |  | ||||||
|       polarity = if cfg.darkMode then "dark" else "light"; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,241 +0,0 @@ | |||||||
| { |  | ||||||
|   pkgs, |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.desktop.theming; |  | ||||||
| 
 |  | ||||||
|   # Font module type |  | ||||||
|   fontModule = types.submodule { |  | ||||||
|     options = { |  | ||||||
|       name = mkOption { |  | ||||||
|         type = types.str; |  | ||||||
|         description = "Font family name."; |  | ||||||
|       }; |  | ||||||
|       package = mkOption { |  | ||||||
|         type = types.anything; |  | ||||||
|         description = "Font package"; |  | ||||||
|       }; |  | ||||||
|       recommendedSize = mkOption { |  | ||||||
|         type = types.nullOr types.int; |  | ||||||
|         default = null; |  | ||||||
|         description = "Recommended size for displaying this font."; |  | ||||||
|       }; |  | ||||||
|       fallbackFonts = mkOption { |  | ||||||
|         type = types.listOf types.str; |  | ||||||
|         default = [ ]; |  | ||||||
|         description = "Fallback fonts for specified font."; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   fontModules = [ |  | ||||||
|     # Import all fonts |  | ||||||
|     ./fonts/adwaita-mono.nix |  | ||||||
|     ./fonts/adwaita-sans.nix |  | ||||||
|     ./fonts/cozette-vector.nix |  | ||||||
|     ./fonts/cozette.nix |  | ||||||
|     ./fonts/dejavu-sans.nix |  | ||||||
|     ./fonts/dejavu-serif.nix |  | ||||||
|     ./fonts/dina.nix |  | ||||||
|     ./fonts/fira-code.nix |  | ||||||
|     ./fonts/nerd-fonts-symbols.nix |  | ||||||
|     ./fonts/noto-color-emoji.nix |  | ||||||
|     ./fonts/wqy-bitmapsong.nix |  | ||||||
|     ./fonts/wqy-microhei-mono.nix |  | ||||||
|     ./fonts/wqy-microhei.nix |  | ||||||
|     ./fonts/wqy-zenhei-mono.nix |  | ||||||
|     ./fonts/wqy-zenhei-sharp.nix |  | ||||||
|     ./fonts/wqy-zenhei.nix |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   # Gather enabled fonts. |  | ||||||
|   enabledFonts = [ |  | ||||||
|     cfg.fonts.serif.name |  | ||||||
|     cfg.fonts.sansSerif.name |  | ||||||
|     cfg.fonts.monospace.name |  | ||||||
|     cfg.fonts.emoji.name |  | ||||||
|   ] ++ map (font: font.name) cfg.fonts.extraFonts; |  | ||||||
| 
 |  | ||||||
|   # Flatten dependencies of fonts |  | ||||||
|   fontPackages = |  | ||||||
|     converge |  | ||||||
|       ( |  | ||||||
|         fonts: |  | ||||||
|         listToAttrs ( |  | ||||||
|           map |  | ||||||
|             (font: { |  | ||||||
|               name = font; |  | ||||||
|               value = true; |  | ||||||
|             }) |  | ||||||
|             ( |  | ||||||
|               flatten (map (font: [ font.name ] ++ cfg.fonts.pkgs.${font.name}.fallbackFonts) (attrsToList fonts)) |  | ||||||
|             ) |  | ||||||
|         ) |  | ||||||
|       ) |  | ||||||
|       ( |  | ||||||
|         listToAttrs ( |  | ||||||
|           map (font: { |  | ||||||
|             name = font; |  | ||||||
|             value = true; |  | ||||||
|           }) enabledFonts |  | ||||||
|         ) |  | ||||||
|       ); |  | ||||||
| 
 |  | ||||||
|   # Convert set of fonts to list of packages |  | ||||||
|   fontNameList = map (font: font.name) (attrsToList fontPackages); |  | ||||||
|   fontPackageList = map (font: cfg.fonts.pkgs.${font}.package) fontNameList; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   imports = [ |  | ||||||
|     ./background.nix |  | ||||||
|     ./colors.nix |  | ||||||
|   ]; |  | ||||||
| 
 |  | ||||||
|   options.desktop.theming = { |  | ||||||
|     layout = { |  | ||||||
|       borderRadius = mkOption { |  | ||||||
|         type = types.int; |  | ||||||
|         default = 0; |  | ||||||
|         description = "Border radius of windows."; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       borderSize = mkOption { |  | ||||||
|         type = types.int; |  | ||||||
|         default = 1; |  | ||||||
|         description = "Size of borders used throughout UI."; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       windowPadding = mkOption { |  | ||||||
|         type = types.int; |  | ||||||
|         default = 2; |  | ||||||
|         description = "Margin of each window, actual space between windows will be twice this number."; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     fonts = { |  | ||||||
|       pkgs = mkOption { |  | ||||||
|         type = types.attrsOf fontModule; |  | ||||||
|         default = builtins.listToAttrs ( |  | ||||||
|           map (module: { |  | ||||||
|             name = module.name; |  | ||||||
|             value = module; |  | ||||||
|           }) (map (module: (import module) { inherit lib config pkgs; }) fontModules) |  | ||||||
|         ); |  | ||||||
|         description = "All available font modules."; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       installed = mkOption { |  | ||||||
|         type = types.listOf types.str; |  | ||||||
|         default = fontNameList; |  | ||||||
|         description = "List of installed fonts."; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       serif = mkOption { |  | ||||||
|         type = fontModule; |  | ||||||
|         description = "Default serif font"; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       sansSerif = mkOption { |  | ||||||
|         type = fontModule; |  | ||||||
|         description = "Default sansSerif font."; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       monospace = mkOption { |  | ||||||
|         type = fontModule; |  | ||||||
|         description = "Default monospace font."; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       emoji = mkOption { |  | ||||||
|         type = fontModule; |  | ||||||
|         description = "Default emoji font."; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       interface = mkOption { |  | ||||||
|         type = fontModule; |  | ||||||
|         description = "Default emoji font."; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       extraFonts = mkOption { |  | ||||||
|         type = types.listOf fontModule; |  | ||||||
|         default = [ ]; |  | ||||||
|         description = "Additional fonts to install."; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf config.desktop.enable { |  | ||||||
|     # Enable fontconfig |  | ||||||
|     modules.fontconfig.enable = true; |  | ||||||
| 
 |  | ||||||
|     # Install configured fonts |  | ||||||
|     home.packages = fontPackageList; |  | ||||||
| 
 |  | ||||||
|     # Configure gtk theme |  | ||||||
|     gtk = |  | ||||||
|       let |  | ||||||
|         disableCSD = '' |  | ||||||
|           headerbar.default-decoration { |  | ||||||
|             margin-bottom: 50px; |  | ||||||
|             margin-top: -100px; |  | ||||||
|           } |  | ||||||
|           window.csd, |  | ||||||
|           window.csd decoration { |  | ||||||
|             box-shadow: none; |  | ||||||
|           } |  | ||||||
|         ''; |  | ||||||
|       in |  | ||||||
|       { |  | ||||||
|         enable = true; |  | ||||||
|         # TODO: Toggles |  | ||||||
|         gtk3.extraCss = mkIf config.modules.river.enable disableCSD; |  | ||||||
|         gtk4.extraCss = mkIf config.modules.river.enable disableCSD; |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|     # TODO: Make cursors configurable using modules. |  | ||||||
|     home.pointerCursor = { |  | ||||||
|       gtk.enable = true; |  | ||||||
|       name = lib.mkForce "BreezeX-RosePine-Linux"; |  | ||||||
|       package = lib.mkForce pkgs.rose-pine-cursor; |  | ||||||
|       size = lib.mkForce 24; |  | ||||||
|       x11 = { |  | ||||||
|         defaultCursor = lib.mkForce "BreezeX-RosePine-Linux"; |  | ||||||
|         enable = true; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Enable stylix |  | ||||||
|     # TODO: Move to own module |  | ||||||
|     stylix = { |  | ||||||
|       fonts = { |  | ||||||
|         serif = getAttrs [ |  | ||||||
|           "name" |  | ||||||
|           "package" |  | ||||||
|         ] cfg.fonts.serif; |  | ||||||
|         sansSerif = getAttrs [ |  | ||||||
|           "name" |  | ||||||
|           "package" |  | ||||||
|         ] cfg.fonts.sansSerif; |  | ||||||
|         monospace = getAttrs [ |  | ||||||
|           "name" |  | ||||||
|           "package" |  | ||||||
|         ] cfg.fonts.monospace; |  | ||||||
|         emoji = getAttrs [ |  | ||||||
|           "name" |  | ||||||
|           "package" |  | ||||||
|         ] cfg.fonts.emoji; |  | ||||||
| 
 |  | ||||||
|         sizes = { |  | ||||||
|           applications = mkDefault cfg.fonts.serif.recommendedSize; |  | ||||||
|           desktop = mkDefault cfg.fonts.monospace.recommendedSize; # TODO: See below |  | ||||||
|           popups = mkDefault cfg.fonts.monospace.recommendedSize; # TODO: Add dedicated UI font |  | ||||||
|           terminal = mkDefault cfg.fonts.monospace.recommendedSize; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "Adwaita Mono"; |  | ||||||
|   package = pkgs.adwaita-fonts; |  | ||||||
|   recommendedSize = 12; |  | ||||||
|   fallbackFonts = [ ]; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "Adwaita Sans"; |  | ||||||
|   package = pkgs.adwaita-fonts; |  | ||||||
|   recommendedSize = 12; |  | ||||||
|   fallbackFonts = [ ]; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "Cozette Vector"; |  | ||||||
|   package = pkgs.cozette; |  | ||||||
|   recommendedSize = 9; |  | ||||||
|   fallbackFonts = [ ]; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "Cozette"; |  | ||||||
|   package = pkgs.cozette; |  | ||||||
|   recommendedSize = 9; |  | ||||||
|   fallbackFonts = [ "Cozette Vector" ]; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "DejaVu Sans"; |  | ||||||
|   package = pkgs.dejavu_fonts; |  | ||||||
|   recommendedSize = 12; |  | ||||||
|   fallbackFonts = [ ]; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "DejaVu Serif"; |  | ||||||
|   package = pkgs.dejavu_fonts; |  | ||||||
|   recommendedSize = 12; |  | ||||||
|   fallbackFonts = [ ]; |  | ||||||
| } |  | ||||||
| @ -1,12 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "Dina"; |  | ||||||
|   package = pkgs.dina-font; |  | ||||||
|   recommendedSize = 9; |  | ||||||
|   fallbackFonts = [ |  | ||||||
|     "Cozette" |  | ||||||
|     "wenquanyi bitmap song" |  | ||||||
|     "Symbols Nerd Font Mono" |  | ||||||
|   ]; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "Fira Code"; |  | ||||||
|   package = pkgs.fira-code; |  | ||||||
|   recommendedSize = 12; |  | ||||||
|   fallbackFonts = [ "Symbols Nerd Font Mono" ]; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "Symbols Nerd Font Mono"; |  | ||||||
|   package = pkgs.nerd-fonts.symbols-only; |  | ||||||
|   recommendedSize = 12; |  | ||||||
|   fallbackFonts = [ ]; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "Noto Color Emoji"; |  | ||||||
|   package = pkgs.noto-fonts-color-emoji; |  | ||||||
|   recommendedSize = 12; |  | ||||||
|   fallbackFonts = [ ]; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "wenquanyi bitmap song"; |  | ||||||
|   package = pkgs.wqy-bitmapsong; |  | ||||||
|   recommendedSize = 12; |  | ||||||
|   fallbackFonts = [ ]; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "WenQuanYi Micro Hei Mono"; |  | ||||||
|   package = pkgs.wqy-microhei; |  | ||||||
|   recommendedSize = 12; |  | ||||||
|   fallbackFonts = [ ]; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "WenQuanYi Micro Hei"; |  | ||||||
|   package = pkgs.wqy-microhei; |  | ||||||
|   recommendedSize = 12; |  | ||||||
|   fallbackFonts = [ ]; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "WenQuanYi Zen Hei Mono"; |  | ||||||
|   package = pkgs.wqy-zenhei; |  | ||||||
|   recommendedSize = 12; |  | ||||||
|   fallbackFonts = [ ]; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "WenQuanYi Zen Hei Sharp"; |  | ||||||
|   package = pkgs.wqy-zenhei; |  | ||||||
|   recommendedSize = 12; |  | ||||||
|   fallbackFonts = [ ]; |  | ||||||
| } |  | ||||||
| @ -1,8 +0,0 @@ | |||||||
| { pkgs, ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   name = "WenQuanYi Zen Hei"; |  | ||||||
|   package = pkgs.wqy-zenhei; |  | ||||||
|   recommendedSize = 12; |  | ||||||
|   fallbackFonts = [ ]; |  | ||||||
| } |  | ||||||
| @ -1,33 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.desktop.theming.themes.catppuccin; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options = { |  | ||||||
|     desktop.theming.themes.catppuccin = { |  | ||||||
|       enable = mkEnableOption "catppuccin"; |  | ||||||
|       flavor = mkOption { |  | ||||||
|         type = types.enum [ |  | ||||||
|           "latte" |  | ||||||
|           "frappe" |  | ||||||
|           "macchiato" |  | ||||||
|           "mocha" |  | ||||||
|         ]; |  | ||||||
|         default = "mocha"; |  | ||||||
|         description = "The flavor of catppuccin theme."; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config.desktop.theming = mkIf cfg.enable { |  | ||||||
|     darkMode = (cfg.flavor != "latte"); |  | ||||||
|     colorScheme = "${pkgs.base16-schemes}/share/themes/catppuccin-${cfg.flavor}.yaml"; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,34 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.desktop.theming.themes.gruvbox; |  | ||||||
|   mode = if cfg.darkMode then "dark" else "light"; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options = { |  | ||||||
|     desktop.theming.themes.gruvbox = { |  | ||||||
|       enable = mkEnableOption "gruvbox-hard"; |  | ||||||
|       darkMode = mkEnableOption "dark mode"; |  | ||||||
|       contrast = mkOption { |  | ||||||
|         type = types.enum [ |  | ||||||
|           "hard" |  | ||||||
|           "medium" |  | ||||||
|           "soft" |  | ||||||
|         ]; |  | ||||||
|         default = "hard"; |  | ||||||
|         description = "The contrast level of the theme."; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config.desktop.theming = mkIf cfg.enable { |  | ||||||
|     darkMode = cfg.darkMode; |  | ||||||
|     colorScheme = "${pkgs.base16-schemes}/share/themes/gruvbox-${mode}-${cfg.contrast}.yaml"; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,25 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.desktop.theming.themes.nord; |  | ||||||
|   mode = if cfg.darkMode then "" else "-light"; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options = { |  | ||||||
|     desktop.theming.themes.nord = { |  | ||||||
|       enable = mkEnableOption "nord"; |  | ||||||
|       darkMode = mkEnableOption "dark mode"; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config.desktop.theming = mkIf cfg.enable { |  | ||||||
|     darkMode = cfg.darkMode; |  | ||||||
|     colorScheme = "${pkgs.base16-schemes}/share/themes/nord${mode}.yaml"; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,25 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.desktop.theming.themes.oxocarbon; |  | ||||||
|   mode = if cfg.darkMode then "dark" else "light"; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options = { |  | ||||||
|     desktop.theming.themes.oxocarbon = { |  | ||||||
|       enable = mkEnableOption "oxocarbon"; |  | ||||||
|       darkMode = mkEnableOption "dark mode"; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config.desktop.theming = mkIf cfg.enable { |  | ||||||
|     darkMode = cfg.darkMode; |  | ||||||
|     colorScheme = "${pkgs.base16-schemes}/share/themes/oxocarbon-${mode}.yaml"; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,25 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.desktop.theming.themes.papercolor; |  | ||||||
|   mode = if cfg.darkMode then "dark" else "light"; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options = { |  | ||||||
|     desktop.theming.themes.papercolor = { |  | ||||||
|       enable = mkEnableOption "papercolor"; |  | ||||||
|       darkMode = mkEnableOption "dark mode"; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config.desktop.theming = mkIf cfg.enable { |  | ||||||
|     darkMode = cfg.darkMode; |  | ||||||
|     colorScheme = "${pkgs.base16-schemes}/share/themes/papercolor-${mode}.yaml"; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,23 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.desktop.theming.themes.sakura; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options = { |  | ||||||
|     desktop.theming.themes.sakura = { |  | ||||||
|       enable = mkEnableOption "sakura"; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config.desktop.theming = mkIf cfg.enable { |  | ||||||
|     darkMode = false; |  | ||||||
|     colorScheme = "${pkgs.base16-schemes}/share/themes/sakura.yaml"; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,19 +0,0 @@ | |||||||
| { ... }: |  | ||||||
| 
 |  | ||||||
| { |  | ||||||
|   imports = [ |  | ||||||
|     ./ide/mathematica.nix |  | ||||||
|     ./ide/matlab.nix |  | ||||||
|     # TODO: Move languages to make clear it is just IDE configuration |  | ||||||
|     # Languages should be installed with devShells, however the IDE must be configured globally |  | ||||||
|     ./language/cpp.nix |  | ||||||
|     ./language/haskell.nix |  | ||||||
|     ./language/js.nix |  | ||||||
|     ./language/jupyter.nix |  | ||||||
|     ./language/nix.nix |  | ||||||
|     ./language/python.nix |  | ||||||
|     ./language/rust.nix |  | ||||||
|     ./language/tex.nix |  | ||||||
|     ./utility/docker.nix |  | ||||||
|   ]; |  | ||||||
| } |  | ||||||
| @ -1,31 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.mathematica; |  | ||||||
| 
 |  | ||||||
|   my-mathematica = pkgs.mathematica.override { |  | ||||||
|     # TODO: Just use a generic name for the installer? |  | ||||||
|     # source = ./Wolfram_14.2.1_LIN_Bndl.sh; |  | ||||||
|   }; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.mathematica = { |  | ||||||
|     enable = mkEnableOption "mathematica"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     modules.unfree.allowedPackages = [ |  | ||||||
|       "mathematica" |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     home.packages = [ |  | ||||||
|       my-mathematica |  | ||||||
|     ]; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,26 +0,0 @@ | |||||||
| { |  | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.matlab; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.matlab = { |  | ||||||
|     enable = mkEnableOption "matlab"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     home.packages = with pkgs; [ |  | ||||||
|       matlab |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     home.sessionVariables = { |  | ||||||
|       _JAVA_AWT_WM_NONREPARENTING = "1"; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,55 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.cpp; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.cpp = { |  | ||||||
|     enable = mkEnableOption "cpp"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     # Allow unfree |  | ||||||
|     modules.unfree.allowedPackages = [ |  | ||||||
|       "vscode-extension-ms-vscode-cpptools" |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # Gitignore additions |  | ||||||
|     modules.git.ignores = [ |  | ||||||
|       ".ccls-cache" |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # Development packages |  | ||||||
|     home.packages = with pkgs; [ |  | ||||||
|       gnumake |  | ||||||
|       gcc |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # VSCode configuration |  | ||||||
|     programs.vscode = { |  | ||||||
|       profiles.default = { |  | ||||||
|         extensions = with pkgs.vscode-extensions; [ |  | ||||||
|           ms-vscode.cpptools |  | ||||||
|           ms-vscode.cmake-tools |  | ||||||
|           ms-vscode.cpptools-extension-pack |  | ||||||
|         ]; |  | ||||||
| 
 |  | ||||||
|         userSettings = { |  | ||||||
|           # TODO: Add setting to set the compiler, it currently needs to be set for each workspace individually |  | ||||||
|           # "C_Cpp.clang_format_fallbackStyle" = "{ BasedOnStyle: Google, IndentWidth: 4 }"; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Neovim configuration |  | ||||||
|     programs.nixvim = { |  | ||||||
|       plugins.lsp.servers.ccls.enable = true; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,42 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.haskell; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.haskell = { |  | ||||||
|     enable = mkEnableOption "haskell"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     # Development packages |  | ||||||
|     home.packages = with pkgs; [ |  | ||||||
|       haskell.compiler.ghc948 |  | ||||||
|       (haskell-language-server.override { supportedGhcVersions = [ "948" ]; }) |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # VSCode configuration |  | ||||||
|     programs.vscode = { |  | ||||||
|       profiles.default = { |  | ||||||
|         extensions = with pkgs.vscode-extensions; [ |  | ||||||
|           haskell.haskell |  | ||||||
|           justusadam.language-haskell |  | ||||||
|         ]; |  | ||||||
| 
 |  | ||||||
|         userSettings = { |  | ||||||
|           "[haskell]" = { }; |  | ||||||
|           # "haskell.formattingProvider" = "fourmolu"; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Neovim configuration |  | ||||||
|     programs.nixvim = { }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,38 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.js; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.js = { |  | ||||||
|     enable = mkEnableOption "js"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     # Development packages |  | ||||||
|     home.packages = with pkgs; [ |  | ||||||
|       nodejs |  | ||||||
|       tailwindcss |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # VSCode configuration |  | ||||||
|     programs.vscode = { |  | ||||||
|       profiles.default = { |  | ||||||
|         extensions = with pkgs.vscode-extensions; [ |  | ||||||
|           bradlc.vscode-tailwindcss |  | ||||||
|         ]; |  | ||||||
| 
 |  | ||||||
|         userSettings = { }; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Neovim configuration |  | ||||||
|     programs.nixvim = { }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,44 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| # TODO: Move to a module for notebooks in general |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.jupyter; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.jupyter = { |  | ||||||
|     enable = mkEnableOption "jupyter"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     # Development packages |  | ||||||
|     # home.packages = with pkgs; [ |  | ||||||
|     #   evcxr |  | ||||||
|     # ]; |  | ||||||
| 
 |  | ||||||
|     # modules.python.extraPythonPackages = p: [ |  | ||||||
|     #   p.jupyter |  | ||||||
|     #   p.notebook |  | ||||||
|     # ]; |  | ||||||
| 
 |  | ||||||
|     # VSCode configuration |  | ||||||
|     programs.vscode = { |  | ||||||
|       profiles.default = { |  | ||||||
|         extensions = with pkgs.vscode-extensions; [ |  | ||||||
|           ms-toolsai.jupyter |  | ||||||
|           ms-toolsai.jupyter-renderers |  | ||||||
|         ]; |  | ||||||
| 
 |  | ||||||
|         userSettings = { }; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Neovim configuration |  | ||||||
|     programs.nixvim = { }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,60 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.nix; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.nix = { |  | ||||||
|     enable = mkEnableOption "nix"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     # Development packages |  | ||||||
|     home.packages = with pkgs; [ |  | ||||||
|       nix-tree |  | ||||||
|       nixfmt-rfc-style |  | ||||||
|       nixd |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # Add nix tree |  | ||||||
|     xdg.desktopEntries.nix-tree = { |  | ||||||
|       exec = "${pkgs.nix-tree}/bin/nix-tree"; |  | ||||||
|       name = "Nix Tree"; |  | ||||||
|       terminal = true; |  | ||||||
|       type = "Application"; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # VSCode configuration |  | ||||||
|     programs.vscode = { |  | ||||||
|       profiles.default = { |  | ||||||
|         extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ]; |  | ||||||
| 
 |  | ||||||
|         userSettings = { |  | ||||||
|           "[nix]" = { |  | ||||||
|             "editor.tabSize" = 2; |  | ||||||
|           }; |  | ||||||
|           "nix.enableLanguageServer" = true; |  | ||||||
|           "nix.serverPath" = "nixd"; |  | ||||||
|           "nix.serverSettings" = { |  | ||||||
|             nixd = { |  | ||||||
|               formatting = { |  | ||||||
|                 command = [ "nixfmt" ]; |  | ||||||
|               }; |  | ||||||
|             }; |  | ||||||
|           }; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Neovim configuration |  | ||||||
|     programs.nixvim = { |  | ||||||
| 
 |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,57 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.python; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.python = { |  | ||||||
|     enable = mkEnableOption "python"; |  | ||||||
|     extraPythonPackages = mkOption { |  | ||||||
|       type = types.functionTo (types.listOf types.package) // { |  | ||||||
|         merge = |  | ||||||
|           loc: defs: p: |  | ||||||
|           lib.concatMap (def: (def.value p)) defs; |  | ||||||
|       }; |  | ||||||
|       default = p: [ ]; |  | ||||||
|       description = "Extra Python packages to install"; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     # Development packages |  | ||||||
|     home.packages = [ ]; |  | ||||||
| 
 |  | ||||||
|     # Allow unfree |  | ||||||
|     modules.unfree.allowedPackages = [ |  | ||||||
|       "vscode-extension-MS-python-vscode-pylance" |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # VSCode configuration |  | ||||||
|     programs.vscode = { |  | ||||||
|       profiles.default = { |  | ||||||
|         extensions = with pkgs.vscode-extensions; [ |  | ||||||
|           ms-python.python |  | ||||||
|           ms-python.debugpy |  | ||||||
|           ms-python.vscode-pylance |  | ||||||
|           ms-python.black-formatter |  | ||||||
|         ]; |  | ||||||
| 
 |  | ||||||
|         userSettings = { |  | ||||||
|           "python.defaultInterpreterPath" = "\${env:PYTHONINTERPRETER}"; |  | ||||||
|           "[python]" = { |  | ||||||
|             "editor.defaultFormatter" = "ms-python.black-formatter"; |  | ||||||
|           }; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Neovim configuration |  | ||||||
|     programs.nixvim = { }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,59 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.rust; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.rust = { |  | ||||||
|     enable = mkEnableOption "rust"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     # Development packages |  | ||||||
|     home.packages = with pkgs; [ |  | ||||||
|       # rustup |  | ||||||
|       # rustc |  | ||||||
|       # cargo |  | ||||||
|       # gcc |  | ||||||
|       # lldb |  | ||||||
|       # bacon |  | ||||||
|       # rust-analyzer |  | ||||||
|       # rustfmt |  | ||||||
|       # clippy |  | ||||||
|       # evcxr |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # VSCode configuration |  | ||||||
|     programs.vscode = { |  | ||||||
|       profiles.default = { |  | ||||||
|         extensions = with pkgs.vscode-extensions; [ |  | ||||||
|           rust-lang.rust-analyzer |  | ||||||
|           vadimcn.vscode-lldb |  | ||||||
|           tamasfe.even-better-toml |  | ||||||
|           serayuzgur.crates |  | ||||||
|         ]; |  | ||||||
| 
 |  | ||||||
|         userSettings = { |  | ||||||
|           "[rust]" = { |  | ||||||
|             "editor.inlayHints.enabled" = "off"; |  | ||||||
|           }; |  | ||||||
|           "rust-analyzer.check.command" = "clippy"; |  | ||||||
|           "rust-analyzer.showUnlinkedFileNotification" = false; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Neovim configuration |  | ||||||
|     programs.nixvim = { |  | ||||||
|       plugins.rustaceanvim = { |  | ||||||
|         enable = true; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,69 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.tex; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.tex = { |  | ||||||
|     enable = mkEnableOption "tex"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     # Development packages |  | ||||||
|     home.packages = with pkgs; [ |  | ||||||
|       (texlive.combine { |  | ||||||
|         inherit (texlive) scheme-full; |  | ||||||
|       }) |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # Pygments for minted |  | ||||||
|     modules.python.extraPythonPackages = p: [ |  | ||||||
|       p.pygments |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # VSCode configuration |  | ||||||
|     programs.vscode = { |  | ||||||
|       profiles.default = { |  | ||||||
|         extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ]; |  | ||||||
| 
 |  | ||||||
|         userSettings = { |  | ||||||
|           "[tex]" = { }; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Neovim configuration |  | ||||||
|     programs.nixvim = { |  | ||||||
|       extraConfigVim = '' |  | ||||||
|         " Enforce latexmk |  | ||||||
|         let g:vimtex_compiler_method = 'latexmk' |  | ||||||
| 
 |  | ||||||
|         " Set latexmk compilation settings |  | ||||||
|         let g:vimtex_compiler_latexmk = { |  | ||||||
|           \ 'options': [ |  | ||||||
|           \   '-shell-escape', |  | ||||||
|           \   '-verbose', |  | ||||||
|           \   '-file-line-error', |  | ||||||
|           \   '-synctex=1', |  | ||||||
|           \   '-interaction=nonstopmode', |  | ||||||
|           \ ], |  | ||||||
|           \} |  | ||||||
|       ''; |  | ||||||
| 
 |  | ||||||
|       # Vimtex plugin |  | ||||||
|       plugins.vimtex = { |  | ||||||
|         enable = true; |  | ||||||
|         texlivePackage = null; |  | ||||||
|         settings = { |  | ||||||
|           view_method = "zathura"; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,6 +0,0 @@ | |||||||
| { |  | ||||||
|   docker = { |  | ||||||
|     virtualisation.docker.enable = true; |  | ||||||
|     machine.sudo-groups = [ "docker" ]; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| @ -1,43 +0,0 @@ | |||||||
| { |  | ||||||
|   lib, |  | ||||||
|   config, |  | ||||||
|   pkgs, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| 
 |  | ||||||
| with lib; |  | ||||||
| let |  | ||||||
|   cfg = config.modules.docker; |  | ||||||
| in |  | ||||||
| { |  | ||||||
|   options.modules.docker = { |  | ||||||
|     enable = mkEnableOption "docker"; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   config = mkIf cfg.enable { |  | ||||||
|     # Development packages |  | ||||||
|     home.packages = with pkgs; [ |  | ||||||
|       docker |  | ||||||
|       docker-compose |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # Allow unfree |  | ||||||
|     modules.unfree.allowedPackages = [ |  | ||||||
|     ]; |  | ||||||
| 
 |  | ||||||
|     # VSCode configuration |  | ||||||
|     programs.vscode = { |  | ||||||
|       profiles.default = { |  | ||||||
|         extensions = with pkgs.vscode-extensions; [ |  | ||||||
|           ms-azuretools.vscode-docker |  | ||||||
|         ]; |  | ||||||
| 
 |  | ||||||
|         userSettings = { |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     # Neovim configuration |  | ||||||
|     programs.nixvim = { }; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user