System : Init dotfiles with systemd.
This commit is contained in:
parent
60613b8302
commit
397d003dba
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
6
.config/linux/system/host/live/Configuration.nix
Normal file
6
.config/linux/system/host/live/Configuration.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
];
|
||||
}
|
4
.config/linux/system/host/live/HardwareConfiguration.nix
Normal file
4
.config/linux/system/host/live/HardwareConfiguration.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
}
|
12
.config/linux/system/module/common/Dotfile.nix
Normal file
12
.config/linux/system/module/common/Dotfile.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
binwalk
|
||||
btop
|
||||
cryptsetup
|
||||
curl
|
||||
ddrescue
|
||||
ffmpeg
|
||||
file
|
||||
|
|
Reference in a new issue