diff --git a/flake.nix b/flake.nix index ca4db6e..9466fd5 100644 --- a/flake.nix +++ b/flake.nix @@ -43,7 +43,6 @@ outputs = {nixpkgs, ...} @ inputs: let system = "x86_64-linux"; hostName = "rihla"; - user = "shahab"; pkgs = nixpkgs.legacyPackages.${system}; in { nixosConfigurations = { @@ -54,9 +53,17 @@ inputs.disko.nixosModules.disko inputs.nixos-hardware.nixosModules.framework-13-7040-amd inputs.sops-nix.nixosModules.sops + inputs.home-manager.nixosModules.home-manager ./nixos/configuration.nix ./nixos/disko-config.nix ./nixos/hardware-configuration.nix + { + home-manager = { + sharedModules = [ + ./modules/home-manager/yubikey-touch-detector.nix + ]; + }; + } ]; specialArgs = { inherit inputs hostName; @@ -64,16 +71,6 @@ }; }; - homeConfigurations = { - "${user}" = inputs.home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = [ - ./home-manager/home.nix - ./modules/home-manager/yubikey-touch-detector.nix - ]; - }; - }; - devShell.x86_64-linux = pkgs.mkShell { buildInputs = with pkgs; [ nil diff --git a/home-manager/home.nix b/home-manager/home.nix index eefd14e..deaa3e9 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -9,7 +9,7 @@ # Be sure to actually install the font first! font = "ComicCodeLigatures"; username = "shahab"; - email = "shahab@dogar.dev"; + email = "${username}@dogar.dev"; fullName = "Shahab Dogar"; in { # You can import other home-manager modules here @@ -123,6 +123,7 @@ in { # Enable home-manager programs.home-manager.enable = true; + # Add service to monitor yubikey requirement services.yubikey-touch-detector.enable = true; # Nicely reload system units when changing configs diff --git a/nixos/configuration.nix b/nixos/configuration.nix index baa67f4..879a004 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,7 +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’). -{lib, ...}: { +{lib, config, pkgs, ...}: { imports = [ ./imports/environment.nix ./imports/hardware.nix @@ -40,6 +40,8 @@ }; }; + home-manager.users.shahab = import ../home-manager/home.nix; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave