From 07a1841fda79967fe1f4f5455f8bbd5c7d1e8454 Mon Sep 17 00:00:00 2001 From: Thilo Billerbeck Date: Tue, 27 Feb 2024 02:54:02 +0100 Subject: [PATCH] cleanup and format --- .../thilo-laptop/hardware-configuration.nix | 40 +-- configs/thilo-laptop/home.nix | 67 +++-- configs/thilo-laptop/nixos.nix | 36 +-- configs/thilo-pc/hardware-configuration.nix | 35 +-- configs/thilo-pc/home.nix | 56 ++--- configs/thilo-pc/nixos.nix | 29 ++- configs/wsl/home.nix | 24 +- flake.nix | 28 +-- home-manager/modules/machine.nix | 8 +- home-manager/modules/packages.nix | 228 +++++++++--------- .../pkgs/docker-craft-cms-dev-env.nix | 8 +- home-manager/pkgs/spx-gc.nix | 9 +- .../pkgs/toggl-time-grouper/package.nix | 4 +- home-manager/programs/alacritty.nix | 2 +- home-manager/programs/bat.nix | 6 +- home-manager/programs/beets.nix | 2 - home-manager/programs/chromium.nix | 31 +-- home-manager/programs/command-not-found.nix | 6 +- home-manager/programs/dircolors.nix | 2 - home-manager/programs/direnv.nix | 2 - home-manager/programs/firefox.nix | 2 +- home-manager/programs/fzf.nix | 2 - home-manager/programs/git.nix | 6 +- home-manager/programs/go.nix | 8 +- home-manager/programs/hstr.nix | 6 +- home-manager/programs/htop.nix | 2 - home-manager/programs/mpv.nix | 2 +- home-manager/programs/neovim.nix | 2 +- home-manager/programs/starship.nix | 2 - home-manager/programs/syncthing.nix | 8 +- home-manager/programs/topgrade.nix | 20 +- home-manager/programs/yt-dlp.nix | 6 +- home-manager/programs/zsh.nix | 2 +- home-manager/wrappers/fedora.nix | 17 +- home-manager/wrappers/vscode.nix | 0 nix.nix | 9 +- nixos/common.nix | 46 ++-- 37 files changed, 336 insertions(+), 427 deletions(-) delete mode 100644 home-manager/wrappers/vscode.nix diff --git a/configs/thilo-laptop/hardware-configuration.nix b/configs/thilo-laptop/hardware-configuration.nix index 5b111a4..33e37e6 100644 --- a/configs/thilo-laptop/hardware-configuration.nix +++ b/configs/thilo-laptop/hardware-configuration.nix @@ -1,26 +1,29 @@ -{ config, lib, pkgs, modulesPath, ... }: +{ config, lib, modulesPath, ... }: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/2e1227f6-8725-43a3-aeb6-961df4ed9b25"; - fsType = "ext4"; + boot = { + initrd = { + availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ]; + kernelModules = [ ]; }; + kernelModules = [ "kvm-amd" ]; + extraModulePackages = [ ]; + }; - boot.initrd.luks.devices."luks-6f077715-c436-4254-acb2-66d8be0a0c55".device = "/dev/disk/by-uuid/6f077715-c436-4254-acb2-66d8be0a0c55"; + fileSystems."/" = { + device = "/dev/disk/by-uuid/2e1227f6-8725-43a3-aeb6-961df4ed9b25"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/877C-C918"; - fsType = "vfat"; - }; + boot.initrd.luks.devices."luks-6f077715-c436-4254-acb2-66d8be0a0c55".device = + "/dev/disk/by-uuid/6f077715-c436-4254-acb2-66d8be0a0c55"; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/877C-C918"; + fsType = "vfat"; + }; swapDevices = [ ]; @@ -33,5 +36,6 @@ # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.amd.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/configs/thilo-laptop/home.nix b/configs/thilo-laptop/home.nix index 4a7dd95..4042f24 100644 --- a/configs/thilo-laptop/home.nix +++ b/configs/thilo-laptop/home.nix @@ -1,44 +1,43 @@ { inputs, pkgs, ... }: { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = { inherit inputs; }; - home-manager.users.thilo = { - imports = [ - ./../../home-manager/modules/machine.nix - ]; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { inherit inputs; }; + users.thilo = { + imports = [ ./../../home-manager/modules/machine.nix ]; - machine = { - username = "thilo"; - isGeneric = false; - isGnome = false; - noiseSuppression.enable = true; - isGraphical = true; - }; + machine = { + username = "thilo"; + isGeneric = false; + isGnome = false; + noiseSuppression.enable = true; + isGraphical = true; + }; - xsession.pointerCursor = { - name = "Bibata-Modern-Classic"; - package = pkgs.bibata-cursors; - size = 128; - }; + xsession.pointerCursor = { + name = "Bibata-Modern-Classic"; + package = pkgs.bibata-cursors; + size = 128; + }; - programs.obs-studio = { - enable = true; - /* plugins = with pkgs.obs-studio-plugins; [ - obs-vaapi - obs-teleport - droidcam-obs - obs-gstreamer - obs-shaderfilter - obs-command-source - obs-move-transition - advanced-scene-switcher - ]; */ - }; + programs.obs-studio = { + enable = true; + /* plugins = with pkgs.obs-studio-plugins; [ + obs-vaapi + obs-teleport + droidcam-obs + obs-gstreamer + obs-shaderfilter + obs-command-source + obs-move-transition + advanced-scene-switcher + ]; + */ + }; - home.sessionVariables = { - LD_LIBRARY_PATH = "${pkgs.libGL}/lib"; + home.sessionVariables = { LD_LIBRARY_PATH = "${pkgs.libGL}/lib"; }; }; }; } diff --git a/configs/thilo-laptop/nixos.nix b/configs/thilo-laptop/nixos.nix index ebeefb4..3d842de 100644 --- a/configs/thilo-laptop/nixos.nix +++ b/configs/thilo-laptop/nixos.nix @@ -1,35 +1,26 @@ -{ - config, - pkgs, - lib, - ... -}: +{ pkgs, ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ./../../nixos/common.nix - ]; + imports = [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./../../nixos/common.nix + ]; # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; # Setup keyfile - boot.initrd.secrets = { - "/crypto_keyfile.bin" = null; - }; + boot.initrd.secrets = { "/crypto_keyfile.bin" = null; }; networking.hostName = "thilo-laptop"; # Define your hostname. # Configure console keymap console.keyMap = "de"; - environment.gnome.excludePackages = with pkgs; [ - tracker - tracker-miners - ]; + environment.gnome.excludePackages = with pkgs; [ tracker tracker-miners ]; hardware.bluetooth.enable = true; @@ -50,10 +41,7 @@ fwupd.enable = true; }; - environment.systemPackages = with pkgs; [ - brlaser - brgenml1lpr - ]; + environment.systemPackages = with pkgs; [ brlaser brgenml1lpr ]; system.stateVersion = "23.05"; } diff --git a/configs/thilo-pc/hardware-configuration.nix b/configs/thilo-pc/hardware-configuration.nix index 0ccea50..e7fd89b 100644 --- a/configs/thilo-pc/hardware-configuration.nix +++ b/configs/thilo-pc/hardware-configuration.nix @@ -1,34 +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, ... }: +{ config, lib, modulesPath, ... }: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "uas" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot = { + initrd = { + availableKernelModules = + [ "nvme" "xhci_pci" "ahci" "usbhid" "uas" "usb_storage" "sd_mod" ]; + kernelModules = [ ]; + }; + kernelModules = [ "kvm-amd" ]; + extraModulePackages = [ ]; + }; - fileSystems."/" = - { device = "/dev/disk/by-uuid/34eb30d5-5faa-409f-81ee-7b996d37534a"; + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/34eb30d5-5faa-409f-81ee-7b996d37534a"; fsType = "btrfs"; options = [ "subvol=@" ]; }; - fileSystems."/data" = - { + "/data" = { device = "/dev/disk/by-uuid/91f64815-1d3c-4032-960f-0a53eb3b01ab"; fsType = "btrfs"; }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/0EB3-BFB0"; + "/boot" = { + device = "/dev/disk/by-uuid/0EB3-BFB0"; fsType = "vfat"; }; + }; swapDevices = [ ]; @@ -40,5 +44,6 @@ # networking.interfaces.enp8s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.amd.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/configs/thilo-pc/home.nix b/configs/thilo-pc/home.nix index 438535b..7753098 100644 --- a/configs/thilo-pc/home.nix +++ b/configs/thilo-pc/home.nix @@ -1,37 +1,33 @@ { inputs, pkgs, ... }: { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = { inherit inputs; }; - home-manager.users.thilo = { - imports = [ - ./../../home-manager/modules/machine.nix - ]; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { inherit inputs; }; + users.thilo = { + imports = [ ./../../home-manager/modules/machine.nix ]; - machine = { - username = "thilo"; - isGeneric = false; - isGnome = false; - noiseSuppression.enable = true; - isGraphical = true; + machine = { + username = "thilo"; + isGeneric = false; + isGnome = false; + noiseSuppression.enable = true; + isGraphical = true; + }; + + xsession.pointerCursor = { + name = "Bibata-Modern-Classic"; + package = pkgs.bibata-cursors; + size = 128; + }; + + services.kdeconnect.enable = true; + services.kdeconnect.indicator = true; + + home.sessionVariables = { LD_LIBRARY_PATH = "${pkgs.libGL}/lib"; }; + + home.packages = with pkgs; [ libsForQt5.discover ]; }; - - xsession.pointerCursor = { - name = "Bibata-Modern-Classic"; - package = pkgs.bibata-cursors; - size = 128; - }; - - services.kdeconnect.enable = true; - services.kdeconnect.indicator = true; - - home.sessionVariables = { - LD_LIBRARY_PATH = "${pkgs.libGL}/lib"; - }; - - home.packages = with pkgs; [ - libsForQt5.discover - ]; }; } diff --git a/configs/thilo-pc/nixos.nix b/configs/thilo-pc/nixos.nix index 4e90aab..e17828e 100644 --- a/configs/thilo-pc/nixos.nix +++ b/configs/thilo-pc/nixos.nix @@ -1,11 +1,7 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config -, pkgs -, lib -, ... -}: +{ pkgs, ... }: { imports = [ @@ -15,12 +11,18 @@ ]; # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.systemd-boot.extraInstallCommands = '' - ${pkgs.gnused}/bin/sed -i "/default/c\default @saved" /boot/loader/loader.conf - ''; - boot.kernelPackages = pkgs.linuxPackages_latest; + boot = { + loader = { + systemd-boot = { + enable = true; + extraInstallCommands = '' + ${pkgs.gnused}/bin/sed -i "/default/c\default @saved" /boot/loader/loader.conf + ''; + }; + efi.canTouchEfiVariables = true; + }; + kernelPackages = pkgs.linuxPackages_latest; + }; networking.hostName = "thilo-pc"; @@ -37,10 +39,7 @@ }; hardware.opengl = { - extraPackages = with pkgs; [ - vaapiVdpau - libvdpau-va-gl - ]; + extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ]; }; system.stateVersion = "23.05"; diff --git a/configs/wsl/home.nix b/configs/wsl/home.nix index a947db1..437b045 100644 --- a/configs/wsl/home.nix +++ b/configs/wsl/home.nix @@ -1,15 +1,13 @@ -{ inputs, ... }: +{ ... }: - { - imports = [ - ./../../home-manager/modules/machine.nix - ]; +{ + imports = [ ./../../home-manager/modules/machine.nix ]; - machine = { - username = "thilo"; - isGeneric = true; - isGnome = false; - noiseSuppression.enable = false; - isGraphical = false; - }; - } + machine = { + username = "thilo"; + isGeneric = true; + isGnome = false; + noiseSuppression.enable = false; + isGraphical = false; + }; +} diff --git a/flake.nix b/flake.nix index ac3cdc9..09bc6d9 100644 --- a/flake.nix +++ b/flake.nix @@ -2,12 +2,8 @@ description = "Nixos config"; inputs = { - nixpkgs = { - url = "github:NixOS/nixpkgs/nixos-unstable"; - }; - nixpkgs-update = { - url = "github:ryantm/nixpkgs-update"; - }; + nixpkgs = { url = "github:NixOS/nixpkgs/nixos-unstable"; }; + nixpkgs-update = { url = "github:ryantm/nixpkgs-update"; }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -20,19 +16,16 @@ muse-sounds-manager.url = "github:thilobillerbeck/muse-sounds-manager-nix"; }; - outputs = { self, nixpkgs, home-manager, nixgl, ... }@inputs: + outputs = { nixpkgs, home-manager, nixgl, ... }@inputs: let system = "x86_64-linux"; pkgs = import nixpkgs { system = "${system}"; overlays = [ nixgl.overlay ]; }; - in - { + in { nixConfig = { - extra-substituters = [ - "https://nix-community.cachix.org" - ]; + extra-substituters = [ "https://nix-community.cachix.org" ]; extra-trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; @@ -55,10 +48,11 @@ ]; specialArgs = { inherit inputs; }; }; - homeConfigurations."thilo@thilo-pc-win" = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = [ ./configs/wsl/home.nix ]; - extraSpecialArgs = { inherit inputs; }; - }; + homeConfigurations."thilo@thilo-pc-win" = + home-manager.lib.homeManagerConfiguration { + inherit pkgs; + modules = [ ./configs/wsl/home.nix ]; + extraSpecialArgs = { inherit inputs; }; + }; }; } diff --git a/home-manager/modules/machine.nix b/home-manager/modules/machine.nix index 9137ce7..96c74c0 100644 --- a/home-manager/modules/machine.nix +++ b/home-manager/modules/machine.nix @@ -1,6 +1,5 @@ { lib, pkgs, config, ... }: -with lib; -{ +with lib; { imports = [ ./../programs/alacritty.nix ./../programs/bat.nix @@ -70,8 +69,9 @@ with lib; include "/usr/share/nano/*.nanorc" ''; ".ssh/config_source" = { - source = ./../dotfiles/ssh-config; - onChange = ''cat ~/.ssh/config_source > ~/.ssh/config && chmod 600 ~/.ssh/config''; + source = ./../dotfiles/ssh-config; + onChange = + "cat ~/.ssh/config_source > ~/.ssh/config && chmod 600 ~/.ssh/config"; }; ".gitignore".source = ./../dotfiles/.gitignore; ".config/pipewire/pipewire.conf.d/99-noise-suppression.conf".text = '' diff --git a/home-manager/modules/packages.nix b/home-manager/modules/packages.nix index b1a99b8..97f7a40 100644 --- a/home-manager/modules/packages.nix +++ b/home-manager/modules/packages.nix @@ -2,128 +2,126 @@ with lib; let - electronFlags = "--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime --disable-gpu-shader-disk-cache -n"; + electronFlags = + "--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime --disable-gpu-shader-disk-cache -n"; in { config = { nixpkgs.overlays = [ - (final: prev: { + (_: prev: { quickemu = prev.quickemu.overrideAttrs (old: { - patches = (old.patches or [ ]) ++ [ - ./../patches/quickemu.patch - ]; + patches = (old.patches or [ ]) ++ [ ./../patches/quickemu.patch ]; }); }) ]; - home.packages = with pkgs; [ - up - htop - rustc - cargo - nixfmt - nodejs - bun - deno - devbox - tldr - flutter - nurl - hcloud - tea - dgraph - nix-init - nodePackages.nodemon - pocketbase - thefuck - hub - httpie - manix - (pkgs.writeShellScriptBin "ssh-fix-permissions" - (builtins.readFile ./../scripts/ssh-fix-permissions.sh)) - (pkgs.writeShellScriptBin "yt-dlp-audio" - (builtins.readFile ./../scripts/yt-dlp-audio.sh)) - (pkgs.writeShellScriptBin "nix-shell-init" - (builtins.readFile ./../scripts/nix-shell-init.sh)) - (pkgs.writeShellScriptBin "http-server" '' - ${pkgs.caddy}/bin/caddy file-server --listen :2345 - '') - (pkgs.writeShellScriptBin "nix-build-default" '' - nix-build -E 'with import { }; callPackage ./default.nix { }' - '') - (callPackage ./../pkgs/toggl-time-grouper/package.nix { - inherit lib; - }) - nixpkgs-fmt - toolbox - distrobox - ddev - act - mkcert - pulumi - kubectl - pulumiPackages.pulumi-language-nodejs - ncdu - inputs.devenv.packages.x86_64-linux.devenv - inputs.nixpkgs-update.packages.x86_64-linux.nixpkgs-update - inputs.dagger.packages.x86_64-linux.dagger - unzip - gh - nil - nixd - unrar - ] ++ (if config.machine.isGraphical then [ - (pkgs.nerdfonts.override { - fonts = [ "JetBrainsMono" "FiraCode" "FiraMono" ]; - }) - corefonts - vistafonts - jetbrains.webstorm - jetbrains.phpstorm - jetbrains.rust-rover - jetbrains.goland - element-desktop - ludusavi - dbeaver - insomnia - onlyoffice-bin - spotify - vesktop - (lutris.override { - extraLibraries = pkgs: [ - gnome3.adwaita-icon-theme - ]; - extraPkgs = pkgs: [ - wineWowPackages.full - winetricks - gnome3.adwaita-icon-theme - ]; - }) - bottles - protontricks - heroic - (vscode.override { commandLineArgs = electronFlags; }) - quickemu - quickgui - trilium-desktop - anki - inputs.muse-sounds-manager.packages.x86_64-linux.muse-sounds-manager - jetbrains-toolbox - mumble - prusa-slicer - trayscale - gnome.gnome-disk-utility - inkscape - musescore - obsidian - syncthingtray - reaper - yabridge - ] else [ ]) ++ (if config.machine.isGnome then [ - gnomeExtensions.blur-my-shell - gnomeExtensions.dash-to-panel - gnomeExtensions.user-themes - gnomeExtensions.vitals - gnomeExtensions.custom-accent-colors - ] else [ ]); + home.packages = with pkgs; + [ + up + htop + rustc + cargo + nixfmt + nodejs + bun + deno + devbox + tldr + flutter + nurl + hcloud + tea + dgraph + nix-init + nodePackages.nodemon + pocketbase + thefuck + hub + httpie + manix + (pkgs.writeShellScriptBin "ssh-fix-permissions" + (builtins.readFile ./../scripts/ssh-fix-permissions.sh)) + (pkgs.writeShellScriptBin "yt-dlp-audio" + (builtins.readFile ./../scripts/yt-dlp-audio.sh)) + (pkgs.writeShellScriptBin "nix-shell-init" + (builtins.readFile ./../scripts/nix-shell-init.sh)) + (pkgs.writeShellScriptBin "http-server" '' + ${pkgs.caddy}/bin/caddy file-server --listen :2345 + '') + (pkgs.writeShellScriptBin "nix-build-default" '' + nix-build -E 'with import { }; callPackage ./default.nix { }' + '') + (callPackage ./../pkgs/toggl-time-grouper/package.nix { inherit lib; }) + nixpkgs-fmt + toolbox + distrobox + ddev + act + mkcert + pulumi + kubectl + pulumiPackages.pulumi-language-nodejs + ncdu + inputs.devenv.packages.x86_64-linux.devenv + inputs.nixpkgs-update.packages.x86_64-linux.nixpkgs-update + inputs.dagger.packages.x86_64-linux.dagger + unzip + gh + nil + nixd + unrar + ] ++ (if config.machine.isGraphical then [ + (pkgs.nerdfonts.override { + fonts = [ "JetBrainsMono" "FiraCode" "FiraMono" ]; + }) + corefonts + vistafonts + jetbrains.webstorm + jetbrains.phpstorm + jetbrains.rust-rover + jetbrains.goland + element-desktop + ludusavi + dbeaver + insomnia + onlyoffice-bin + spotify + vesktop + (lutris.override { + extraLibraries = _: [ gnome3.adwaita-icon-theme ]; + extraPkgs = _: [ + wineWowPackages.full + winetricks + gnome3.adwaita-icon-theme + ]; + }) + bottles + protontricks + heroic + (vscode.override { commandLineArgs = electronFlags; }) + quickemu + quickgui + trilium-desktop + anki + inputs.muse-sounds-manager.packages.x86_64-linux.muse-sounds-manager + jetbrains-toolbox + mumble + prusa-slicer + trayscale + gnome.gnome-disk-utility + inkscape + musescore + obsidian + syncthingtray + reaper + yabridge + ] else + [ ]) ++ (if config.machine.isGnome then [ + gnomeExtensions.blur-my-shell + gnomeExtensions.dash-to-panel + gnomeExtensions.user-themes + gnomeExtensions.vitals + gnomeExtensions.custom-accent-colors + ] else + [ ]); }; } diff --git a/home-manager/pkgs/docker-craft-cms-dev-env.nix b/home-manager/pkgs/docker-craft-cms-dev-env.nix index 0717645..8a847f5 100644 --- a/home-manager/pkgs/docker-craft-cms-dev-env.nix +++ b/home-manager/pkgs/docker-craft-cms-dev-env.nix @@ -1,7 +1,4 @@ -{ lib -, stdenv -, fetchFromGitHub -}: +{ lib, stdenv, fetchFromGitHub }: stdenv.mkDerivation rec { pname = "docker-craft-cms-dev-env"; @@ -20,7 +17,8 @@ stdenv.mkDerivation rec { ''; meta = with lib; { - description = "Docker image for local development of sites based on Craft CMS"; + description = + "Docker image for local development of sites based on Craft CMS"; homepage = "https://github.com/codemonauts/docker-craft-cms-dev-env"; license = licenses.mit; maintainers = with maintainers; [ ]; diff --git a/home-manager/pkgs/spx-gc.nix b/home-manager/pkgs/spx-gc.nix index d1d4103..0ac131d 100644 --- a/home-manager/pkgs/spx-gc.nix +++ b/home-manager/pkgs/spx-gc.nix @@ -1,8 +1,4 @@ -{ lib -, stdenv -, buildNpmPackage -, fetchFromGitHub -}: +{ lib, buildNpmPackage, fetchFromGitHub }: buildNpmPackage rec { pname = "spx-gc"; @@ -25,7 +21,8 @@ buildNpmPackage rec { ''; meta = with lib; { - description = "SPX is a graphics control client for live video productions and live streams using CasparCG, OBS, vMix, or similar software"; + description = + "SPX is a graphics control client for live video productions and live streams using CasparCG, OBS, vMix, or similar software"; homepage = "https://github.com/TuomoKu/SPX-GC#npminstall"; license = licenses.mit; maintainers = with maintainers; [ ]; diff --git a/home-manager/pkgs/toggl-time-grouper/package.nix b/home-manager/pkgs/toggl-time-grouper/package.nix index 140b8bd..669ca70 100644 --- a/home-manager/pkgs/toggl-time-grouper/package.nix +++ b/home-manager/pkgs/toggl-time-grouper/package.nix @@ -1,7 +1,7 @@ -{ lib, python3Packages }: +{ python3Packages }: with python3Packages; buildPythonApplication { name = "toggl-time-grouper"; src = ./.; propagatedBuildInputs = [ pandas ]; -} \ No newline at end of file +} diff --git a/home-manager/programs/alacritty.nix b/home-manager/programs/alacritty.nix index 2f8a30f..5d93150 100644 --- a/home-manager/programs/alacritty.nix +++ b/home-manager/programs/alacritty.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ config, ... }: { programs.alacritty = { diff --git a/home-manager/programs/bat.nix b/home-manager/programs/bat.nix index 3ab65fb..7a2881c 100644 --- a/home-manager/programs/bat.nix +++ b/home-manager/programs/bat.nix @@ -1,5 +1 @@ -{ config, pkgs, lib, ... }: - -{ - programs.bat = { enable = true; }; -} +{ programs.bat = { enable = true; }; } diff --git a/home-manager/programs/beets.nix b/home-manager/programs/beets.nix index dcdba9b..a0717b8 100644 --- a/home-manager/programs/beets.nix +++ b/home-manager/programs/beets.nix @@ -1,5 +1,3 @@ -{ config, pkgs, lib, ... }: - { programs.beets = { enable = false; diff --git a/home-manager/programs/chromium.nix b/home-manager/programs/chromium.nix index 8755de6..8a6230b 100644 --- a/home-manager/programs/chromium.nix +++ b/home-manager/programs/chromium.nix @@ -22,30 +22,23 @@ let isEnabled = if config.machine.isGraphical then true else false; dictionaries = with pkgs.hunspellDictsChromium; [ en_US de_DE ]; commandLineArgs = [ - "--ignore-gpu-blocklist" - "--enable-gpu-rasterization" - "--enable-zero-copy" - "--enable-features=VaapiVideoDecoder,VaapiVideoEncoder,WebRTCPipeWireCapturer" - "--disable-features=UseChromeOSDirectVideoDecoder" - "--use-vulkan" - "--ozone-platform-hint=auto" - "--enable-hardware-overlays" + "--ignore-gpu-blocklist" + "--enable-gpu-rasterization" + "--enable-zero-copy" + "--enable-features=VaapiVideoDecoder,VaapiVideoEncoder,WebRTCPipeWireCapturer" + "--disable-features=UseChromeOSDirectVideoDecoder" + "--use-vulkan" + "--ozone-platform-hint=auto" + "--enable-hardware-overlays" ]; - extensions = map - (eid: { - id = eid; - }) - chromium_extension; -in -{ + extensions = map (eid: { id = eid; }) chromium_extension; +in { programs.chromium = { + inherit dictionaries commandLineArgs extensions; enable = isEnabled; - dictionaries = dictionaries; - commandLineArgs = commandLineArgs; - extensions = extensions; }; programs.google-chrome = { + inherit commandLineArgs; enable = isEnabled; - commandLineArgs = commandLineArgs; }; } diff --git a/home-manager/programs/command-not-found.nix b/home-manager/programs/command-not-found.nix index e7a01be..b38008d 100644 --- a/home-manager/programs/command-not-found.nix +++ b/home-manager/programs/command-not-found.nix @@ -1,5 +1 @@ -{ config, pkgs, lib, ... }: - -{ - programs.command-not-found = { enable = true; }; -} +{ programs.command-not-found = { enable = true; }; } diff --git a/home-manager/programs/dircolors.nix b/home-manager/programs/dircolors.nix index 1776ee7..9e9545c 100644 --- a/home-manager/programs/dircolors.nix +++ b/home-manager/programs/dircolors.nix @@ -1,5 +1,3 @@ -{ config, pkgs, lib, ... }: - { programs.dircolors = { enable = true; diff --git a/home-manager/programs/direnv.nix b/home-manager/programs/direnv.nix index 4831772..2b51c9d 100644 --- a/home-manager/programs/direnv.nix +++ b/home-manager/programs/direnv.nix @@ -1,5 +1,3 @@ -{ config, pkgs, lib, ... }: - { programs.direnv = { enable = true; diff --git a/home-manager/programs/firefox.nix b/home-manager/programs/firefox.nix index bc39a97..ef4e59c 100644 --- a/home-manager/programs/firefox.nix +++ b/home-manager/programs/firefox.nix @@ -4,4 +4,4 @@ programs.firefox = { enable = if config.machine.isGraphical then true else false; }; -} \ No newline at end of file +} diff --git a/home-manager/programs/fzf.nix b/home-manager/programs/fzf.nix index 6a1e4bb..983fc8d 100644 --- a/home-manager/programs/fzf.nix +++ b/home-manager/programs/fzf.nix @@ -1,5 +1,3 @@ -{ config, pkgs, lib, ... }: - { programs.fzf = { enable = true; diff --git a/home-manager/programs/git.nix b/home-manager/programs/git.nix index f649e00..b71b072 100644 --- a/home-manager/programs/git.nix +++ b/home-manager/programs/git.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ pkgs, ... }: { programs.git = { @@ -27,7 +27,5 @@ branch = { autosetuprebase = "always"; }; }; }; - programs.git-credential-oauth = { - enable = true; - }; + programs.git-credential-oauth = { enable = true; }; } diff --git a/home-manager/programs/go.nix b/home-manager/programs/go.nix index e60d83d..91d9225 100644 --- a/home-manager/programs/go.nix +++ b/home-manager/programs/go.nix @@ -1,7 +1 @@ -{ config, pkgs, lib, ... }: - -{ - programs.go = { - enable = true; - }; -} +{ programs.go = { enable = true; }; } diff --git a/home-manager/programs/hstr.nix b/home-manager/programs/hstr.nix index c5e521d..08b4ba7 100644 --- a/home-manager/programs/hstr.nix +++ b/home-manager/programs/hstr.nix @@ -1,5 +1 @@ -{ config, pkgs, lib, ... }: - -{ - programs.hstr = { enable = true; }; -} +{ programs.hstr = { enable = true; }; } diff --git a/home-manager/programs/htop.nix b/home-manager/programs/htop.nix index fd171d8..9c98830 100644 --- a/home-manager/programs/htop.nix +++ b/home-manager/programs/htop.nix @@ -1,5 +1,3 @@ -{ config, pkgs, lib, ... }: - { programs.htop = { enable = true; diff --git a/home-manager/programs/mpv.nix b/home-manager/programs/mpv.nix index ac7b2a0..fc5b54a 100644 --- a/home-manager/programs/mpv.nix +++ b/home-manager/programs/mpv.nix @@ -5,4 +5,4 @@ enable = if config.machine.isGraphical then true else false; scripts = with pkgs.mpvScripts; [ autoload mpris sponsorblock ]; }; -} \ No newline at end of file +} diff --git a/home-manager/programs/neovim.nix b/home-manager/programs/neovim.nix index 2f6921d..5d322e6 100644 --- a/home-manager/programs/neovim.nix +++ b/home-manager/programs/neovim.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ pkgs, ... }: { programs.neovim = { diff --git a/home-manager/programs/starship.nix b/home-manager/programs/starship.nix index febafa2..d7e4461 100644 --- a/home-manager/programs/starship.nix +++ b/home-manager/programs/starship.nix @@ -1,5 +1,3 @@ -{ config, pkgs, lib, ... }: - { programs.starship = { enable = true; diff --git a/home-manager/programs/syncthing.nix b/home-manager/programs/syncthing.nix index 18a00d6..66ea77d 100644 --- a/home-manager/programs/syncthing.nix +++ b/home-manager/programs/syncthing.nix @@ -1,7 +1 @@ -{ config, pkgs, lib, ... }: - -{ - services.syncthing = { - enable = true; - }; -} +{ services.syncthing = { enable = true; }; } diff --git a/home-manager/programs/topgrade.nix b/home-manager/programs/topgrade.nix index da8f75e..c496e07 100644 --- a/home-manager/programs/topgrade.nix +++ b/home-manager/programs/topgrade.nix @@ -1,7 +1,10 @@ -{ config, pkgs, lib, ... }: +{ config, ... }: let - configPath = if config.machine.isGeneric then "${config.home.homeDirectory}/.config/home-manager" else "${config.home.homeDirectory}/.nixos-config"; + configPath = if config.machine.isGeneric then + "${config.home.homeDirectory}/.config/home-manager" + else + "${config.home.homeDirectory}/.nixos-config"; in { programs.topgrade = { enable = true; @@ -13,18 +16,13 @@ in { pre_sudo = false; cleanup = true; skip_notify = true; - disable = [ - "bun" - "tldr" - "flutter" - ]; + disable = [ "bun" "tldr" "flutter" ]; }; - git.repos = [ - configPath - ]; + git.repos = [ configPath ]; firmware = { upgrade = true; }; pre_commands = { - flakeUpgrade = "cd ${configPath} && nix flake update --commit-lock-file --verbose --repair"; + flakeUpgrade = + "cd ${configPath} && nix flake update --commit-lock-file --verbose --repair"; }; }; }; diff --git a/home-manager/programs/yt-dlp.nix b/home-manager/programs/yt-dlp.nix index 4f0c5ae..d995c24 100644 --- a/home-manager/programs/yt-dlp.nix +++ b/home-manager/programs/yt-dlp.nix @@ -1,6 +1,2 @@ -{ config, pkgs, lib, ... }: - -{ - programs.yt-dlp = { enable = true; }; -} +{ programs.yt-dlp = { enable = true; }; } diff --git a/home-manager/programs/zsh.nix b/home-manager/programs/zsh.nix index afb3f9b..9f6d2ab 100644 --- a/home-manager/programs/zsh.nix +++ b/home-manager/programs/zsh.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ pkgs, ... }: let omz-plugins = [ "git" diff --git a/home-manager/wrappers/fedora.nix b/home-manager/wrappers/fedora.nix index 68ba814..d5a92f2 100644 --- a/home-manager/wrappers/fedora.nix +++ b/home-manager/wrappers/fedora.nix @@ -1,5 +1,4 @@ - -{ config, pkgs, lib, ... }: +{ pkgs, lib, ... }: let chromeArgs = lib.strings.concatStringsSep " " [ @@ -16,15 +15,15 @@ let "--ozone-platform-hint=auto" "--enable-features=WaylandWindowDecorations" ]; - code-wrapper = (pkgs.writeShellScriptBin "code" '' + code-wrapper = pkgs.writeShellScriptBin "code" '' exec /usr/bin/code ${codeArgs} "$@" - ''); - chrome-wrapper = (pkgs.writeShellScriptBin "google-chrome" '' + ''; + chrome-wrapper = pkgs.writeShellScriptBin "google-chrome" '' exec /usr/bin/google-chrome ${chromeArgs} "$@" - ''); - chrome-stable-wrapper = (pkgs.writeShellScriptBin "google-chrome-stable" '' + ''; + chrome-stable-wrapper = pkgs.writeShellScriptBin "google-chrome-stable" '' exec /usr/bin/google-chrome-stable ${chromeArgs} "$@" - ''); + ''; in { home.packages = with pkgs; [ code-wrapper @@ -202,7 +201,7 @@ in { Name[vi]=Cửa sổ Mới Name[zh_CN]=新建窗口 Name[zh_TW]=開新視窗 - Exec=/usr/bin/google-chrome-stable ${chromeArgs} + Exec=/usr/bin/google-chrome-stable ${chromeArgs} [Desktop Action new-private-window] Name=New Incognito Window diff --git a/home-manager/wrappers/vscode.nix b/home-manager/wrappers/vscode.nix deleted file mode 100644 index e69de29..0000000 diff --git a/nix.nix b/nix.nix index 586ac94..3272c63 100644 --- a/nix.nix +++ b/nix.nix @@ -8,18 +8,15 @@ sandbox = relaxed ''; settings = { - trusted-users = [ - "root" - "thilo" - ]; + trusted-users = [ "root" "thilo" ]; trusted-substituters = [ - "https://cache.nixos.org" + "https://cache.nixos.org" "https://nix-community.cachix.org" "https://nixpkgs-update.cachix.org" "https://devenv.cachix.org" ]; trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nixpkgs-update.cachix.org-1:6y6Z2JdoL3APdu6/+Iy8eZX2ajf09e4EE9SnxSML1W8=" "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" diff --git a/nixos/common.nix b/nixos/common.nix index b56804e..507183f 100644 --- a/nixos/common.nix +++ b/nixos/common.nix @@ -1,31 +1,22 @@ -{ config -, pkgs -, lib -, inputs -, ... -}: +{ config, pkgs, lib, inputs, ... }: { - imports = [ - ./../nix.nix - ]; + imports = [ ./../nix.nix ]; nix = { # This will add each flake input as a registry # To make nix3 commands consistent with your flake - registry = lib.mapAttrs (_: value: {flake = value;}) inputs; + registry = lib.mapAttrs (_: value: { flake = value; }) inputs; # This will additionally add your inputs to the system's legacy channels # Making legacy nix commands consistent as well, awesome! - nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; + nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") + config.nix.registry; }; nixpkgs = { config = { - permittedInsecurePackages = [ - "electron-24.8.6" - "electron-25.9.0" - ]; + permittedInsecurePackages = [ "electron-24.8.6" "electron-25.9.0" ]; allowUnfree = true; }; }; @@ -44,7 +35,7 @@ LC_TIME = "de_DE.UTF-8"; }; - users.users.thilo = { + users.users.thilo = { uid = 1000; description = "Thilo Billerbeck"; shell = pkgs.zsh; @@ -85,12 +76,7 @@ noisetorch.enable = true; }; - environment.systemPackages = with pkgs; [ - git - zsh - kitty - steamtinkerlaunch - ]; + environment.systemPackages = with pkgs; [ git zsh kitty steamtinkerlaunch ]; networking.networkmanager.enable = true; @@ -103,9 +89,7 @@ pulse.enable = true; jack.enable = true; }; - tailscale = { - enable = true; - }; + tailscale = { enable = true; }; flatpak.enable = true; avahi = { enable = true; @@ -117,13 +101,17 @@ }; }; - hardware.opengl.driSupport = true; - hardware.opengl.driSupport32Bit = true; + hardware = { + pulseaudio.enable = false; + opengl = { + driSupport = true; + driSupport32Bit = true; + }; + }; security.polkit.enable = true; sound.enable = true; - hardware.pulseaudio.enable = false; security.rtkit.enable = true; time.hardwareClockInLocalTime = true; -} \ No newline at end of file +}