From a1fcb935075c3f0f8192641fbdaaafaa3347d529 Mon Sep 17 00:00:00 2001 From: Kabbone Date: Sat, 1 Oct 2022 14:01:15 +0200 Subject: [PATCH] various things, e.g. add authorized keys --- flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++-- hosts/configuration.nix | 21 +++++++++++---------- hosts/default.nix | 7 ++++--- hosts/laptop/hardware-configuration.nix | 9 +++++++-- modules/desktop/hyprland/default.nix | 10 +++++++++- modules/desktop/hyprland/home.nix | 4 +--- 7 files changed, 52 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index ede333e..f980054 100644 --- a/flake.lock +++ b/flake.lock @@ -42,6 +42,22 @@ "type": "github" } }, + "nixos-hardware": { + "locked": { + "lastModified": 1664452918, + "narHash": "sha256-SfnQ2t5b9RTSIqO3PQBDlwrWn4l3t0F65sZtCKTl8eA=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "12f905b731494bc59010f05a7467df8abdcf8d63", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1663850217, @@ -77,6 +93,7 @@ "inputs": { "home-manager": "home-manager", "hyprland": "hyprland", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nur": "nur" } diff --git a/flake.nix b/flake.nix index c815c3a..fec720b 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,7 @@ inputs = # All flake references used to build my NixOS setup. These are dependencies. { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # Nix Packages + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; home-manager = { # User Package Management url = "github:nix-community/home-manager"; @@ -28,7 +29,7 @@ }; }; - outputs = inputs @ { self, nixpkgs, home-manager, nur, hyprland, ... }: # Function that tells my flake which to use and what do what to do with the dependencies. + outputs = inputs @ { self, nixpkgs, nixos-hardware, home-manager, nur, hyprland, ... }: # Function that tells my flake which to use and what do what to do with the dependencies. let # Variables that can be used in the config files user = "kabbone"; location = "$HOME/.setup"; @@ -37,7 +38,7 @@ nixosConfigurations = ( # NixOS configurations import ./hosts { # Imports ./hosts/default.nix inherit (nixpkgs) lib; - inherit inputs nixpkgs home-manager nur user location hyprland; # Also inherit home-manager so it does not need to be defined here. + inherit inputs nixpkgs nixos-hardware home-manager nur user location hyprland; # Also inherit home-manager so it does not need to be defined here. } ); }; diff --git a/hosts/configuration.nix b/hosts/configuration.nix index aeeadb3..a9a5a97 100644 --- a/hosts/configuration.nix +++ b/hosts/configuration.nix @@ -24,12 +24,12 @@ shell = pkgs.zsh; # Default shell uid = 2000; # initialPassword = "password95"; -# openssh.authorizedKeys = [ -# "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIANmaraVJ/o20c4dqVnGLp/wGck9QNHFPvO9jcEbKS29AAAABHNzaDo= kabbone@kabc" -# "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIIgo4IP8ISUohyAMiDc3zEe6ESUE3un7eN5FhVtxZHmcAAAABHNzaDo= kabbone@kabc" -# "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIKVDApb3vZ+i97V4xLJh8rUF6z5OVYfORlXYbLhdQO15AAAABHNzaDo= kabbone@hades.home.opel-online.de" -# "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIB0q++epdX7feQxvmC2m/CJEoJbkqtAJy6Ml6WKHxryZAAAABHNzaDo= kabbone@hades.home.opel-online.de" -# ]; + openssh.authorizedKeys.keys = [ + "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIANmaraVJ/o20c4dqVnGLp/wGck9QNHFPvO9jcEbKS29AAAABHNzaDo= kabbone@kabc" + "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIIgo4IP8ISUohyAMiDc3zEe6ESUE3un7eN5FhVtxZHmcAAAABHNzaDo= kabbone@kabc" + "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIKVDApb3vZ+i97V4xLJh8rUF6z5OVYfORlXYbLhdQO15AAAABHNzaDo= kabbone@hades.home.opel-online.de" + "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIB0q++epdX7feQxvmC2m/CJEoJbkqtAJy6Ml6WKHxryZAAAABHNzaDo= kabbone@hades.home.opel-online.de" + ]; }; #security.sudo.wheelNeedsPassword = true; # User does not need to give password when using sudo. @@ -119,14 +119,15 @@ # generating a key: # - $ ssh-keygen | ssh-copy-id | ssh-add # - if ssh-add does not work: $ eval `ssh-agent -s` - allowSFTP = true; # SFTP: secure file transfer protocol (send file to server) +# allowSFTP = true; # SFTP: secure file transfer protocol (send file to server) # connect: $ sftp @ # commands: # - lpwd & pwd = print (local) parent working directory # - put/get = send or receive file - extraConfig = '' - HostKeyAlgorithms +ssh-rsa - ''; # Temporary extra config so ssh will work in guacamole +# extraConfig = '' +# HostKeyAlgorithms +ssh-rsa +# ''; # Temporary extra config so ssh will work in guacamole + passwordAuthentication = false; }; #flatpak.enable = true; # download flatpak file from website - sudo flatpak install - reboot if not showing up # sudo flatpak uninstall --delete-data (> flatpak list --app) - flatpak uninstall --unused diff --git a/hosts/default.nix b/hosts/default.nix index 9aabf90..5fd2c89 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -11,7 +11,7 @@ # └─ ./home.nix # -{ lib, inputs, nixpkgs, home-manager, nur, user, location, hyprland, ... }: +{ lib, inputs, nixpkgs, nixos-hardware, home-manager, nur, user, location, hyprland, ... }: let system = "x86_64-linux"; # System architecture @@ -46,18 +46,19 @@ in laptop = lib.nixosSystem { # Laptop profile inherit system; - specialArgs = { inherit inputs user location hyprland; }; + specialArgs = { inherit inputs user location hyprland nixos-hardware; }; modules = [ hyprland.nixosModules.default ./laptop ./configuration.nix + nixos-hardware.nixosModules.common-cpu-intel home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit user; }; home-manager.users.${user} = { - imports = [(import ./home.nix)] ++ [(import ./laptop/home.nix)]; + imports = [(import ./home.nix)] ++ [(import ./laptop/home.nix)]; }; } ]; diff --git a/hosts/laptop/hardware-configuration.nix b/hosts/laptop/hardware-configuration.nix index 1950aee..73cc41e 100644 --- a/hosts/laptop/hardware-configuration.nix +++ b/hosts/laptop/hardware-configuration.nix @@ -28,8 +28,13 @@ options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@" ]; }; - boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/75eccc7f-30b0-4fe8-8f82-90edaf284cd5"; - boot.initrd.luks.fido2Support = true; + boot.initrd.luks = { + fido2Support = true; + devices."root" = { + device = "/dev/disk/by-uuid/75eccc7f-30b0-4fe8-8f82-90edaf284cd5"; + allowDiscards = true; + }; + }; fileSystems."/home" = { device = "/dev/mapper/root"; diff --git a/modules/desktop/hyprland/default.nix b/modules/desktop/hyprland/default.nix index f9d830b..3902fe1 100644 --- a/modules/desktop/hyprland/default.nix +++ b/modules/desktop/hyprland/default.nix @@ -16,7 +16,15 @@ { imports = [ ../../programs/waybar.nix ]; - hardware.opengl.enable = true; + hardware.opengl = { + enable = true; + extraPackages = with pkgs; [ + intel-media-driver # LIBVA_DRIVER_NAME=iHD + vaapiIntel + libvdpau-va-gl + libva-utils + ]; + }; environment = { loginShellInit = '' diff --git a/modules/desktop/hyprland/home.nix b/modules/desktop/hyprland/home.nix index a80171e..91be06a 100644 --- a/modules/desktop/hyprland/home.nix +++ b/modules/desktop/hyprland/home.nix @@ -51,17 +51,15 @@ repeat_delay=250 numlock_by_default=0 force_no_accel=1 - sensitivity=1 + sensitivity=0 touchpad { disable_while_typing=1 natural_scroll=0 } - workspace_swipe=1 } dwindle { pseudotile=0 } - no_vfr=0 bind=SUPER,Return,exec,${pkgs.alacritty}/bin/alacritty bind=SUPER,Q,killactive, bind=SUPER,Escape,exit,