build(nixos): add home-manager

This commit is contained in:
Mohammad Rafiq 2025-02-22 12:38:34 +08:00
parent 9bc605b2eb
commit ef89e56b6e
3 changed files with 73 additions and 2 deletions

21
flake.lock generated
View file

@ -1,5 +1,25 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1740188029,
"narHash": "sha256-pnPs+XSpR633G/q0gj+SDyL4RaDfiKlom86zEBPtq+M=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "765cb91e9d5ab06ed8c92c25fc0e51d6c11d43cb",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1739866667,
@ -18,6 +38,7 @@
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
}

View file

@ -1,15 +1,23 @@
{
description = "simple NixOS flake";
description = "simple NixOS flake with home-manager";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, nixpkgs, ... }: {
outputs = inputs@{ self, nixpkgs, home-manager, ... }: {
nixosConfigurations.nemesis = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.rafiq = import ./home.nix;
}
];
};
};

42
home.nix Normal file
View file

@ -0,0 +1,42 @@
{ config, pkgs, ... }:
{
home.username = "rafiq";
home.homeDirectory = "/home/rafiq";
# home.file.".config/" = {
# source = ./.config;
# recursive = true;
# };
home.packages = with pkgs; [
fastfetch
neovim
zip
unzip
ripgrep
];
programs.git = {
enable = true;
userName = "Mohammad Rafiq";
userEmail = "mohammadrafiq567@gmail.com";
};
#TODO add neovim option
#TODO add starship
programs.bash = {
enable = true;
enableCompletion = true;
shellAliases = {
ll = "ls -la";
};
};
home.stateVersion = "24.11";
programs.home-manager.enable = true;
}