This commit is contained in:
2026-02-28 14:31:09 +00:00
parent e5a935ca79
commit 9cd1adf12d
2 changed files with 55 additions and 92 deletions

103
flake.nix
View File

@@ -99,60 +99,6 @@
]; ];
}; };
systemPackages = with pkgs; [ systemPackages = with pkgs; [
#bat
#highlight
#btop
#eza
#fzf
#git
#gnumake
#neofetch
#neovim
#ripgrep
#tldr
#unzip
#openssl
#wget
#zip
#zoxide
#jq
#lazygit
#lazysql
#less
#mlocate
#tree
#tmux
#tmuxinator
#wget
#zenity
#gum
#yazi
#rsync
#p7zip
#impala
];
};
networking = {
hostName = "stationette";
networkmanager.enable = true;
};
users.users.chris = {
uid = 1000;
isNormalUser = true;
initialPassword = "changeme123";
shell = pkgs.zsh;
extraGroups = [
"chris"
"wheel"
"networkmanager"
];
};
programs.zsh = {
enable = true;
};
system.stateVersion = "25.11";
environment.systemPackages = with pkgs; [
bat bat
#highlight #highlight
btop btop
@@ -185,6 +131,27 @@
p7zip p7zip
impala impala
]; ];
};
networking = {
hostName = "stationette";
networkmanager.enable = true;
};
users.users.chris = {
uid = 1000;
isNormalUser = true;
initialPassword = "changeme123";
shell = pkgs.zsh;
extraGroups = [
"chris"
"wheel"
"networkmanager"
];
};
programs.zsh = {
enable = true;
};
system.stateVersion = "25.11";
home-manager = { home-manager = {
users.chris = { pkgs, lib, ... }: { users.chris = { pkgs, lib, ... }: {
home = { home = {
@@ -203,36 +170,33 @@
activation.setupDotfiles = lib.hm.dag.entryAfter ["writeBoundary"] '' activation.setupDotfiles = lib.hm.dag.entryAfter ["writeBoundary"] ''
if [[ -v DRY_RUN ]]; then if [[ -v DRY_RUN ]]; then
echo "Dry run: Would bootstrap dotfiles from labs.scarif.space" echo "Dry run: Would bootstrap dotfiles from labs.scarif.space"
exit
fi fi
DOTFILES_DIR="$HOME/.config/dotfiles" DOTFILES_DIR="$HOME/.config/dotfiles"
if [ -d "$DOTFILES_DIR/.git" ]; then if [ -d "$DOTFILES_DIR/.git" ]; then
# Restore tracked files from the local metadata SOURCE="$DOTFILES_DIR/.git"
${pkgs.git}/bin/git --git-dir="$DOTFILES_DIR/.git" --work-tree="$HOME" checkout -f
${pkgs.git}/bin/git submodule update --init --recursive
else else
echo "Dotfiles not found. Running bootstrap script..." SOURCE="https://labs.scarif.space/chris/dotfiles.git"
# Setup a temporary workspace
TEMP_DIR=$(mktemp -d)
# Clone the repo (using the public URL for the initial pull)
${pkgs.git}/bin/git clone -b main https://labs.scarif.space/chris/dotfiles.git "$TEMP_DIR"
# Copy files to HOME
${pkgs.coreutils}/bin/cp -rfT "$TEMP_DIR" "$HOME"
# Initialize the separate git directory # Initialize the separate git directory
if [ ! -d "$DOTFILES_DIR" ]; then
${pkgs.coreutils}/bin/mkdir -p "$DOTFILES_DIR" ${pkgs.coreutils}/bin/mkdir -p "$DOTFILES_DIR"
fi
fi
TEMP_DIR=$(mktemp -d)
${pkgs.git}/bin/git clone -b main "$SOURCE" "$TEMP_DIR"
${pkgs.coreutils}/bin/cp -rfT "$TEMP_DIR" "$HOME"
cd "$HOME" cd "$HOME"
${pkgs.git}/bin/git init --separate-git-dir "$DOTFILES_DIR/.git" "$HOME" ${pkgs.git}/bin/git init --separate-git-dir "$DOTFILES_DIR/.git" "$HOME"
# Update submodules
${pkgs.git}/bin/git submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git ${pkgs.git}/bin/git submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git
${pkgs.git}/bin/git submodule update --init ${pkgs.git}/bin/git submodule update --init
# Set URLs back to SSH
${pkgs.git}/bin/git submodule set-url ".config/nvim" git@labs.scarif.space:chris/nvim.git ${pkgs.git}/bin/git submodule set-url ".config/nvim" git@labs.scarif.space:chris/nvim.git
${pkgs.git}/bin/git remote set-url origin git@labs.scarif.space:chris/dotfiles.git ${pkgs.git}/bin/git remote set-url origin git@labs.scarif.space:chris/dotfiles.git
@@ -241,7 +205,6 @@
${pkgs.coreutils}/bin/rm -f "$HOME/.git" ${pkgs.coreutils}/bin/rm -f "$HOME/.git"
echo "Dotfiles bootstrapped successfully." echo "Dotfiles bootstrapped successfully."
fi
''; '';
packages = with pkgs; [ packages = with pkgs; [
# jetbrains.rider # jetbrains.rider

View File

@@ -19,7 +19,7 @@
boot.initrd.postDeviceCommands = lib.mkAfter '' boot.initrd.postDeviceCommands = lib.mkAfter ''
mkdir /btrfs_tmp mkdir /btrfs_tmp
mount /dev/disk/by-label/disk-stationette-root /btrfs_tmp mount /dev/disk/by-partlabel/disk-stationette-root /btrfs_tmp
if [[ -e /btrfs_tmp/root ]]; then if [[ -e /btrfs_tmp/root ]]; then
mkdir -p /btrfs_tmp/old_roots mkdir -p /btrfs_tmp/old_roots
timestamp=$(dat +%Y-%m-%d_%H-%M-%S) timestamp=$(dat +%Y-%m-%d_%H-%M-%S)