System : Init dotfiles with systemd.

This commit is contained in:
Dmitry Voronin 2024-02-20 15:01:32 +03:00
parent 60613b8302
commit 397d003dba
6 changed files with 31 additions and 4 deletions

View file

@ -1,12 +1,15 @@
#!/bin/bash
#!/usr/bin/env bash
# check if this is already a git repo.
# Temproraty test.
touch INIT_DOT
# Check if this is already a git repo.
if [[ -d ".git" ]]; then
echo "Found the .git directory. Already initialized?"
exit 1
fi
# sync.
# Sync.
git init &> /dev/null
git remote add origin https://git.voronind.com/voronind/linux.git &> /dev/null
git fetch &> /dev/null

View file

@ -3,7 +3,7 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs } @inputs: {
outputs = { self, nixpkgs } @inputs: rec {
# Constant values.
nixosModules.const = {
hashedPassword = "$y$j9T$oqCB16i5E2t1t/HAWaFd5.$tTaHtAcifXaDVpTcRv.yH2/eWKxKE9xM8KcqXHfHrD7"; # Use `mkpasswd`.
@ -14,6 +14,7 @@
nixosModules.common.imports = [
./module/common/Bootloader.nix
./module/common/Distrobox.nix
./module/common/Dotfile.nix
./module/common/Firewall.nix
./module/common/Kernel.nix
./module/common/Locale.nix

View file

@ -0,0 +1,6 @@
{ config, pkgs, ... }:
{
imports = [
];
}

View file

@ -0,0 +1,4 @@
{ ... }:
{
}

View file

@ -0,0 +1,12 @@
{ pkgs, ... }: {
systemd.user.services.dotfiles = {
description = "Install/update dotfiles in startup.";
wantedBy = [ "graphical-session-pre.target" ];
serviceConfig.Type = "oneshot";
script = ''
cd ~
${pkgs.curl}/bin/curl https://git.voronind.com/voronind/linux/raw/branch/main/.bootstrap.sh | ${pkgs.bash}/bin/bash || true
${pkgs.git}/bin/git pull
'';
};
}

View file

@ -7,6 +7,7 @@
binwalk
btop
cryptsetup
curl
ddrescue
ffmpeg
file