Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicegginton committed Feb 4, 2025
1 parent 4553266 commit 399a6f4
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 22 deletions.
16 changes: 0 additions & 16 deletions 3

This file was deleted.

2 changes: 1 addition & 1 deletion modules/nixos/secrets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ in
{
options.modules.secrets = mkOption {
type = secretType;
default = {};
default = { };
};
config = {
systemd.services.secrets = {
Expand Down
10 changes: 8 additions & 2 deletions overlays.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

with lib;

let
lib-packages = prev: final: lib // {
development-promt = final.callPackage ./pkgs/development-promot.nix { };
};
in

rec {
additions = final: prev: {
inherit (packagesFrom inputs.vulnix { inherit (final) system; }) vulnix;
Expand All @@ -24,13 +30,13 @@ rec {
todo = final.callPackage (defaultPackageFrom inputs.todo) { };
set-theme = final.callPackage ./pkgs/set-theme.nix { };
twx = final.callPackage ./pkgs/twx.nix { };
lib = prev.lib // lib;
lib = prev.lib // lib // (lib-packages prev final);
};

modifications = final: prev: {
twm = final.callPackage (defaultPackageFrom inputs.twm) { };
neovim = final.callPackage (defaultPackageFrom inputs.neovim-nightly) { };
lib = prev.lib // lib;
lib = prev.lib // lib // (lib-packages prev final);
};

unstable-packages = final: _: {
Expand Down
6 changes: 3 additions & 3 deletions pkgs/bootstrap-nixos-host.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{ lib, stdenv, writers, ensure-user-is-root, coreutils, git, busybox, nix, nixos-anywhere, fzf, nmap, jq, gum, secrets-sync }:
{ lib, stdenv, writers, ensure-user-is-root, coreutils, git, busybox, nix, nixos-anywhere, fzf, nmap, jq, gum }:

if (!stdenv.isLinux)
then throw "This script can only be run on linux hosts"
else

writers.writeBashBin "bootstrap-nixos-hosts" ''
export PATH=${lib.makeBinPath [ ensure-user-is-root coreutils git busybox nix nixos-anywhere fzf nmap jq gum secrets-sync ]}
export PATH=${lib.makeBinPath [ ensure-user-is-root coreutils git busybox nix nixos-anywhere fzf nmap jq gum ]}
set -efu -o pipefail
ensure-user-is-root
temp=$(mktemp -d)
Expand All @@ -22,7 +22,7 @@ else
rm "$temp/ips"
installer_ip=$(echo "$ips" | fzf --prompt "Select the installer: " --height ~100% --preview "sleep 1 && nmap -A {}")
build_target=$(printf "host\nremote" | fzf --prompt "Select a build target: " --height ~100%)
gum confirm "Would you like to sync secrets before copying them to the installer?" && secrets-sync
# gum confirm "Would you like to sync secrets before copying them to the installer?" && secrets-sync
mkdir -p "$temp/root/bitwarden-secrets"
mkdir -p "$temp/run/bitwarden-secrets"
chown -R root:root "$temp/root/bitwarden-secrets"
Expand Down
13 changes: 13 additions & 0 deletions pkgs/development-promot.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{ makeSetupHook, writeScript, stdenv, git }:

workspaceName: (makeSetupHook { name = "development-promot"; }
(writeScript "development-promot" ''
#!${stdenv.shell}
function parse_git_dirty {
[[ $(${git}/bin/git status --porcelain 2> /dev/null) ]] && echo "*"
}
function parse_git_branch {
${git}/bin/git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/ (\1$(parse_git_dirty))/"
}
export PS1="\[\e[1;31m\][${workspaceName}]\[\e[0m\] \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch) \[\e[1;35m\]$\[\e[0m\] "
''))
1 change: 1 addition & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

mkShell {
nativeBuildInputs = with pkgs; [
(lib.development-promt "dominicegginton/dotfiles")
nix
bootstrap-nixos-host
bootstrap-nixos-installer
Expand Down

0 comments on commit 399a6f4

Please sign in to comment.