Compare commits

..

14 commits

Author SHA1 Message Date
6ec76eb866
get weird with it 2024-06-14 15:44:56 -05:00
e4d08c4195
try an action 2024-06-14 14:51:29 -05:00
14b3e526a5
add some more "checked" packages 2024-06-14 14:28:12 -05:00
6a17f6945f
formatting 2024-06-14 14:17:56 -05:00
dependabot[bot]
e5fc027d37 Bump cachix/cachix-action from 14 to 15
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 14 to 15.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v14...v15)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-14 12:37:17 -05:00
dependabot[bot]
29878ac676 Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-14 12:37:00 -05:00
dependabot[bot]
2456af8d0c Bump DeterminateSystems/magic-nix-cache-action from 2 to 7
Bumps [DeterminateSystems/magic-nix-cache-action](https://github.com/determinatesystems/magic-nix-cache-action) from 2 to 7.
- [Release notes](https://github.com/determinatesystems/magic-nix-cache-action/releases)
- [Commits](https://github.com/determinatesystems/magic-nix-cache-action/compare/v2...v7)

---
updated-dependencies:
- dependency-name: DeterminateSystems/magic-nix-cache-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-14 12:36:51 -05:00
727b8476a2
add dependabot 2024-06-14 12:35:52 -05:00
fb09facde4
test better disk reclamation 2024-06-14 12:29:46 -05:00
5783bf1b77
add workflow call 2024-06-14 11:54:54 -05:00
50e96ca6b4
setup nix flake check to run before build 2024-06-14 11:54:03 -05:00
1fe009085b
nix fmt 2024-06-14 11:52:48 -05:00
82d563ac61
flake.lock: Update
Flake lock file updates:

• Updated input 'hyprland':
    'git+https://github.com/hyprwm/Hyprland/?ref=refs/heads/main&rev=5de273a14427cb4a4cad9ac57a22b418bcd4248d' (2024-06-13)
  → 'git+https://github.com/hyprwm/Hyprland/?ref=refs/heads/main&rev=a357fa3e0a60b4f96a1924e0d9753d23001ab00e' (2024-06-14)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/e913ae340076bbb73d9f4d3d065c2bca7caafb16' (2024-06-11)
  → 'github:nixos/nixpkgs/3f84a279f1a6290ce154c5531378acc827836fbb' (2024-06-13)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/8def778b26e7d7f7596633350d739ceebba35ef8' (2024-06-13)
  → 'github:nix-community/nixpkgs-wayland/77f8f21e3475cdf26eeb68ff6711e6861c9d5dc5' (2024-06-14)
• Updated input 'zig2nix':
    'github:Cloudef/zig2nix/30cffd333f1b732cc83b2f3c49bef28c1fbb58f9' (2024-06-13)
  → 'github:Cloudef/zig2nix/d846577330acb4571e837d5c631beeb555988dd0' (2024-06-14)
2024-06-14 10:48:12 -05:00
18273425a0
install cachix on othalan 2024-06-14 10:48:03 -05:00
12 changed files with 209 additions and 40 deletions

55
.github/actions/clean-disk/action.yml vendored Normal file
View file

@ -0,0 +1,55 @@
name: 'Maximize build disk space'
description: 'Maximize the available disk space by removing unneeded software'
runs:
using: "composite"
steps:
- name: Disk space report before modification
shell: bash
run: |
echo "==> Available space before cleanup"
echo
df -h
# sudo du /usr/local -h --max-depth=1 | sort -rh || true
- name: Maximize build disk space
shell: bash
run: |
set -euo pipefail
echo "Removing unwanted software... "
# sudo docker image prune --all --force > /dev/null &
{
sudo apt-get remove -y \
'^aspnetcore-.*' '^dotnet-.*' '^llvm-.*' \
'php.*' '^mongodb-.*' '^mysql-.*' '^google-cloud-*' \
azure-cli google-chrome-stable firefox \
powershell mono-devel libgl1-mesa-dri \
--fix-missing \
> /dev/null
sudo apt-get remove -y docker > /dev/null
sudo apt-get autoremove -y > /dev/null
sudo apt-get clean > /dev/null
} &
wait
df -h
sudo rm -rf /var/lib/docker
df -h
sudo swapoff -a
sudo rm -f /mnt/swapfile &
sudo rm -rf /usr/{local,share} &
sudo rm -rf /opt &
sudo rm -rf "$AGENT_TOOLSDIRECTORY" &
wait
echo "... done"
- name: Disk space report after modification
shell: bash
run: |
echo "==> Available space after cleanup"
echo
df -h

10
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,10 @@
# Set update schedule for GitHub Actions
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"

View file

@ -29,26 +29,45 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# The default disk size of these runners is ~14GB # # The default disk size of these runners is ~14GB
# Cleanup the disk, see upstream discussion https://github.com/actions/runner-images/issues/2840. # # Cleanup the disk, see upstream discussion https://github.com/actions/runner-images/issues/2840.
- name: Cleanup Disk Space # - name: Cleanup Disk Space
run: | # run: |
echo "Before removing files:" # echo "Before removing files:"
df -h # df -h
sudo rm -rf /usr/share/dotnet # sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /opt/ghc # sudo rm -rf /opt
sudo rm -rf /opt # sudo rm -rf /usr/share/dotnet
sudo rm -rf "/usr/local/share/boost" # sudo rm -rf /usr/local/{lib/android,share/boost}
sudo rm -rf "$AGENT_TOOLSDIRECTORY" # sudo docker image prune --all --force
echo "After removing files:" # echo "After removing files:"
df -h # df -h
- name: Maximize build space
uses: AdityaGarg8/remove-unwanted-software@v3
with:
remove-android: 'true'
remove-dotnet: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
remove-large-packages: 'true'
remove-cached-tools: 'true'
remove-swapfile: 'true'
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |
echo "Free space:"
df -h
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@v2 - uses: DeterminateSystems/magic-nix-cache-action@v7
- uses: cachix/cachix-action@v14 - uses: cachix/cachix-action@v15
with: with:
name: daylin name: daylin
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

52
.github/workflows/checks.yml vendored Normal file
View file

@ -0,0 +1,52 @@
name: Run Nix Flake Checks
on:
workflow_call:
workflow_dispatch:
inputs:
lockFile:
description: 'flake.lock file'
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.host }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
# The default disk size of these runners is ~14GB
# Cleanup the disk, see upstream discussion https://github.com/actions/runner-images/issues/2840.
# - name: Cleanup Disk Space
# run: |
# echo "Before removing files:"
# df -h
# sudo rm -rf /usr/share/dotnet
# sudo rm -rf /opt/ghc
# sudo rm -rf /opt
# sudo rm -rf "/usr/local/share/boost"
# sudo rm -rf "$AGENT_TOOLSDIRECTORY"
# echo "After removing files:"
# df -h
- uses: actions/checkout@v4
- uses: ./.github/actions/clean-disk
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@v7
- uses: cachix/cachix-action@v15
with:
name: daylin
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: write lock file
if: "${{ inputs.lockFile != '' }}"
run: |
echo '${{ inputs.lockFile }}' > flake.lock
git diff
- name: Build
run: |
cachix watch-exec daylin -- nix build --accept-flake-config '.#checks.x86_64-linux.packageCheck'

View file

@ -9,7 +9,12 @@ on:
- main - main
jobs: jobs:
checks:
uses: ./.github/workflows/checks.yml
secrets: inherit
build: build:
needs: checks
strategy: strategy:
max-parallel: 1 max-parallel: 1
matrix: matrix:

View file

@ -305,11 +305,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1718292752, "lastModified": 1718376341,
"narHash": "sha256-NFioPAqyQIOuQMPcDezGCpngCP5ShrudUHfFCfN0d7o=", "narHash": "sha256-Xm8EyYgn752O61QHBera4ygQc/izCLyzhwIqYXqUOdA=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "5de273a14427cb4a4cad9ac57a22b418bcd4248d", "rev": "a357fa3e0a60b4f96a1924e0d9753d23001ab00e",
"revCount": 4821, "revCount": 4826,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/hyprwm/Hyprland/" "url": "https://github.com/hyprwm/Hyprland/"
@ -682,11 +682,11 @@
"nixpkgs": "nixpkgs_8" "nixpkgs": "nixpkgs_8"
}, },
"locked": { "locked": {
"lastModified": 1718263016, "lastModified": 1718371238,
"narHash": "sha256-tLaeDJLvwUmAt2Nd5F6ET87RehB6Krt7M3wnS6TMcTM=", "narHash": "sha256-ntSxtwrYlEVsERaC9X7yFGvNVzbz5H5XuiqkdIc4k/4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs-wayland", "repo": "nixpkgs-wayland",
"rev": "8def778b26e7d7f7596633350d739ceebba35ef8", "rev": "77f8f21e3475cdf26eeb68ff6711e6861c9d5dc5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -761,11 +761,11 @@
}, },
"nixpkgs_6": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1718149104, "lastModified": 1718276985,
"narHash": "sha256-Ds1QpobBX2yoUDx9ZruqVGJ/uQPgcXoYuobBguyKEh8=", "narHash": "sha256-u1fA0DYQYdeG+5kDm1bOoGcHtX0rtC7qs2YA2N1X++I=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e913ae340076bbb73d9f4d3d065c2bca7caafb16", "rev": "3f84a279f1a6290ce154c5531378acc827836fbb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1169,11 +1169,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1718241525, "lastModified": 1718327908,
"narHash": "sha256-0Z5pRERV7fgkJsLLuXQfFT+DKFM5DnqjncAKH+7/+bE=", "narHash": "sha256-E3/3urkZTEIaV2afNDniC9Z7Ksxyn6AaVRnrrxxMPZE=",
"owner": "Cloudef", "owner": "Cloudef",
"repo": "zig2nix", "repo": "zig2nix",
"rev": "30cffd333f1b732cc83b2f3c49bef28c1fbb58f9", "rev": "d846577330acb4571e837d5c631beeb555988dd0",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -16,8 +16,6 @@
nixos-wsl.url = "github:nix-community/NixOS-WSL"; nixos-wsl.url = "github:nix-community/NixOS-WSL";
# see todo.md
# hyprland.url = "git+https://github.com/hyprwm/Hyprland/?submodules=1&rev=4cdddcfe466cb21db81af0ac39e51cc15f574da9";
hyprland.url = "git+https://github.com/hyprwm/Hyprland/?submodules=1"; hyprland.url = "git+https://github.com/hyprwm/Hyprland/?submodules=1";
hyprland-contrib.url = "github:hyprwm/contrib"; hyprland-contrib.url = "github:hyprwm/contrib";

