feat: format and fix noisebell config
This commit is contained in:
parent
3e78c835cc
commit
d0b29c1244
10 changed files with 211 additions and 101 deletions
95
flake.nix
95
flake.nix
|
|
@ -23,50 +23,59 @@
|
|||
agenix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, disko, ... }@inputs: {
|
||||
nixosConfigurations.extremist-software = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
disko.nixosModules.disko
|
||||
inputs.mymx.nixosModules.default
|
||||
inputs.website.nixosModules.default
|
||||
inputs.agenix.nixosModules.default
|
||||
inputs.noisebell.nixosModules.default
|
||||
inputs.noisepics.nixosModules.default
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
disko,
|
||||
...
|
||||
}@inputs:
|
||||
{
|
||||
nixosConfigurations.extremist-software = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
disko.nixosModules.disko
|
||||
inputs.mymx.nixosModules.default
|
||||
inputs.website.nixosModules.default
|
||||
inputs.agenix.nixosModules.default
|
||||
inputs.noisebell.nixosModules.default
|
||||
inputs.noisepics.nixosModules.default
|
||||
|
||||
./disk-config.nix
|
||||
./configuration.nix
|
||||
];
|
||||
};
|
||||
./disk-config.nix
|
||||
./configuration.nix
|
||||
];
|
||||
};
|
||||
|
||||
devShells.x86_64-linux.default = let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
deploy = pkgs.writeShellScriptBin "nhs" ''
|
||||
nh os switch --hostname extremist-software --target-host root@extremist-software path:. "$@"
|
||||
'';
|
||||
check-secrets = pkgs.writeShellScriptBin "check-secrets" ''
|
||||
set -euo pipefail
|
||||
failed=0
|
||||
for f in secrets/*.age; do
|
||||
last=$(agenix -d "$f" | tail -c 1 | od -An -tx1 | tr -d ' \n')
|
||||
if [ "$last" = "0a" ]; then
|
||||
echo "FAIL: $f has trailing newline"
|
||||
failed=1
|
||||
fi
|
||||
done
|
||||
if [ "$failed" -eq 0 ]; then
|
||||
echo "All secrets OK: no trailing newlines"
|
||||
fi
|
||||
exit $failed
|
||||
'';
|
||||
in pkgs.mkShell {
|
||||
packages = [
|
||||
pkgs.nh
|
||||
inputs.agenix.packages.x86_64-linux.default
|
||||
deploy
|
||||
check-secrets
|
||||
];
|
||||
devShells.x86_64-linux.default =
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
deploy = pkgs.writeShellScriptBin "nhs" ''
|
||||
nh os switch --hostname extremist-software --target-host root@extremist-software path:. "$@"
|
||||
'';
|
||||
check-secrets = pkgs.writeShellScriptBin "check-secrets" ''
|
||||
set -euo pipefail
|
||||
failed=0
|
||||
for f in secrets/*.age; do
|
||||
last=$(agenix -d "$f" | tail -c 1 | od -An -tx1 | tr -d ' \n')
|
||||
if [ "$last" = "0a" ]; then
|
||||
echo "FAIL: $f has trailing newline"
|
||||
failed=1
|
||||
fi
|
||||
done
|
||||
if [ "$failed" -eq 0 ]; then
|
||||
echo "All secrets OK: no trailing newlines"
|
||||
fi
|
||||
exit $failed
|
||||
'';
|
||||
in
|
||||
pkgs.mkShell {
|
||||
packages = [
|
||||
pkgs.nh
|
||||
inputs.agenix.packages.x86_64-linux.default
|
||||
deploy
|
||||
check-secrets
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue