home-manager: upgrade symlink creation
This commit is contained in:
10
flake.nix
10
flake.nix
@@ -13,10 +13,15 @@
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ nixpkgs, home-manager, ... } @ inputs:
|
||||
{ self, nixpkgs, home-manager, ... } @ inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
dotfilesSrc = self.outPath; # store copy, for readDir only
|
||||
dotfiles = "/home/j/git/dotfiles"; # live path, for symlink targets
|
||||
};
|
||||
in
|
||||
{
|
||||
# TCS config
|
||||
@@ -32,12 +37,13 @@
|
||||
|
||||
# Optionally use extraSpecialArgs
|
||||
# to pass through arguments to home.nix
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
inherit extraSpecialArgs;
|
||||
};
|
||||
|
||||
# Home
|
||||
homeConfigurations."j" = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
inherit extraSpecialArgs;
|
||||
|
||||
# Specify your home configuration modules here, for example,
|
||||
# the path to your home.nix.
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
{ config, pkgs, inputs, ... }:
|
||||
{ config, pkgs, lib, inputs, dotfilesSrc, dotfiles, ... }:
|
||||
|
||||
let
|
||||
dotfiles = "${config.home.homeDirectory}/git/dotfiles";
|
||||
|
||||
createDotLink = name: {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/${name}/.config/${name}";
|
||||
recursive = true;
|
||||
};
|
||||
createDotLinks = name:
|
||||
let
|
||||
configDir = dotfilesSrc + "/${name}/.config";
|
||||
allEntries = builtins.readDir configDir;
|
||||
entries = builtins.attrNames allEntries; # both files and dirs
|
||||
in
|
||||
builtins.listToAttrs (map (entry: {
|
||||
name = entry;
|
||||
value = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/${name}/.config/${entry}";
|
||||
};
|
||||
}) entries);
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
@@ -86,6 +92,7 @@ in
|
||||
jujutsu
|
||||
jjui
|
||||
lazyjj
|
||||
meld
|
||||
|
||||
# Python
|
||||
python3
|
||||
@@ -189,14 +196,14 @@ in
|
||||
{ name = "grc"; src = pkgs.fishPlugins.grc.src; }
|
||||
];
|
||||
};
|
||||
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
add_newline = false;
|
||||
};
|
||||
home.shellAliases = {
|
||||
nvimdiff = "nvim -d";
|
||||
};
|
||||
|
||||
# programs.starship = {
|
||||
# enable = true;
|
||||
# };
|
||||
|
||||
#programs.neovim.enable = true;
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
@@ -248,13 +255,9 @@ in
|
||||
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
xdg.configFile = {
|
||||
"git" = createDotLink "git";
|
||||
"niri" = createDotLink "niri";
|
||||
"jj" = createDotLink "jj";
|
||||
"helix" = createDotLink "helix";
|
||||
"ghostty" = createDotLink "ghostty";
|
||||
};
|
||||
xdg.configFile = lib.mkMerge (map createDotLinks [
|
||||
"git" "niri" "jj" "helix" "ghostty" "starship"
|
||||
]);
|
||||
home.file = {
|
||||
".pdbrc" = { source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/python/.pdbrc";};
|
||||
".pdb_startup.py" = { source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/python/.pdb_startup.py";};
|
||||
|
||||
Reference in New Issue
Block a user