From 517df8e725c388adda8ef39e1b7f7392998ea954 Mon Sep 17 00:00:00 2001 From: KoenDR06 Date: Tue, 2 Apr 2024 20:37:37 +0000 Subject: [PATCH] I can't keep writing these comments, they're boring --- home-manager/apps.nix | 18 ++++--- home-manager/gnome.nix | 5 +- machines/luna/configuration.nix | 56 ++------------------- machines/solis/configuration.nix | 2 + machines/terra/configuration.nix | 85 ++------------------------------ machines/terra/refind.nix | 13 +++++ pkgs/firefox.nix | 24 +++++++++ 7 files changed, 60 insertions(+), 143 deletions(-) create mode 100644 machines/terra/refind.nix create mode 100644 pkgs/firefox.nix diff --git a/home-manager/apps.nix b/home-manager/apps.nix index 0041dfb..b003c7f 100644 --- a/home-manager/apps.nix +++ b/home-manager/apps.nix @@ -46,6 +46,7 @@ spotify tailscale whatsapp-for-linux + zsh zoxide ]; @@ -55,15 +56,16 @@ userName = "KoenDR06"; userEmail = "koen.de.ruiter@hotmail.com"; }; - programs.firefox.enable = true; + programs.gh.enable = true; - programs.zsh = { - oh-my-zsh = { - enable = true; - plugins = [ "git" ]; - theme = "agnoster"; - }; - }; +# programs.zsh = { +# enable = true; +# oh-my-zsh = { +# enable = true; +# plugins = [ "git" ]; +# theme = "agnoster"; +# }; +# }; # Nicely reload system units when changing configs systemd.user.startServices = "sd-switch"; diff --git a/home-manager/gnome.nix b/home-manager/gnome.nix index f1aa34f..00c0b1e 100644 --- a/home-manager/gnome.nix +++ b/home-manager/gnome.nix @@ -50,6 +50,7 @@ "window-list@gnome-shell-extensions.gcampax.github.com" "auto-move-windows@gnome-shell-extensions.gcampax.github.com" ]; + disable-user-extensions = false; }; "org/gnome/shell/extensions/just-perfection" = { @@ -103,6 +104,8 @@ }; "org/gnome/desktop/wm/keybindings" = { + switch-applications = "@as []"; + switch-applications-backward = "@as []"; switch-windows = ["Tab"]; switch-windows-backward = ["Tab"]; minimize = ["Down"]; @@ -111,8 +114,6 @@ panel-run-dialog = ["F2"]; switch-to-workspace-left = ["Left"]; switch-to-workspace-right = ["Right"]; - switch-applications = "@as []"; - switch-applications-backward = "@as []"; }; "org/gnome/settings-daemon/plugins/media-keys" = { diff --git a/machines/luna/configuration.nix b/machines/luna/configuration.nix index 1f2d278..9a7ab4c 100644 --- a/machines/luna/configuration.nix +++ b/machines/luna/configuration.nix @@ -1,6 +1,3 @@ - -# This is your system's configuration file. -# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) { inputs, outputs, @@ -9,63 +6,32 @@ pkgs, ... }: { - # You can import other NixOS modules here imports = [ - # If you want to use modules your own flake exports (from modules/nixos): - # outputs.nixosModules.example - - # Or modules from other flakes (such as nixos-hardware): - # inputs.hardware.nixosModules.common-cpu-amd - # inputs.hardware.nixosModules.common-ssd - - # You can also split up your configuration and import pieces of it here: - # ./users.nix - - # Import your generated (nixos-generate-config) hardware configuration inputs.home-manager.nixosModules.home-manager ./hardware-configuration.nix + ../../pkgs/firefox.nix ]; - home-manager = { extraSpecialArgs = { inherit inputs outputs; }; users = { - # Import your home-manager configuration horseman = import ../../home-manager/apps.nix; }; }; nixpkgs = { - # You can add overlays here overlays = [ - # Add overlays your own flake exports (from overlays and pkgs dir): outputs.overlays.additions outputs.overlays.modifications outputs.overlays.unstable-packages - - # You can also add overlays exported from other flakes: - # neovim-nightly-overlay.overlays.default - - # Or define it inline, for example: - # (final: prev: { - # hi = final.hello.overrideAttrs (oldAttrs: { - # patches = [ ./change-hello-to-hi.patch ]; - # }); - # }) ]; - # Configure your nixpkgs instance config = { - # Disable if you don't want unfree packages allowUnfree = true; }; }; - # This will add each flake input as a registry - # To make nix3 commands consistent with your flake nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs); - # This will additionally add your inputs to the system's legacy channels - # Making legacy nix commands consistent as well, awesome! nix.nixPath = ["/etc/nix/path"]; environment.etc = lib.mapAttrs' @@ -76,48 +42,32 @@ config.nix.registry; nix.settings = { - # Enable flakes and new 'nix' command experimental-features = "nix-command flakes"; - # Deduplicate and optimize nix store auto-optimise-store = true; }; networking.hostName = "luna"; - # time.timeZone = "Europe/Amsterdam"; - - # i18n.defaultLocale = "en_US.UTF-8"; - services.xserver.enable = true; services.xserver.desktopManager.gnome.enable = true; services.xserver.displayManager.gdm.enable = true; boot.loader.systemd-boot.enable = true; + environment.shells = with pkgs; [ zsh ]; - # TODO: Configure your system-wide user settings (groups, etc), add more users as needed. users.users = { horseman = { - # TODO: You can set an initial password for your user. - # If you do, you can skip setting a root password by passing '--no-root-passwd' to nixos-install. - # Be sure to change it (using passwd) after rebooting! initialPassword = "1234"; isNormalUser = true; - openssh.authorizedKeys.keys = [ - # TODO: Add your SSH public key(s) here, if you plan on using SSH to connect - ]; - # TODO: Be sure to add any other groups you need (such as networkmanager, audio, docker, etc) + openssh.authorizedKeys.keys = []; extraGroups = ["wheel"]; }; }; - # This setups a SSH server. Very important if you're setting up a headless system. - # Feel free to remove if you don't need it. services.openssh = { enable = true; settings = { - # Forbid root login through SSH. PermitRootLogin = "no"; - # Use keys only. Remove if you want to SSH using password (not recommended) PasswordAuthentication = false; }; }; diff --git a/machines/solis/configuration.nix b/machines/solis/configuration.nix index f86d70a..2815382 100644 --- a/machines/solis/configuration.nix +++ b/machines/solis/configuration.nix @@ -51,6 +51,8 @@ boot.loader.grub.device = "/dev/sda"; boot.loader.grub.useOSProber = true; + environment.shells = with pkgs; [ zsh ]; + virtualisation.docker.enable = true; services.tailscale.enable = true; diff --git a/machines/terra/configuration.nix b/machines/terra/configuration.nix index 2073d7b..1be5bef 100644 --- a/machines/terra/configuration.nix +++ b/machines/terra/configuration.nix @@ -1,5 +1,3 @@ -# This is your system's configuration file. -# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) { inputs, outputs, @@ -8,107 +6,49 @@ pkgs, ... }: { - # You can import other NixOS modules here imports = [ - # If you want to use modules your own flake exports (from modules/nixos): - # outputs.nixosModules.example - - # Or modules from other flakes (such as nixos-hardware): - # inputs.hardware.nixosModules.common-cpu-amd - # inputs.hardware.nixosModules.common-ssd - - # You can also split up your configuration and import pieces of it here: - # ./users.nix - - # Import your generated (nixos-generate-config) hardware configuration inputs.home-manager.nixosModules.home-manager ./hardware-configuration.nix + ./refind.nix + ../../pkgs/firefox.nix ]; # NVIDIA Drivers - # Enable OpenGL hardware.opengl = { enable = true; driSupport = true; driSupport32Bit = true; }; - - # Load nvidia driver for Xorg and Wayland services.xserver.videoDrivers = ["nvidia"]; # or "nvidiaLegacy470 etc. - hardware.nvidia = { - - # Modesetting is required. modesetting.enable = true; - - # Nvidia power management. Experimental, and can cause sleep/suspend to fail. - # Enable this if you have graphical corruption issues or application crashes after waking - # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead - # of just the bare essentials. powerManagement.enable = false; - - # Fine-grained power management. Turns off GPU when not in use. - # Experimental and only works on modern Nvidia GPUs (Turing or newer). powerManagement.finegrained = false; - - # Use the NVidia open source kernel module (not to be confused with the - # independent third-party "nouveau" open source driver). - # Support is limited to the Turing and later architectures. Full list of - # supported GPUs is at: - # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus - # Only available from driver 515.43.04+ - # Currently alpha-quality/buggy, so false is currently the recommended setting. open = false; - - # Enable the Nvidia settings menu, - # accessible via `nvidia-settings`. nvidiaSettings = true; - - # Optionally, you may need to select the appropriate driver version for your specific GPU. package = config.boot.kernelPackages.nvidiaPackages.stable; }; - - home-manager = { extraSpecialArgs = { inherit inputs outputs; }; users = { - # Import your home-manager configuration horseman = import ../../home-manager/apps.nix; }; }; nixpkgs = { - # You can add overlays here overlays = [ - # Add overlays your own flake exports (from overlays and pkgs dir): outputs.overlays.additions outputs.overlays.modifications outputs.overlays.unstable-packages - - # You can also add overlays exported from other flakes: - # neovim-nightly-overlay.overlays.default - - # Or define it inline, for example: - # (final: prev: { - # hi = final.hello.overrideAttrs (oldAttrs: { - # patches = [ ./change-hello-to-hi.patch ]; - # }); - # }) ]; - # Configure your nixpkgs instance config = { - # Disable if you don't want unfree packages allowUnfree = true; }; }; - # This will add each flake input as a registry - # To make nix3 commands consistent with your flake nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs); - # This will additionally add your inputs to the system's legacy channels - # Making legacy nix commands consistent as well, awesome! nix.nixPath = ["/etc/nix/path"]; environment.etc = lib.mapAttrs' @@ -119,47 +59,32 @@ config.nix.registry; nix.settings = { - # Enable flakes and new 'nix' command experimental-features = "nix-command flakes"; - # Deduplicate and optimize nix store auto-optimise-store = true; }; networking.hostName = "terra"; - # time.timeZone = "Europe/Amsterdam"; - - # i18n.defaultLocale = "en_US.UTF-8"; - services.xserver.enable = true; services.xserver.desktopManager.gnome.enable = true; services.xserver.displayManager.gdm.enable = true; boot.loader.systemd-boot.enable = true; - # TODO: Configure your system-wide user settings (groups, etc), add more users as needed. + environment.shells = with pkgs; [ zsh ]; + users.users = { horseman = { - # TODO: You can set an initial password for your user. - # If you do, you can skip setting a root password by passing '--no-root-passwd' to nixos-install. - # Be sure to change it (using passwd) after rebooting! initialPassword = "1234"; isNormalUser = true; - openssh.authorizedKeys.keys = [ - # TODO: Add your SSH public key(s) here, if you plan on using SSH to connect - ]; - # TODO: Be sure to add any other groups you need (such as networkmanager, audio, docker, etc) + openssh.authorizedKeys.keys = []; extraGroups = ["wheel"]; }; }; - # This setups a SSH server. Very important if you're setting up a headless system. - # Feel free to remove if you don't need it. services.openssh = { enable = true; settings = { - # Forbid root login through SSH. PermitRootLogin = "no"; - # Use keys only. Remove if you want to SSH using password (not recommended) PasswordAuthentication = false; }; }; diff --git a/machines/terra/refind.nix b/machines/terra/refind.nix new file mode 100644 index 0000000..cdefb1d --- /dev/null +++ b/machines/terra/refind.nix @@ -0,0 +1,13 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: { + environment.systemPackages = [ + pkgs.refind + pkgs.efibootmgr + ]; +} diff --git a/pkgs/firefox.nix b/pkgs/firefox.nix new file mode 100644 index 0000000..4b3ed03 --- /dev/null +++ b/pkgs/firefox.nix @@ -0,0 +1,24 @@ +{ + config, + pkgs, + ... +}: { + programs.firefox = { + enable = true; + policies = { + ExtensionSettings = { + "*".installation_mode = "blocked"; + # uBlock Origin: + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "force_installed"; + }; + # Bitwarden + "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi"; + installation_mode = "force_installed"; + }; + }; + }; + }; +}