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 if [[ -d ".git" ]]; then
echo "Found the .git directory. Already initialized?" echo "Found the .git directory. Already initialized?"
exit 1 exit 1
fi fi
# sync. # Sync.
git init &> /dev/null git init &> /dev/null
git remote add origin https://git.voronind.com/voronind/linux.git &> /dev/null git remote add origin https://git.voronind.com/voronind/linux.git &> /dev/null
git fetch &> /dev/null git fetch &> /dev/null

View file

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