1
0
Fork 0

home-manager: home-manager as a flake

This commit is contained in:
Pratham Patel 2024-02-09 17:27:18 +05:30
parent 0546709abf
commit c73d42f070
Signed by: thefossguy
SSH Key Fingerprint: SHA256:/B3wAg7jnMEBQ2JwkebbS/eXVZANDmqRfnd9QkIhxMI
4 changed files with 43 additions and 6 deletions

View File

@ -1,13 +1,9 @@
{ config, lib, pkgs, ... }:
{
imports = [ ./platform.nix ];
home.stateVersion = "24.05";
programs.home-manager.enable = true;
home = {
username = "pratham";
packages = with pkgs; [
gawk
gnugrep

View File

@ -1,7 +1,11 @@
{ config, lib, pkgs, ... }:
let
me = "pratham";
in
{
home.homeDirectory = "/Users/pratham";
home.username = "${me}";
home.homeDirectory = "/Users/${me}";
targets.darwin = {
currentHostDefaults = {

View File

@ -0,0 +1,33 @@
{
inputs = {
# a better way of using the latest stable version of nixpkgs
# without specifying specific release
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz";
home-manager.url = "github:nix-community/home-manager/release-23.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, home-manager, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
{
packages.homeConfigurations = {
"pratham" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./home.nix
(if pkgs.stdenv.isLinux then ./linux.nix else ./darwin.nix)
{
home.stateVersion = "23.11";
}
];
};
};
}
);
}

View File

@ -1,6 +1,10 @@
{ config, lib, pkgs, ... }:
let
me = "pratham";
in
{
home.homeDirectory = "/home/pratham";
home.username = "${me}";
home.homeDirectory = "/home/${me}";
targets.genericLinux.enable = true;
}