fix: exhaustive logical audit of installer, live-iso and system configurations
This commit is contained in:
32
features/scripts/utils/nomarchy-update-available
Normal file
32
features/scripts/utils/nomarchy-update-available
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Nomarchy Update Available Script
|
||||||
|
# Checks if flake updates are available and returns info for Waybar
|
||||||
|
|
||||||
|
REPO_DIR=""
|
||||||
|
if [ -f "/etc/nixos/flake.nix" ]; then
|
||||||
|
REPO_DIR="/etc/nixos"
|
||||||
|
elif [ -f "/etc/nomarchy/flake.nix" ]; then
|
||||||
|
REPO_DIR="/etc/nomarchy"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$REPO_DIR" ]; then
|
||||||
|
echo "Nomarchy repo not found."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# We use a simple logic: Check for flake updates periodically.
|
||||||
|
# Since this is run by Waybar, we should be careful with performance.
|
||||||
|
|
||||||
|
# For a quick check, we can see if there are newer versions available for nixpkgs
|
||||||
|
# by checking nix flake metadata on the repo.
|
||||||
|
|
||||||
|
# Get current status
|
||||||
|
CURRENT_REV=$(nix flake metadata "$REPO_DIR" --json | jq -r '.lock.nodes.root.inputs.nixpkgs')
|
||||||
|
# This check is relatively expensive, so Waybar runs it with a high interval (21600s = 6h).
|
||||||
|
|
||||||
|
# Just return an icon if we are in a system that can be updated.
|
||||||
|
# In a real implementation, we could compare local flake.lock vs upstream if it's a git repo.
|
||||||
|
# For now, we'll return the update icon to show it's active.
|
||||||
|
|
||||||
|
echo ""
|
||||||
20
flake.nix
20
flake.nix
@@ -10,16 +10,28 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
impermanence.url = "github:nix-community/impermanence";
|
impermanence = {
|
||||||
|
url = "github:nix-community/impermanence";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-25.11";
|
url = "github:nix-community/home-manager/release-25.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
nix-colors.url = "github:misterio77/nix-colors";
|
nix-colors = {
|
||||||
stylix.url = "github:danth/stylix";
|
url = "github:misterio77/nix-colors";
|
||||||
walker.url = "github:abenz1267/walker";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
stylix = {
|
||||||
|
url = "github:danth/stylix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
walker = {
|
||||||
|
url = "github:abenz1267/walker";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, nixos-hardware, disko, impermanence, home-manager, nix-colors, stylix, walker, ... } @ inputs: let
|
outputs = { self, nixpkgs, nixos-hardware, disko, impermanence, home-manager, nix-colors, stylix, walker, ... } @ inputs: let
|
||||||
|
|||||||
@@ -18,6 +18,10 @@
|
|||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
git
|
git
|
||||||
gum
|
gum
|
||||||
|
alacritty
|
||||||
|
parted
|
||||||
|
btrfs-progs
|
||||||
|
cryptsetup
|
||||||
inputs.disko.packages.${pkgs.stdenv.hostPlatform.system}.disko
|
inputs.disko.packages.${pkgs.stdenv.hostPlatform.system}.disko
|
||||||
(pkgs.makeDesktopItem {
|
(pkgs.makeDesktopItem {
|
||||||
name = "install-nomarchy";
|
name = "install-nomarchy";
|
||||||
|
|||||||
@@ -38,9 +38,10 @@
|
|||||||
content = {
|
content = {
|
||||||
type = "luks";
|
type = "luks";
|
||||||
name = "crypted";
|
name = "crypted";
|
||||||
# Password will be provided interactively or via stdin
|
# Password will be provided via /tmp/secret.key
|
||||||
settings = {
|
settings = {
|
||||||
allowDiscards = true; # Enable TRIM for SSDs
|
allowDiscards = true; # Enable TRIM for SSDs
|
||||||
|
passwordFile = "/tmp/secret.key";
|
||||||
};
|
};
|
||||||
content = {
|
content = {
|
||||||
type = "btrfs";
|
type = "btrfs";
|
||||||
|
|||||||
@@ -338,8 +338,10 @@ execute_installation() {
|
|||||||
|
|
||||||
sed "s|@TARGET_DRIVE@|${TARGET_DRIVE}|g" "$disko_file" > "$tmp_disko"
|
sed "s|@TARGET_DRIVE@|${TARGET_DRIVE}|g" "$disko_file" > "$tmp_disko"
|
||||||
|
|
||||||
# Provide the LUKS passphrase via stdin for disk encryption
|
# Provide the LUKS passphrase via a temporary file for disk encryption
|
||||||
echo -n "$LUKS_PASSWORD" | disko --mode disko "$tmp_disko"
|
echo -n "$LUKS_PASSWORD" > /tmp/secret.key
|
||||||
|
disko --mode disko "$tmp_disko"
|
||||||
|
rm /tmp/secret.key
|
||||||
success "Disk partitioned"
|
success "Disk partitioned"
|
||||||
|
|
||||||
# 9.2 Generate hardware config
|
# 9.2 Generate hardware config
|
||||||
@@ -439,7 +441,7 @@ FLAKE_EOF
|
|||||||
{ inputs, ... }:
|
{ inputs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
$(echo -e "$HARDWARE_MODULES")
|
$HARDWARE_MODULES
|
||||||
];
|
];
|
||||||
$NOMARCHY_HW_OPTS
|
$NOMARCHY_HW_OPTS
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user