Skip to content

Commit

Permalink
refactor(nix): move home.nix into home/
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamHsieh committed Jan 8, 2024
1 parent bf2da8d commit 7c09448
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ sh <(curl -L https://nixos.org/nix/install)
2. clone this repo and modify the personal info in `config.nix`
```bash
git clone http://github.com/williamhsieh/dotfiles ~/dotfiles && cd ~/dotfiles
nvim ./home/config.nix
```
3. apply home-manager settings (leaving `USER` empty will call `.#william` by default)
```bash
Expand Down
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
outputs = inputs @ { self, nixpkgs, home-manager, ... }:
let
system = "x86_64-linux";
username = (import ./config.nix).user;
username = (import ./home/config.nix).user;

pkgs = import nixpkgs {
inherit system;
Expand Down Expand Up @@ -79,7 +79,7 @@
extraSpecialArgs = { inherit inputs outputs; };

modules = [
./home.nix
./home
inputs.nix-index-database.hmModules.nix-index
{
home = {
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions home.nix → home/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{ inputs, pkgs, config, lib, ... }:
let
cfg = import ./config.nix;
config-path = "${config.home.homeDirectory}/${cfg.repo-path}/config";
link = path: config.lib.file.mkOutOfStoreSymlink "${config-path}/${path}";
dotfilesDir = "${config.home.homeDirectory}/${cfg.repo-path}";
link = path: config.lib.file.mkOutOfStoreSymlink "${dotfilesDir}/config/${path}";
in
{
home = {
Expand Down Expand Up @@ -61,7 +61,7 @@ in
"starship.toml".source = link ".config/starship.toml";
"home-manager".source = link "..";
"clangd/config.yaml".text = ''
${lib.removeSuffix "\n" (builtins.readFile ./config/.config/clangd/config.yaml)}
${lib.removeSuffix "\n" (builtins.readFile ../config/.config/clangd/config.yaml)}
Compiler: ${pkgs.gcc}/bin/g++
'';
};
Expand Down

0 comments on commit 7c09448

Please sign in to comment.