Dotfiles : Load from nix store.

This commit is contained in:
Dmitry Voronin 2024-02-20 22:03:30 +03:00
parent 8f551f6213
commit 09e4b21909
3 changed files with 18 additions and 16 deletions

View file

@ -18,7 +18,7 @@
nixosModules.common.imports = [
./module/common/Bootloader.nix
./module/common/Distrobox.nix
./module/common/Dotfile.nix
./module/common/Dotfiles.nix
./module/common/Firewall.nix
./module/common/Kernel.nix
./module/common/Locale.nix

View file

@ -1,15 +0,0 @@
{ pkgs, ... }: let
unit = {
description = "Install/update dotfiles on startup.";
wantedBy = [ "multi-user.target" ];
serviceConfig.Type = "oneshot";
script = ''
cd ~
test -d .git || { ${pkgs.curl}/bin/curl https://git.voronind.com/voronind/linux/raw/branch/main/.Bootstrap.sh | ${pkgs.bash}/bin/bash; }
${pkgs.git}/bin/git pull
'';
};
in {
systemd.user.services.dotfiles = unit;
systemd.services.dotfiles = unit;
}

View file

@ -0,0 +1,17 @@
{ pkgs, inputs, ... }: let
unit = {
description = "Install/update dotfiles on startup.";
wantedBy = [ "multi-user.target" ];
serviceConfig.Type = "oneshot";
script = ''
cd ~
test -d .git || cp -r ${inputs.dotfiles}/{*,.*} .
${pkgs.git}/bin/git pull
'';
};
dotsSource = inputs.dotfiles;
in {
systemd.user.services.dotfiles = unit;
systemd.services.dotfiles = unit;
environment.etc.dotfiles.source = dotsSource;
}