Skip to content

Commit

Permalink
wip home-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
stringang committed Apr 24, 2024
1 parent fe39de8 commit b2d7300
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,2 +1,3 @@
*.swp
result*
result*
idea/
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/dotfiles-darwin.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 27 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 30 additions & 4 deletions flake.nix
Expand Up @@ -3,11 +3,21 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";

flake-utils.url = "github:numtide/flake-utils";

nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};

home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs@{ self, nix-darwin, nixpkgs }:
outputs = inputs@{ self, nixpkgs, flake-utils, nix-darwin, home-manager, ...}:
let
configuration = { pkgs, ... }: {
# List packages installed in system profile. To search by name, run:
Expand Down Expand Up @@ -42,7 +52,23 @@
# Build darwin flake using:
# $ darwin-rebuild build --flake .#gangliu-MacBook-Pro
darwinConfigurations."gangliu-MacBook-Pro" = nix-darwin.lib.darwinSystem {
modules = [ configuration ];
system = "x86_64-darwin";
modules = [
# `nix-darwin` main config
configuration
# `home-manager` module config
home-manager.darwinModules.home-manager
{
# hardcode see: https://github.com/nix-community/home-manager/issues/4026
users.users."gang.liu".home = "/Users/gang.liu";

home-manager.verbose = true;
home-manager.backupFileExtension = "hm_bak~";
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users."gang.liu" = import ./home;
}
];
};

# Expose the package set, including overlays, for convenience.
Expand Down
21 changes: 21 additions & 0 deletions home/default.nix
@@ -0,0 +1,21 @@
{ config, lib, pkgs, ... }:

{
# Home Manager needs a bit of information about you and the
# paths it should manage.
# home.username = "gang.liu";
# home.homeDirectory = "/Users/gang.liu";

# 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.11";

# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}

0 comments on commit b2d7300

Please sign in to comment.