From bb1e8ab317cbc5a386fd2a89eb756b9e28bf28b2 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 16 Jun 2023 19:46:10 -0400 Subject: [PATCH] install home manager and add home.nix --- flake.nix | 23 ++++++++++++++++++++--- home.nix | 29 +++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 home.nix diff --git a/flake.nix b/flake.nix index 0b9d7b9..ba81b2c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,13 +1,30 @@ { description = "Alex's super mega awesome nixos config"; - inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-23.05; + inputs = { + nixpkgs.url = github:NixOS/nixpkgs/nixos-23.05; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; - outputs = { self, nixpkgs }@attrs: { + outputs = { nixpkgs, home-manager, ... }@attrs: { nixosConfigurations.nixos76 = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = attrs; - modules = [ ./configuration.nix ]; + modules = [ + ./configuration.nix + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.alex = import ./home.nix; + + # Optionally, use home-manager.extraSpecialArgs to pass + # arguments to home.nix + } + + ] + ; }; }; } diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..7ae327c --- /dev/null +++ b/home.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +{ + # Home Manager needs a bit of information about you and the + # paths it should manage. + home.username = "alex"; + home.homeDirectory = "/home/alex"; + + # Packages that should be installed to the user profile. + home.packages = [ + + + pkgs.htop + pkgs.nixpkgs-fmt + ]; + + # This value determines the Home Manager release that your + # configuration is compatible with. This helps avoid breakage + # when a new Home Manager release introduces backwards + # incompatible changes. + # + # You can update Home Manager without changing this value. See + # the Home Manager release notes for a list of state version + # changes in each release. + home.stateVersion = "23.05"; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} \ No newline at end of file