Compare commits

...

2 Commits

Author SHA1 Message Date
John Lancaster
4a9bee71ae workspace updates 2024-12-29 10:16:11 -06:00
John Lancaster
1bad54c7a2 broke out scripts folder 2024-12-29 10:16:04 -06:00
4 changed files with 65 additions and 14 deletions

View File

@@ -14,6 +14,12 @@
},
],
"settings": {
"python.defaultInterpreterPath": "/usr/src/app/.venv/bin/python3"
"python.defaultInterpreterPath": "/usr/src/app/.devenv/state/venv/bin/python3",
"python.analysis.extraPaths": [
"/usr/src/app"
],
"ruff.interpreter": [
"/usr/src/app/.devenv/state/venv/bin/python3"
],
}
}

View File

@@ -9,6 +9,7 @@ in
imports = [
(import ./home-manager/home.nix {inherit systemSettings userSettings;})
./nixos
./scripts
];
system.stateVersion = stateVersion;
time.timeZone = "${systemSettings.timeZone}";
@@ -23,12 +24,28 @@ in
sops.age.keyFile = "${userSettings.adHome}/.config/sops/age/keys.txt";
environment.systemPackages = with pkgs; [
(pkgs.writeShellScriptBin "nrbs" "sudo nixos-rebuild switch")
(pkgs.writeShellScriptBin "nrbsu" "sudo nix-channel --update && sudo nixos-rebuild switch")
(pkgs.writeShellScriptBin "nfs" ''
sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#${systemSettings.hostName}
'')
(pkgs.writeShellScriptBin "ads" "nix develop --no-pure-eval $(readlink -f /etc/nixos)")
# (pkgs.writeShellScriptBin "nrbs" "sudo nixos-rebuild switch")
# (pkgs.writeShellScriptBin "nrbsu" "sudo nix-channel --update && sudo nixos-rebuild switch")
# (pkgs.writeShellScriptBin "nfs" ''
# sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#${systemSettings.hostName}
# '')
# (pkgs.writeShellScriptBin "ads" "nix develop --no-pure-eval $(readlink -f /etc/nixos)")
# (pkgs.writeShellScriptBin "link-nix" ''
# set -e
# if [ "$#" -eq 0 ]; then
# echo "Error: No arguments provided."
# echo "Usage: $0 <path>"
# exit 1
# fi
# CURRENT=$(readlink -f /etc/nixos)
# sudo rm /etc/nixos
# echo "Unlinked $CURRENT"
# sudo ln -s $1 /etc/nixos
# echo "Linked $(readlink -f /etc/nixos)"
# '')
bash
git
eza
@@ -43,11 +60,11 @@ in
services.openssh.enable = true;
services.tailscale.enable = true;
system.activationScripts.ensureDirectory = ''
if [ ! -d /conf ]; then
mkdir /conf
chmod 0755 /conf
chown 1000:100 /conf
fi
'';
# system.activationScripts.ensureDirectory = ''
# if [ ! -d /conf ]; then
# mkdir /conf
# chmod 0755 /conf
# chown 1000:100 /conf
# fi
# '';
}

12
scripts/default.nix Normal file
View File

@@ -0,0 +1,12 @@
{ pkgs, systemSettings, ... }:
{
environment.systemPackages = with pkgs; [
(pkgs.writeShellScriptBin "nrbs" "sudo nixos-rebuild switch")
(pkgs.writeShellScriptBin "nrbsu" "sudo nix-channel --update && sudo nixos-rebuild switch")
(pkgs.writeShellScriptBin "nfs" ''
sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#${systemSettings.hostName}
'')
(pkgs.writeShellScriptBin "ads" "nix develop --no-pure-eval $(readlink -f /etc/nixos)")
(pkgs.writeShellScriptBin "link-nix" "${builtins.readFile ./link-nix.sh}")
];
}

16
scripts/link-nix.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -e
if [ "$#" -eq 0 ]; then
echo "Error: No arguments provided."
echo "Usage: $0 <path>"
exit 1
fi
CURRENT=$(readlink -f /etc/nixos)
sudo rm /etc/nixos
echo "Unlinked $CURRENT"
sudo ln -s $1 /etc/nixos
echo "Linked $(readlink -f /etc/nixos)"