summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2024-09-29 22:54:38 -0500
committerTim Keller <tjk@tjkeller.xyz>2024-09-29 22:54:38 -0500
commitf9d4d2bbd82bd66bebff85420df6653a6966ee9a (patch)
treedee057520e7c6f32234066786e447b9d05ebd17b
downloadnixos-f9d4d2bbd82bd66bebff85420df6653a6966ee9a.tar.xz
nixos-f9d4d2bbd82bd66bebff85420df6653a6966ee9a.zip
initial commit
-rw-r--r--configuration.nix244
-rw-r--r--flake.lock49
-rw-r--r--flake.nix28
-rw-r--r--hardware-configuration.nix33
-rw-r--r--home-config/activation-scripts/clone-repos.sh19
-rw-r--r--home-config/firefox/uiCustomization.json66
-rw-r--r--home-config/firefox/userChrome.css184
-rw-r--r--home.nix95
-rw-r--r--nixes/startx/startx-xdg.patch4
-rw-r--r--nixes/startx/startx.nix10
-rw-r--r--xinit-startx-xdg.patch14
11 files changed, 746 insertions, 0 deletions
diff --git a/configuration.nix b/configuration.nix
new file mode 100644
index 0000000..c98d0b6
--- /dev/null
+++ b/configuration.nix
@@ -0,0 +1,244 @@
+# Edit this configuration file to define what should be installed on
+# your system. Help is available in the configuration.nix(5) man page, on
+# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
+
+{ config, lib, pkgs, ... }:
+
+{
+ imports =
+ [ # Include the results of the hardware scan.
+ ./hardware-configuration.nix
+ ];
+
+ nix.settings = {
+ experimental-features = [ "nix-command" "flakes" ];
+ use-xdg-base-directories = true;
+ };
+ nix.gc = {
+ automatic = true;
+ dates = "weekly";
+ options = "--delete-older-than 30d";
+ };
+
+ # Use the GRUB 2 boot loader.
+ boot.loader.grub.enable = true;
+ # boot.loader.grub.efiSupport = true;
+ # boot.loader.grub.efiInstallAsRemovable = true;
+ # boot.loader.efi.efiSysMountPoint = "/boot/efi";
+ # Define on which hard drive you want to install Grub.
+ boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
+
+ # networking.hostName = "nixos"; # Define your hostname.
+ # Pick only one of the below networking options.
+ # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
+ networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
+
+ # Set your time zone.
+ time.timeZone = "America/Chicago";
+
+ # Configure network proxy if necessary
+ # networking.proxy.default = "http://user:password@proxy:port/";
+ # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
+
+ # Select internationalisation properties.
+ i18n.defaultLocale = "en_US.UTF-8";
+ # console = {
+ # font = "Lat2-Terminus16";
+ # keyMap = "us";
+ # useXkbConfig = true; # use xkb.options in tty.
+ # };
+
+ # Enable the X11 windowing system.
+ services.xserver.enable = true;
+ services.xserver.displayManager.startx.enable = true;
+ services.xserver.windowManager.awesome.enable = true;
+
+
+
+
+ # Configure keymap in X11
+ services.xserver.xkb.layout = "us";
+ # services.xserver.xkb.options = "eurosign:e,caps:escape";
+
+ # Enable CUPS to print documents.
+ # services.printing.enable = true;
+
+ # Enable sound.
+ # hardware.pulseaudio.enable = true;
+ # OR
+ services.pipewire = {
+ enable = true;
+ pulse.enable = true;
+ };
+
+ # Enable touchpad support (enabled default in most desktopManager).
+ services.libinput.enable = true;
+
+ #nixpkgs.overlays = [
+ # # startx xdg patch
+ # (final: prev: {
+ # xorg.xinit = prev.xorg.xinit.overrideAttrs (old: {
+ # # Apply the patch
+ # patches = old.patches or [] ++ [
+ # ./startx-xdg.patch
+ # ];
+ # });
+ # })
+ #];
+
+
+ # Define a user account. Don't forget to set a password with ‘passwd’.
+ users.users.timmy = {
+ description = "Tim Keller";
+ isNormalUser = true;
+ extraGroups = [ "wheel" "docker" ]; # Enable ‘sudo’ for the user.
+ packages = with pkgs; [
+ firefox
+ tree
+ alacritty
+ arandr
+ cups
+ dmenu
+ geeqie
+ #gimp
+ #inkscape
+ #keepassxc
+ mpv
+ pavucontrol
+ pcmanfm
+ #qbittorrent
+ #qdirstat
+ redshift
+ sxiv
+ #syncthing
+ #virt-manager
+ zathura
+ #additional dev tools
+ #android-tools
+ #cargo
+ #hugo
+ #python-pip
+ #wireguard-tools
+ ];
+ };
+
+ programs.zsh.enable = true;
+ users.defaultUserShell = pkgs.zsh;
+
+ programs.dconf.enable = true; # For home-manager to configure gtk
+
+ # List packages installed in system profile. To search, run:
+ # $ nix search wget
+ environment.systemPackages = with pkgs; [
+ home-manager
+ neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
+ wget
+ light
+ dash # TODO should be default /bin/sh
+ ddcutil # TODO
+ entr
+ jq
+ lm_sensors
+ nmap
+ openssl
+ pv
+ rsync
+ sassc
+ sslscan
+ stress
+ wget
+ xxHash
+ htop
+ fastfetch
+ p7zip
+ gcc
+ gnumake
+ powertop
+ smartmontools
+ testdisk
+ uhubctl
+ xcape
+ xwallpaper
+ screen
+ tmux
+ scrot
+ xorg.setxkbmap
+ unclutter
+ xclip
+ xdotool
+ xorg.xinput
+ xorg.xkill
+ xorg.xrandr
+ xorg.xset
+ zsh
+ docker-compose
+ git
+ (xorg.xinit.overrideAttrs (old: rec {
+ patches = [
+ ./xinit-startx-xdg.patch
+ ];
+ }))
+ ];
+
+ security.doas.enable = true;
+ #security.sudo.enable = false;
+ security.doas.extraRules = [{
+ groups = ["wheel"];
+ keepEnv = true;
+ noPass = true;
+ }];
+
+ virtualisation.docker.enable = true;
+ virtualisation.docker.storageDriver = "btrfs";
+
+ # TODO this does not function
+ boot.initrd.systemd.extraBin = {
+ sh = "${pkgs.dash}/bin/dash";
+ vim = "${pkgs.neovim}/bin/nvim";
+ };
+
+ # Some programs need SUID wrappers, can be configured further or are
+ # started in user sessions.
+ # programs.mtr.enable = true;
+ # programs.gnupg.agent = {
+ # enable = true;
+ # enableSSHSupport = true;
+ # };
+
+ # List services that you want to enable:
+
+ # Enable the OpenSSH daemon.
+ services.openssh.enable = true;
+
+ # Open ports in the firewall.
+ # networking.firewall.allowedTCPPorts = [ ... ];
+ # networking.firewall.allowedUDPPorts = [ ... ];
+ # Or disable the firewall altogether.
+ # networking.firewall.enable = false;
+
+ # Copy the NixOS configuration file and link it from the resulting system
+ # (/run/current-system/configuration.nix). This is useful in case you
+ # accidentally delete configuration.nix.
+ # system.copySystemConfiguration = true;
+
+ # This option defines the first version of NixOS you have installed on this particular machine,
+ # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
+ #
+ # Most users should NEVER change this value after the initial install, for any reason,
+ # even if you've upgraded your system to a new NixOS release.
+ #
+ # This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
+ # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
+ # to actually do that.
+ #
+ # This value being lower than the current NixOS release does NOT mean your system is
+ # out of date, out of support, or vulnerable.
+ #
+ # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
+ # and migrated your data accordingly.
+ #
+ # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
+ system.stateVersion = "24.05"; # Did you read the comment?
+
+}
+
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..a648657
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,49 @@
+{
+ "nodes": {
+ "home-manager": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1726989464,
+ "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
+ "owner": "nix-community",
+ "repo": "home-manager",
+ "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "ref": "release-24.05",
+ "repo": "home-manager",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1727540905,
+ "narHash": "sha256-40J9tW7Y794J7Uw4GwcAKlMxlX2xISBl6IBigo83ih8=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "fbca5e745367ae7632731639de5c21f29c8744ed",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "nixos-24.05",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "home-manager": "home-manager",
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..053354f
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,28 @@
+{
+ description = "TimmyOS System Config";
+
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
+
+ home-manager = {
+ url = "github:nix-community/home-manager/release-24.05";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ };
+
+ outputs = { nixpkgs, home-manager, ... }:
+ # HOSTNAME NIXOS
+ let
+ system = "x86_64-linux";
+ in {
+ nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
+ inherit system;
+ modules = [ ./configuration.nix ];
+ };
+
+ homeConfigurations.timmy = home-manager.lib.homeManagerConfiguration {
+ pkgs = nixpkgs.legacyPackages.${system};
+ modules = [ ./home.nix ];
+ };
+ };
+}
diff --git a/hardware-configuration.nix b/hardware-configuration.nix
new file mode 100644
index 0000000..206a525
--- /dev/null
+++ b/hardware-configuration.nix
@@ -0,0 +1,33 @@
+# Do not modify this file! It was generated by ‘nixos-generate-config’
+# and may be overwritten by future invocations. Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, lib, pkgs, modulesPath, ... }:
+
+{
+ imports =
+ [ (modulesPath + "/installer/scan/not-detected.nix")
+ ];
+
+ boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "/dev/disk/by-uuid/b991914b-3a4c-4248-9472-b5403729601a";
+ fsType = "btrfs";
+ };
+
+ swapDevices = [ ];
+
+ # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
+ # (the default) this is the recommended approach. When using systemd-networkd it's
+ # still possible to use this option, but it's recommended to use it in conjunction
+ # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
+ networking.useDHCP = lib.mkDefault true;
+ # networking.interfaces.enp0s25.useDHCP = lib.mkDefault true;
+ # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/home-config/activation-scripts/clone-repos.sh b/home-config/activation-scripts/clone-repos.sh
new file mode 100644
index 0000000..8ebdbe4
--- /dev/null
+++ b/home-config/activation-scripts/clone-repos.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+server="https://git.tjkeller.xyz/"
+
+clonemissing() {
+ # clone to $2
+ [ -d "$2"/.git ] && return
+ run mkdir -p $VERBOSE_ARG "$2"
+ run git clone $VERBOSE_ARG "$server$1" "$2"
+
+ # link to $3
+ [ -z "$3" ] && return
+ run mkdir -p $VERBOSE_ARG "$3"
+ run ln -sf $VERBOSE_ARG "$2"/.* "$2"/* "$3"
+}
+
+# # repo # clone to # link to
+clonemissing scripts.git $HOME/docs/src/scripts $HOME/.local/bin
+clonemissing dotconfig.git $HOME/docs/src/config $HOME/.config
diff --git a/home-config/firefox/uiCustomization.json b/home-config/firefox/uiCustomization.json
new file mode 100644
index 0000000..02fa6de
--- /dev/null
+++ b/home-config/firefox/uiCustomization.json
@@ -0,0 +1,66 @@
+{
+ "placements": {
+ "widget-overflow-fixed-list": [],
+ "unified-extensions-area": [
+ "ublock0_raymondhill_net-browser-action",
+ "sponsorblocker_ajay_app-browser-action",
+ "_e6e36c9a-8323-446c-b720-a176017e38ff_-browser-action",
+ "dearrow_ajay_app-browser-action",
+ "_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action",
+ "idcac-pub_guus_ninja-browser-action",
+ "addon_darkreader_org-browser-action",
+ "_74145f27-f039-47ce-a470-a662b129930a_-browser-action",
+ "_762f9885-5a13-4abd-9c77-433dcd38b8fd_-browser-action",
+ "jid1-bofifl9vbdl2zq_jetpack-browser-action",
+ "addon_fastforward_team-browser-action",
+ "jid1-tsgsxbhncspbwq_jetpack-browser-action",
+ "_aecec67f-0d10-4fa7-b7c7-609a2db280cf_-browser-action"
+ ],
+ "nav-bar": [
+ "back-button",
+ "forward-button",
+ "stop-reload-button",
+ "home-button",
+ "urlbar-container",
+ "downloads-button",
+ "unified-extensions-button"
+ ],
+ "toolbar-menubar": [
+ "menubar-items"
+ ],
+ "TabsToolbar": [
+ "tabbrowser-tabs",
+ "new-tab-button",
+ "alltabs-button"
+ ],
+ "PersonalToolbar": [
+ "personal-bookmarks"
+ ]
+ },
+ "seen": [
+ "save-to-pocket-button",
+ "developer-button",
+ "dearrow_ajay_app-browser-action",
+ "_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action",
+ "_e6e36c9a-8323-446c-b720-a176017e38ff_-browser-action",
+ "sponsorblocker_ajay_app-browser-action",
+ "ublock0_raymondhill_net-browser-action",
+ "idcac-pub_guus_ninja-browser-action",
+ "addon_darkreader_org-browser-action",
+ "_74145f27-f039-47ce-a470-a662b129930a_-browser-action",
+ "_762f9885-5a13-4abd-9c77-433dcd38b8fd_-browser-action",
+ "jid1-bofifl9vbdl2zq_jetpack-browser-action",
+ "addon_fastforward_team-browser-action",
+ "jid1-tsgsxbhncspbwq_jetpack-browser-action",
+ "_aecec67f-0d10-4fa7-b7c7-609a2db280cf_-browser-action"
+ ],
+ "dirtyAreaCache": [
+ "nav-bar",
+ "PersonalToolbar",
+ "unified-extensions-area",
+ "toolbar-menubar",
+ "TabsToolbar"
+ ],
+ "currentVersion": 20,
+ "newElementCount": 5
+}
diff --git a/home-config/firefox/userChrome.css b/home-config/firefox/userChrome.css
new file mode 100644
index 0000000..ce3868b
--- /dev/null
+++ b/home-config/firefox/userChrome.css
@@ -0,0 +1,184 @@
+/* TOP BAR */
+#navigator-toolbox{
+ --uc-navigationbar-width: 40vw;
+}
+
+/* Remove overflow button */
+#nav-bar-overflow-button { display: none; }
+
+/* remove alltabs button */
+#alltabs-button { display: none; }
+
+/* Change background color of toolbar */
+#navigator-toolbox-background {
+ background: var(--toolbar-field-border-color) !important;
+}
+
+/* Fix vertical spacing of tabs */
+#TabsToolbar {
+ margin-top: -1px;
+}
+
+/* Move new tab to far right */
+#tabbrowser-arrowscrollbox-periphery {
+ margin-left: auto;
+}
+
+/* Media queries for width of nav bar */
+@media screen and (max-width: 1000px){
+ #navigator-toolbox{
+ --uc-navigationbar-width: 50vw;
+ }
+}
+@media screen and (max-width: 800px){
+ #navigator-toolbox{
+ --uc-navigationbar-width: 60vw;
+ }
+}
+
+/* Change look of tabs in smaller view */
+@media screen and (max-width: 800px){
+ .tab-background {
+ margin-bottom: 0 !important;
+ margin-top: 0 !important;
+ border-bottom-left-radius: 0 !important;
+ border-bottom-right-radius: 0 !important;
+ }
+ #TabsToolbar{
+ margin-left: 5px;
+ }
+}
+
+
+/* COMBINE TOP BAR */
+/* Combine top bar into single line if width >= 800px */
+@media screen and (min-width: 800px){
+ :root {
+ --uc-toolbar-height: 36px; /* Half height bar */
+ }
+
+ /* Modify these to change relative widths or default height */
+ #navigator-toolbox{
+ margin-bottom: 0px;
+ }
+
+ #titlebar {
+ margin-top: 2px;
+ }
+
+ #TabsToolbar{
+ margin-left: calc(var(--uc-navigationbar-width) + 2px); /* Resize tab bar */
+ margin-top: -4px;
+ margin-bottom: 2px;
+ }
+
+ /* Tabs extend to bottom of bar */
+ .tab-background {
+ margin-bottom: 0 !important;
+ margin-top: 2px !important; /* See above navbox rule */
+ }
+
+ /* Center tab buttons */
+ #tabs-newtab-button,
+ #alltabs-button
+ {
+ margin-top: 4px !important;
+ }
+
+ /* Integrate url / nav bar */
+ #nav-bar{
+ margin-right:calc(100vw - var(--uc-navigationbar-width));
+ margin-top: calc(0px - var(--uc-toolbar-height));
+ border-radius: 0 var(--tab-border-radius) var(--tab-border-radius) 0;
+ }
+
+ /* 1px margin on touch density causes tabs to be too high */
+ .tab-close-button{
+ margin-top: 0 !important
+ }
+
+ /* Make opened urlbar overlay the toolbar */
+ #urlbar[open]:focus-within{
+ min-width: 50vw !important;
+ }
+
+ /* Remove min and max width of urlbar */
+ #urlbar-container {
+ width: 0 !important;
+ }
+
+ /* Fix customization view */
+ #customization-panelWrapper .panel-arrowbox .panel-arrow{
+ margin-inline-end: initial !important;
+ }
+
+ /* Shorter findbar */
+ findbar {
+ width: 600px !important;
+ }
+}
+
+
+/* FINDBAR */
+findbar {
+ width: 100vw;
+ position: absolute;
+ top: 0;
+ right: 0;
+ border-radius: 0 0 0 5px;
+ padding: 0 !important;
+ background: var(--toolbar-field-border-color, --toolbar-field-background-color) !important; /* TODO fallback color doesn't work */
+ border-top-width: 0 !important;
+}
+
+findbar .findbar-container {
+ padding-bottom: 5px !important; /* Move search bar closer to left edge */
+ padding-top: 2px !important; /* Move search bar closer to left edge */
+ height: max-content !important;
+ gap: 2px;
+ justify-content: space-between;
+ flex-wrap: wrap;
+}
+
+/* Hide not found text etc */
+findbar description {
+ display: none;
+}
+
+/* Move found matches label (roughly) into the textbox */
+findbar label.found-matches {
+ position: absolute;
+ top: 6.5px;
+ right: 120px;
+ background: var(--toolbar-field-background-color);
+ color: color-mix(in srgb, var(--toolbar-non-lwt-textcolor), transparent 46%) !important;
+ padding-left: 1ex;
+}
+
+/* Force checkboxes onto second line */
+findbar .findbar-container hbox {
+ width: 100%;
+}
+/* Force textbox to fill up first line */
+findbar .findbar-container hbox .findbar-textbox {
+ width: 100% !important;
+}
+
+/* Make checkboxes visible */
+findbar .findbar-container checkbox{
+ --checkbox-unchecked-bgcolor: var(--toolbar-bgcolor);
+ --checkbox-unchecked-hover-bgcolor: color-mix(in srgb, var(--toolbar-bgcolor) 80%, transparent);
+ --checkbox-unchecked-active-bgcolor: var(--toolbar-bgcolor);
+}
+
+
+/* BOOKMARK BAR */
+@-moz-document url(chrome://browser/content/browser.xhtml){
+ #PersonalToolbar[collapsed=false]{
+ background: var(--toolbar-field-background-color) !important;
+ }
+ /* Space out bookmark items */
+ .bookmark-item .toolbarbutton-text {
+ padding: 2.5px 4px;
+ }
+} \ No newline at end of file
diff --git a/home.nix b/home.nix
new file mode 100644
index 0000000..78608a9
--- /dev/null
+++ b/home.nix
@@ -0,0 +1,95 @@
+{ config, lib, pkgs, ... }: {
+ home = {
+ username = "timmy";
+ homeDirectory = "/home/timmy";
+ stateVersion = "24.05";
+ activation = {
+ # TODO TODO
+ #cloneRepos = lib.hm.dag.entryAfter ["writeBoundary" "installPackages"] ''${builtins.readFile ./home-config/activate-scripts/clone-repos.sh}'';
+ cloneRepos = lib.hm.dag.entryAfter ["writeBoundary"] ''
+ export PATH="${config.home.path}/bin:$PATH"
+ ${builtins.readFile ./home-config/activation-scripts/clone-repos.sh}
+ '';
+ linkZshProfile = lib.hm.dag.entryAfter ["writeBoundary"] ''
+ run ln -sf $VERBOSE_ARG $HOME/.config/zsh/zprofile $HOME/.zprofile
+ '';
+ cleanupHome = lib.hm.dag.entryAfter ["writeBoundary"] ''
+ run rm -f $VERBOSE_ARG $HOME/{.zcompdump,.zshrc,.zsh_history,.bash_history}
+ '';
+ };
+ };
+
+ programs = {
+ git = {
+ enable = true;
+ userName = "Tim Keller"; # TODO set to user description
+ userEmail = "tjk@tjkeller.xyz"; # TODO set to user email
+ };
+ firefox = {
+ enable = true;
+ profiles = let
+ search = {
+ engines = {
+ "Timmy Search" = {
+ urls = [{ template = "https://search.tjkeller.xyz/search?q={searchTerms}"; }]; # Don't know how to do w/ POST but I prefer GET anyways
+ iconURI = "https://search.tjkeller.xyz/static/themes/simple/img/favicon.svg"; # TODO doesn't seem to work
+ };
+ };
+ default = "Timmy Search";
+ privateDefault = "Timmy Search";
+ };
+ userChrome = builtins.readFile ./home-config/firefox/userChrome.css;
+ settings = {
+ toolkit.legacyUserProfileCustomizations.stylesheets = true;
+ browser.compactmode.show = true;
+ browser.uidensity = 1; # Compact
+ browser.download.dir = /home/timmy/dls; # FF will create this dir if it doesn't exist
+ browser.aboutConfig.showWarning = false;
+ app.normandy.first_run = false;
+ browser.uiCustomization.state = builtins.readFile ./home-config/firefox/uiCustomization.json; # Toolbar etc.
+ #identity.fxaccounts.account.device.name = "timmy’s Firefox on nixos"; # HOSTNAME
+ };
+ in {
+ Personal = {
+ id = 0;
+ isDefault = true;
+ #settings = {};
+ inherit search;
+ inherit userChrome;
+ inherit settings;
+ };
+ Work = {
+ id = 1;
+ inherit search;
+ };
+ };
+ };
+ };
+
+ gtk = {
+ enable = true;
+ theme = {
+ package = pkgs.cinnamon.mint-themes;
+ name = "Mint-Y-Dark-Aqua";
+ };
+ iconTheme = {
+ package = pkgs.cinnamon.mint-y-icons;
+ name = "Mint-Y-Aqua";
+ };
+ cursorTheme = {
+ name = "Adwaita";
+ };
+ gtk3.bookmarks = [
+ "file:///home/timmy/dls Downloads"
+ "file:///home/timmy/docs Documents"
+ "file:///home/timmy/docs/src/sites sites"
+ "file:///home/timmy/docs/src/scripts scripts"
+ "file:///home/timmy/docs/src/programs programs"
+ ];
+ gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
+ };
+ qt = {
+ enable = true;
+ platformTheme.name = "gtk3";
+ };
+}
diff --git a/nixes/startx/startx-xdg.patch b/nixes/startx/startx-xdg.patch
new file mode 100644
index 0000000..5aa3fd9
--- /dev/null
+++ b/nixes/startx/startx-xdg.patch
@@ -0,0 +1,4 @@
+175c175
+< xserverauthfile=$HOME/.serverauth.$$
+---
+> xserverauthfile="${XAUTHORITY:-$HOME/.Xauthority}"
diff --git a/nixes/startx/startx.nix b/nixes/startx/startx.nix
new file mode 100644
index 0000000..591f426
--- /dev/null
+++ b/nixes/startx/startx.nix
@@ -0,0 +1,10 @@
+#{ pkgs ? import <nixpkgs> { overlays = [ (import /path/to/my-overlay.nix) ]; } }:
+
+final: prev: {
+ xorg.xinit = prev.xorg.xinit.overrideAttrs (old: {
+ # Apply the patch
+ patches = old.patches or [] ++ [
+ ./startx-xdg.patch
+ ];
+ });
+}
diff --git a/xinit-startx-xdg.patch b/xinit-startx-xdg.patch
new file mode 100644
index 0000000..c1bca97
--- /dev/null
+++ b/xinit-startx-xdg.patch
@@ -0,0 +1,14 @@
+diff --git a/startx.cpp b/startx.cpp
+index dfbebe1..472a1b0 100644
+--- a/startx.cpp
++++ b/startx.cpp
+@@ -272,7 +272,7 @@ if [ x"$enable_xauth" = x1 ] ; then
+ dummy=0
+
+ XCOMM create a file with auth information for the server. ':0' is a dummy.
+- xserverauthfile=$HOME/.serverauth.$$
++ xserverauthfile="${XAUTHORITY:-$HOME/.Xauthority}"
+ trap "rm -f '$xserverauthfile'" HUP INT QUIT ILL TRAP BUS TERM
+ xauth -q -f "$xserverauthfile" << EOF
+ add :$dummy . $mcookie
+