home-manager/foo-dogsquared: get config into home

Now that I have time, I've learnt that Git submodules are not supported
well with flake-based setup. Instead, I'll use my dotfiles repo as one
of the inputs as a non-flake which is exactly what I want. NICE!
This commit is contained in:
Gabriel Arazas 2022-07-05 22:28:03 +08:00
parent 6695c4f02f
commit 024102c45c
4 changed files with 37 additions and 1 deletions

17
flake.lock generated
View File

@ -55,6 +55,22 @@
"type": "github" "type": "github"
} }
}, },
"dotfiles": {
"flake": false,
"locked": {
"lastModified": 1656980299,
"narHash": "sha256-utciO8yuzIeUB0R8thZ8xx1wEtIvmL7iYlriK8nq2Rc=",
"owner": "foo-dogsquared",
"repo": "dotfiles",
"rev": "2312e925f2ee558658fd888332245e8b8e79c8b4",
"type": "github"
},
"original": {
"owner": "foo-dogsquared",
"repo": "dotfiles",
"type": "github"
}
},
"emacs-overlay": { "emacs-overlay": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
@ -466,6 +482,7 @@
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"devshell": "devshell", "devshell": "devshell",
"dotfiles": "dotfiles",
"emacs-overlay": "emacs-overlay", "emacs-overlay": "emacs-overlay",
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_3",
"guix-overlay": "guix-overlay", "guix-overlay": "guix-overlay",

View File

@ -16,6 +16,10 @@
# We're using this library for other functions, mainly testing. # We're using this library for other functions, mainly testing.
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
# My personal dotfiles.
dotfiles.url = "github:foo-dogsquared/dotfiles";
dotfiles.flake = false;
# Managing home configurations. # Managing home configurations.
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";

View File

@ -69,6 +69,7 @@ in {
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.sharedModules = lib.modulesToList homeManagerModules; home-manager.sharedModules = lib.modulesToList homeManagerModules;
home-manager.extraSpecialArgs = { inherit inputs; };
# Mapping each users to the respective user configuration. # Mapping each users to the respective user configuration.
# Setting users for home-manager. # Setting users for home-manager.

View File

@ -1,4 +1,4 @@
{ config, options, lib, pkgs, ... }: { inputs, config, options, lib, pkgs, ... }:
let let
yt-dlp-for-audio-config = pkgs.writeText "yt-dlp-for-audio-config" '' yt-dlp-for-audio-config = pkgs.writeText "yt-dlp-for-audio-config" ''
@ -20,6 +20,10 @@ let
yt-dlp-for-audio = pkgs.writeScriptBin "yt-dlp-audio" '' yt-dlp-for-audio = pkgs.writeScriptBin "yt-dlp-audio" ''
${pkgs.yt-dlp}/bin/yt-dlp --config-location "${yt-dlp-for-audio-config}" $@ ${pkgs.yt-dlp}/bin/yt-dlp --config-location "${yt-dlp-for-audio-config}" $@
''; '';
getDotfiles = path: {
source = "${inputs.dotfiles}/${path}";
recursive = true;
};
in { in {
programs.home-manager.enable = true; programs.home-manager.enable = true;
@ -217,4 +221,14 @@ in {
templates = "$HOME/library/templates"; templates = "$HOME/library/templates";
videos = "$HOME/library/videos"; videos = "$HOME/library/videos";
}; };
# All of the personal configurations.
xdg.configFile = {
"doom" = getDotfiles "emacs";
"kitty" = getDotfiles "kitty";
"lazygit" = getDotfiles "lazygit";
"lf" = getDotfiles "lf";
"nvim" = getDotfiles "nvim";
"wezterm" = getDotfiles "wezterm";
};
} }