nix format job #1

Merged
ahoneybun merged 9 commits from add-ci into main 2026-01-21 07:29:26 -07:00
5 changed files with 46 additions and 79 deletions

View file

@ -0,0 +1,27 @@
name: nix format check
on:
push:
branches: [main]
pull_request:
types: [opened, reopened, synchronize]
jobs:
amd64:
runs-on: [ nix-flakes, amd64-builder ]
steps:
- name: System Info
run: uname -m
- name: Setup
run: |
apt update -y
apt install -y curl gnupg
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt install -y nodejs
- name: Checkout
uses: actions/checkout@v5
- name: Alejandra Check
run: nix run nixpkgs#alejandra -- --check .
continue-on-error: true

View file

@ -1,25 +1,25 @@
let
pkgs = import <nixpkgs> {};
in
pkgs.dockerTools.buildImage {
name = "hello";
tag = "latest";
pkgs.dockerTools.buildImage {
name = "hello";
tag = "latest";
copyToRoot = pkgs.buildEnv {
name = "image-root";
paths = [
pkgs.hello
pkgs.busybox
];
pathsToLink = [ "/bin" ];
};
copyToRoot = pkgs.buildEnv {
name = "image-root";
paths = [
pkgs.hello
pkgs.busybox
];
pathsToLink = ["/bin"];
};
runAsRoot = ''
mkdir -p /data
'';
runAsRoot = ''
mkdir -p /data
'';
config = {
Cmd = [ "/bin/hello" ];
WorkingDir = "/data";
};
}
config = {
Cmd = ["/bin/hello"];
WorkingDir = "/data";
};
}

View file

@ -1,29 +0,0 @@
{ pkgs, config, lib, cfg, ... }:
# Thanks to Aires!
# https://aires.fyi/blog/installing-a-custom-package-with-nix/
let
backrest = pkgs.callPackage ./package.nix { inherit pkgs lib; };
in
rec {
environment.systemPackages = [
backrest
];
# Install systemd service
systemd.services."backrest" = {
enable = true;
wants = [ "network-online.target" ];
after = [ "syslog.target" "network-online.target" ];
description = "Start the Backrest backup service and web UI";
serviceConfig = {
Type = "simple";
ExecStart = ''${backrest/backrest'';
Restart = "on-failure";
RestartSrc = 10;
KillMode = "process";
Environment = "HOME=${config.users.users.aaronh.home}";
};
};
}

View file

@ -1,31 +0,0 @@
{
pkgs,
lib,
}:
# Thanks to Aires!
# https://aires.fyi/blog/installing-a-custom-package-with-nix/
pkgs.stdenv.mkDerivation rec {
pname = "backrest";
version = "v0.11.0";
src = builtins.fetchurl {
url = "https://github.com/garethgeorge/backrest/releases/download/v0.11.0/backrest_Linux_x86_64.tar.gz";
sha256 = "fd6c05339b6855f0acad001c2243d871f4621def04cef9eb3b452110fe175d49";
};
doCheck = false;
dontUnpack = true;
installPhase = ''
tar -xf backrest_Darwin_x86_64.tar.gz
install -D $src $out/backrest
chmod a+x $out/backrest
'';
meta = with lib; {
homepage = "https://github.com/garethgeorge/backrest";
description = "Backrest is a web UI and orchestrator for restic backup.";
platforms = platforms.linux ++ platforms.darwin;
};
}