View file

@ -24,6 +24,7 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
zk zk
quarto quarto
cachix
]; ];
services.restic.backups.gdrive = { services.restic.backups.gdrive = {

View file

@ -28,6 +28,17 @@ rec {
nixosModules = listToAttrs (findModulesList ../modules); nixosModules = listToAttrs (findModulesList ../modules);
mkPackageCheck =
{ packages, pkgs }:
pkgs.runCommandLocal "build-third-party"
{
src = ./.;
nativeBuildInputs = [ packages ];
}
''
mkdir "$out"
'';
mkSystem = mkSystem =
hostName: hostName:
nixosSystem { nixosSystem {
@ -74,5 +85,24 @@ rec {
packages = oizysPkg; packages = oizysPkg;
devShells = devShells; devShells = devShells;
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style); formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
checks = forAllSystems (pkgs: {
packageCheck = mkPackageCheck {
inherit pkgs;
# make sure lix is in this?
packages = [
pkgs.pixi
pkgs.swww
inputs.tsm.packages.${pkgs.system}.default
inputs.hyprman.packages.${pkgs.system}.default
inputs.roc.packages.${pkgs.system}.full
inputs.roc.packages.${pkgs.system}.lang-server
inputs.zls.outputs.packages.${pkgs.system}.default
inputs.zig2nix.outputs.packages.${pkgs.system}.zig.master.bin
];
};
});
}; };
} }

View file

@ -1,7 +1,6 @@
{ lib, ... }: { lib, ... }:
let let
inherit (builtins) inherit (builtins) filter;
filter;
inherit (lib) inherit (lib)
isNixFile isNixFile
mkOption mkOption
@ -9,8 +8,7 @@ let
literalExpression literalExpression
mdDoc mdDoc
; ;
inherit (lib.filesystem) inherit (lib.filesystem) listFilesRecursive;
listFilesRecursive;
in in
{ {
imports = filter (f: (f != ./default.nix) && (isNixFile f)) (listFilesRecursive ./.); imports = filter (f: (f != ./default.nix) && (isNixFile f)) (listFilesRecursive ./.);

View file

@ -34,7 +34,7 @@
# I'm getting errors related to a non-existent nix-index? # I'm getting errors related to a non-existent nix-index?
programs.nix-index.enableZshIntegration = false; programs.nix-index.enableZshIntegration = false;
programs.nix-index.enableBashIntegration =false; programs.nix-index.enableBashIntegration = false;
programs.nix-index.enableFishIntegration = false; programs.nix-index.enableFishIntegration = false;
nix.settings = { nix.settings = {

11
todo.md
View file

@ -1,10 +1,5 @@
# oizys todo's # oizys todo's
## nix expr
- [ ] find out why pixi on GHA is different from local (possibly from the fetch git step?)
## software ## software
- [ ] lid closed does not engage hyprlock? - [ ] lid closed does not engage hyprlock?
@ -17,4 +12,10 @@
> kernel: ucsi_acpi USBC000:00: possible UCSI driver bug 2 > kernel: ucsi_acpi USBC000:00: possible UCSI driver bug 2
> kernel: ucsi_acpi USBC000:00: error -EINVAL: PPM init failed > kernel: ucsi_acpi USBC000:00: error -EINVAL: PPM init failed
GHA is running out of space to build `othalan`.
I really just want the CI to pre-compile a subset of the packages.
Currently, it just burns resources downloading packages over and over again.
Maybe I could use nix flake checks to accomplish this?
<!-- generated with <3 by daylinmorgan/todo --> <!-- generated with <3 by daylinmorgan/todo -->