From 59a0227a665b1fb835af3fadcbe6e973b35119d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Fri, 1 Mar 2024 09:44:34 +0100 Subject: [PATCH] Add another host for work laptop --- flake.nix | 15 +++++-- hosts/magicman/configuration.nix | 77 ++++++++++++++++++++++++++++++++ hosts/magicman/default.nix | 8 ++++ 3 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 hosts/magicman/configuration.nix create mode 100644 hosts/magicman/default.nix diff --git a/flake.nix b/flake.nix index 3219adf..67f208b 100644 --- a/flake.nix +++ b/flake.nix @@ -15,10 +15,17 @@ user = "torjus"; in { - nixosConfigurations.prismo = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs self user; }; - modules = [ ./hosts/prismo ]; + nixosConfigurations = { + prismo = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs self user; }; + modules = [ ./hosts/prismo ]; + }; + magicman = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs self user; }; + modules = [ ./hosts/magicman ]; + }; }; }; } diff --git a/hosts/magicman/configuration.nix b/hosts/magicman/configuration.nix new file mode 100644 index 0000000..5438adf --- /dev/null +++ b/hosts/magicman/configuration.nix @@ -0,0 +1,77 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ ./hardware-configuration.nix ]; + + # Bootloader stuff + boot.kernelParams = [ + "quiet" + "splash" + "rd.systemd.show_status=false" + ]; + boot.loader.systemd-boot = { enable = true; }; + boot.loader.efi = { canTouchEfiVariables = true; }; + + # Networking stuff + networking.hostName = "magicman"; # Define your hostname. + networking.networkmanager.enable = true; + + # Set time stuff + time.timeZone = "Europe/Oslo"; + + # Enable opengl + hardware.opengl = { + enable = true; + extraPackages = with pkgs; [ + intel-media-driver + vaapiVdpau + libvdpau-va-gl + ]; + }; + + # Setup hyprland + services.xserver.enable = true; + programs.hyprland = { + enable = true; + xwayland.enable = true; + portalPackage = pkgs.xdg-desktop-portal-hyprland; + }; + + # Setup common XDG env vars + environment.sessionVariables = rec { + XDG_CACHE_HOME = "$HOME/.cache"; + XDG_CONFIG_HOME = "$HOME/.config"; + XDG_DATA_HOME = "$HOME/.local/share"; + XDG_STATE_HOME = "$HOME/.local/state"; + XDG_BIN_HOME = "$HOME/.local/bin"; + PATH = [ "${XDG_BIN_HOME}" ]; + }; + + # Setup xdg portal + xdg.portal = { + enable = true; + xdgOpenUsePortal = true; + extraPortals = (with pkgs; [ + xdg-desktop-portal-hyprland + xdg-desktop-portal-gtk + ]); + }; + + # Enable flakes + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + nixpkgs.config.allowUnfree = true; + # Install system-wide packages + environment.systemPackages = with pkgs; [ + vim + wget + curl + git + ]; + + # 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 = "23.11"; # Did you read the comment? +} diff --git a/hosts/magicman/default.nix b/hosts/magicman/default.nix new file mode 100644 index 0000000..f39e696 --- /dev/null +++ b/hosts/magicman/default.nix @@ -0,0 +1,8 @@ +{ inputs, self, pks, ... }: { + imports = [ + ./configuration.nix + ./hardware-configuration.nix + ../../system + ../../home + ]; +}