This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
71 lines (64 loc) · 2.24 KB
/
NixOS.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: NixOS
#concurrency:
on:
push:
branches: [minimal]
pull_request:
branches: [minimal]
jobs:
build-laptop-minimal:
runs-on: ubuntu-latest
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# when set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
- name: "Create Dir for Mounting moar Disk Space ❄"
run: |
sudo mkdir /nix
- name: "Maximize Disk Space"
uses: easimon/maximize-build-space@v8
with:
build-mount-path: /nix
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
temp-reserve-mb: "100"
swap-size-mb: "4096"
root-reserve-mb: "1024"
- uses: actions/checkout@v3
- name: "Install Nix ❄️"
uses: cachix/install-nix-action@v22
with:
github_access_token: ${{ secrets.TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
- run: nix flake check
- name: "Install Cachix ❄️"
uses: cachix/cachix-action@v12
with:
name: ruixi-rebirth
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
extraPullNames: nix-community
- name: "Build NixOS config ❄️"
run: |
# nix build .#nixosConfigurations.laptop-minimal.config.system.build.toplevel
nix --experimental-features 'nix-command flakes' build -L '.#nixosConfigurations.laptop-minimal.config.system.build.toplevel'
# sudo nix build --profile /nix/var/nix/profiles/system "$(readlink -f result)"
# sudo nix shell -vv "$(readlink -f result)" -c switch-to-configuration switch
- name: "Print nixpkgs version ❄️"
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- name: "Check free space"
run: |
sudo apt install neofetch
neofetch
echo "Free space:"
df -h