From 98c39a11ed2a7560611b5871748ebdefb40dd7c4 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Thu, 17 Oct 2024 03:50:29 +0200 Subject: [PATCH] Additional applications and configs (#5) * Add subdirectories for `macbook` and `tongfang` with config * Working configuration * Added Zen Browser as flake * Add `wezterm` and `nvim` * Add fonts, `neovim` and `wezterm` config * Add Logseq * Add `fzf` --- .gitmodules | 3 + tongfang/.bash_aliases | 2 +- tongfang/.config/Logseq/config.edn | 1 + tongfang/.config/nvim | 1 + tongfang/.config/wezterm/wezterm.lua | 65 ++++++++++++++++ tongfang/nixos/configuration.nix | 91 +++++++++++++++++++++++ tongfang/nixos/flake.lock | 58 +++++++++++++++ tongfang/nixos/flake.nix | 17 +++++ tongfang/nixos/hardware-configuration.nix | 38 ++++++++++ 9 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 .gitmodules create mode 100644 tongfang/.config/Logseq/config.edn create mode 160000 tongfang/.config/nvim create mode 100644 tongfang/.config/wezterm/wezterm.lua create mode 100644 tongfang/nixos/configuration.nix create mode 100644 tongfang/nixos/flake.lock create mode 100644 tongfang/nixos/flake.nix create mode 100644 tongfang/nixos/hardware-configuration.nix diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8e08a7b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "tongfang/.config/nvim"] + path = tongfang/.config/nvim + url = git@github.com:bartvdbraak/nbim.git diff --git a/tongfang/.bash_aliases b/tongfang/.bash_aliases index b262e8a..4cd1fdf 100644 --- a/tongfang/.bash_aliases +++ b/tongfang/.bash_aliases @@ -1,3 +1,3 @@ alias ll='ls -la' alias lt='ls --human-readable --size -1 -S --classify' -alias nrebuild="nixos-rebuild --flake ~/ --override-input nixpkgs ~/nixpkgs --use-remote-sudo switch" +alias nrebuild='sudo nixos-rebuild --use-remote-sudo switch' \ No newline at end of file diff --git a/tongfang/.config/Logseq/config.edn b/tongfang/.config/Logseq/config.edn new file mode 100644 index 0000000..c9f0082 --- /dev/null +++ b/tongfang/.config/Logseq/config.edn @@ -0,0 +1 @@ +{:window/native-titlebar? true} \ No newline at end of file diff --git a/tongfang/.config/nvim b/tongfang/.config/nvim new file mode 160000 index 0000000..4120893 --- /dev/null +++ b/tongfang/.config/nvim @@ -0,0 +1 @@ +Subproject commit 4120893b8a1f31a0957f2f891f7fbef73ddfb9b1 diff --git a/tongfang/.config/wezterm/wezterm.lua b/tongfang/.config/wezterm/wezterm.lua new file mode 100644 index 0000000..5709864 --- /dev/null +++ b/tongfang/.config/wezterm/wezterm.lua @@ -0,0 +1,65 @@ +local wezterm = require 'wezterm'; + +return { + -- Set the default program + default_prog = { '/usr/bin/env', 'bash' }, + + -- Set the font and font size + font = wezterm.font("Jetbrains Mono"), + font_size = 13.0, + + -- Set color scheme + color_scheme = "OneHalfDark", + + -- Set window transparency + window_background_opacity = 0.9, + + -- Hide tab bar if there's only one tab + hide_tab_bar_if_only_one_tab = true, + + -- Window padding + window_padding = { + left = 5, + right = 5, + top = 5, + bottom = 5, + }, + + -- Use a steady block cursor + default_cursor_style = "SteadyBlock", + + -- Set scrollback lines to a large number for history + scrollback_lines = 10000, + + -- Key bindings + keys = { + -- CTRL+T to open a new tab + {key="t", mods="CTRL", action=wezterm.action{SpawnTab="DefaultDomain"}}, + + -- CTRL+W to close the current tab + {key="w", mods="CTRL", action=wezterm.action{CloseCurrentTab={confirm=true}}}, + + -- CTRL+D to split pane horizontally + {key="d", mods="CTRL", action=wezterm.action{SplitHorizontal={domain="CurrentPaneDomain"}}}, + + -- CTRL+SHIFT+D to split pane vertically + {key="d", mods="CTRL|SHIFT", action=wezterm.action{SplitVertical={domain="CurrentPaneDomain"}}}, + + -- CTRL+Left/Right Arrow to move between tabs + {key="LeftArrow", mods="CTRL", action=wezterm.action{ActivateTabRelative=-1}}, + {key="RightArrow", mods="CTRL", action=wezterm.action{ActivateTabRelative=1}}, + + -- CTRL+Enter to toggle full screen + {key="Enter", mods="CTRL", action="ToggleFullScreen"}, + }, + + -- Enable native macOS-style key repeat + enable_csi_u_key_encoding = true, + + -- Set the default window size to something familiar + initial_cols = 120, + initial_rows = 30, + + -- Enable Scrollbar + enable_scroll_bar = true, +} diff --git a/tongfang/nixos/configuration.nix b/tongfang/nixos/configuration.nix new file mode 100644 index 0000000..870c58f --- /dev/null +++ b/tongfang/nixos/configuration.nix @@ -0,0 +1,91 @@ +{ config, pkgs, inputs, ... }: + +{ + imports = [ + ./hardware-configuration.nix + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "tongfang"; + networking.networkmanager.enable = true; + + time.timeZone = "Europe/Amsterdam"; + + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "nl_NL.UTF-8"; + LC_IDENTIFICATION = "nl_NL.UTF-8"; + LC_MEASUREMENT = "nl_NL.UTF-8"; + LC_MONETARY = "nl_NL.UTF-8"; + LC_NAME = "nl_NL.UTF-8"; + LC_NUMERIC = "nl_NL.UTF-8"; + LC_PAPER = "nl_NL.UTF-8"; + LC_TELEPHONE = "nl_NL.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + services.xserver.enable = false; + services.displayManager.sddm.enable = true; + services.displayManager.sddm.wayland.enable = true; + services.desktopManager.plasma6.enable = true; + + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + services.printing.enable = false; + hardware.bluetooth.enable = true; + + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + services.libinput.enable = true; + + nixpkgs.config.permittedInsecurePackages = [ + "electron-27.3.11" + ]; + + users.users.bart = { + isNormalUser = true; + description = "Bart van der Braak"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; [ + vscodium-fhs + thunderbird + fastfetch + wezterm + neovim + logseq + ]; + }; + + nixpkgs.config.allowUnfree = true; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + environment.systemPackages = with pkgs; with inputs; [ + inputs.zen-browser.packages."${system}".default + firefox + git + vim + wget + curl + fzf + ]; + environment.variables.EDITOR = "vim"; + + fonts.packages = with pkgs; [ + jetbrains-mono + ]; + + system.stateVersion = "24.05"; +} diff --git a/tongfang/nixos/flake.lock b/tongfang/nixos/flake.lock new file mode 100644 index 0000000..3a7d0d4 --- /dev/null +++ b/tongfang/nixos/flake.lock @@ -0,0 +1,58 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 0, + "narHash": "sha256-WLxED18lodtQiayIPDE5zwAfkPJSjHJ35UhZ8h3cJUg=", + "path": "/nix/store/wdk3xa0vwx7swjdl1samf1bccvyyzfc1-source", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1727348695, + "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "zen-browser": "zen-browser" + } + }, + "zen-browser": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1727721329, + "narHash": "sha256-QYlWZwUSwrM7BuO+dXclZIwoPvBIuJr6GpFKv9XKFPI=", + "owner": "MarceColl", + "repo": "zen-browser-flake", + "rev": "e6ab73f405e9a2896cce5956c549a9cc359e5fcc", + "type": "github" + }, + "original": { + "owner": "MarceColl", + "repo": "zen-browser-flake", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/tongfang/nixos/flake.nix b/tongfang/nixos/flake.nix new file mode 100644 index 0000000..1c428f7 --- /dev/null +++ b/tongfang/nixos/flake.nix @@ -0,0 +1,17 @@ +{ + description = "TongFang NixOS flake"; + + inputs = { + zen-browser.url = "github:MarceColl/zen-browser-flake"; + }; + + outputs = { self, nixpkgs, ... }@inputs: { + nixosConfigurations.tongfang = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + ]; + specialArgs = { inherit inputs; }; + }; + }; +} \ No newline at end of file diff --git a/tongfang/nixos/hardware-configuration.nix b/tongfang/nixos/hardware-configuration.nix new file mode 100644 index 0000000..f10dad2 --- /dev/null +++ b/tongfang/nixos/hardware-configuration.nix @@ -0,0 +1,38 @@ +# 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 = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/c7cf28c3-5744-45cc-8a81-456d24e44b7a"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/CEF6-7DAA"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}