Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,30 @@ jobs:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
skipPush: true

- name: Prepare /usr/share/wallpaper and update flake.lock hash/timestamp
run: |
sudo mkdir -p /usr/share/wallpaper
echo "dummy" | sudo tee /usr/share/wallpaper/dummy.jpg
HASH=$(nix hash path /usr/share/wallpaper)
NOW=$(stat -c %Y /usr/share/wallpaper)
echo "Updating wallpapers block: lastModified=$NOW, narHash=$HASH"

# Extract wallpapers block
sed -n '/"wallpapers": {/,/^ },$/p' flake.lock > wallpapers_block.tmp

# Update hash and timestamp
sed -i '0,/"lastModified": [0-9]\+,/{s|"lastModified": [0-9]\+,|"lastModified": '"$NOW"',|}' wallpapers_block.tmp
sed -i 's|"narHash": "[^"]*"|"narHash": "'"$HASH"'"|' wallpapers_block.tmp

# Replace the block in flake.lock
START=$(grep -n '"wallpapers": {' flake.lock | cut -d: -f1)
END=$(awk -v start="$START" 'NR > start && /^ },/ {print NR; exit}' flake.lock)
head -n $((START-1)) flake.lock > flake.lock.new
cat wallpapers_block.tmp >> flake.lock.new
tail -n +$((END+1)) flake.lock >> flake.lock.new
mv flake.lock.new flake.lock
rm wallpapers_block.tmp

- name: Check flake
run: nix flake check --verbose

Expand Down Expand Up @@ -54,6 +78,30 @@ jobs:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
skipPush: true

- name: Prepare /usr/share/wallpaper and update flake.lock hash/timestamp
run: |
sudo mkdir -p /usr/share/wallpaper
echo "dummy" | sudo tee /usr/share/wallpaper/dummy.jpg
HASH=$(nix hash path /usr/share/wallpaper)
NOW=$(stat -c %Y /usr/share/wallpaper)
echo "Updating wallpapers block: lastModified=$NOW, narHash=$HASH"

# Extract wallpapers block
sed -n '/"wallpapers": {/,/^ },$/p' flake.lock > wallpapers_block.tmp

# Update hash and timestamp
sed -i '0,/"lastModified": [0-9]\+,/{s|"lastModified": [0-9]\+,|"lastModified": '"$NOW"',|}' wallpapers_block.tmp
sed -i 's|"narHash": "[^"]*"|"narHash": "'"$HASH"'"|' wallpapers_block.tmp

# Replace the block in flake.lock
START=$(grep -n '"wallpapers": {' flake.lock | cut -d: -f1)
END=$(awk -v start="$START" 'NR > start && /^ },/ {print NR; exit}' flake.lock)
head -n $((START-1)) flake.lock > flake.lock.new
cat wallpapers_block.tmp >> flake.lock.new
tail -n +$((END+1)) flake.lock >> flake.lock.new
mv flake.lock.new flake.lock
rm wallpapers_block.tmp

- name: Evaluate NixOS configuration for ${{ matrix.host }}
run: |
echo "� Evaluating NixOS configuration..."
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,29 @@ jobs:
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}

- name: Prepare /usr/share/wallpaper and update flake.lock hash/timestamp
run: |
sudo mkdir -p /usr/share/wallpaper
echo "dummy" | sudo tee /usr/share/wallpaper/dummy.jpg
HASH=$(nix hash path /usr/share/wallpaper)
NOW=$(stat -c %Y /usr/share/wallpaper)
echo "Updating wallpapers block: lastModified=$NOW, narHash=$HASH"

# Extract wallpapers block
sed -n '/"wallpapers": {/,/^ },$/p' flake.lock > wallpapers_block.tmp

# Update hash and timestamp
sed -i '0,/"lastModified": [0-9]\+,/{s|"lastModified": [0-9]\+,|"lastModified": '"$NOW"',|}' wallpapers_block.tmp
sed -i 's|"narHash": "[^"]*"|"narHash": "'"$HASH"'"|' wallpapers_block.tmp

# Replace the block in flake.lock
START=$(grep -n '"wallpapers": {' flake.lock | cut -d: -f1)
END=$(awk -v start="$START" 'NR > start && /^ },/ {print NR; exit}' flake.lock)
head -n $((START-1)) flake.lock > flake.lock.new
cat wallpapers_block.tmp >> flake.lock.new
tail -n +$((END+1)) flake.lock >> flake.lock.new
mv flake.lock.new flake.lock
rm wallpapers_block.tmp
- name: Check flake syntax
run: nix flake check --verbose

Expand Down Expand Up @@ -56,6 +79,30 @@ jobs:
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}

- name: Prepare /usr/share/wallpaper and update flake.lock hash/timestamp
run: |
sudo mkdir -p /usr/share/wallpaper
echo "dummy" | sudo tee /usr/share/wallpaper/dummy.jpg
HASH=$(nix hash path /usr/share/wallpaper)
NOW=$(stat -c %Y /usr/share/wallpaper)
echo "Updating wallpapers block: lastModified=$NOW, narHash=$HASH"

# Extract wallpapers block
sed -n '/"wallpapers": {/,/^ },$/p' flake.lock > wallpapers_block.tmp

# Update hash and timestamp
sed -i '0,/"lastModified": [0-9]\+,/{s|"lastModified": [0-9]\+,|"lastModified": '"$NOW"',|}' wallpapers_block.tmp
sed -i 's|"narHash": "[^"]*"|"narHash": "'"$HASH"'"|' wallpapers_block.tmp

# Replace the block in flake.lock
START=$(grep -n '"wallpapers": {' flake.lock | cut -d: -f1)
END=$(awk -v start="$START" 'NR > start && /^ },/ {print NR; exit}' flake.lock)
head -n $((START-1)) flake.lock > flake.lock.new
cat wallpapers_block.tmp >> flake.lock.new
tail -n +$((END+1)) flake.lock >> flake.lock.new
mv flake.lock.new flake.lock
rm wallpapers_block.tmp

- name: Dry build NixOS configuration
run: |
nix build .#nixosConfigurations.centaur.config.system.build.toplevel \
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This repository contains a complete NixOS configuration featuring:
### Prerequisites
- NixOS installed with flakes enabled
- Git for cloning this repository
- Ensure `/usr/share/wallpaper/` exists and contains all wallpapers you want to use for theming
Copy link

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation should include instructions on how to create this directory and set proper permissions, as users may not have write access to /usr/share/ by default.

Suggested change
- Ensure `/usr/share/wallpaper/` exists and contains all wallpapers you want to use for theming
- Ensure `/usr/share/wallpaper/` exists and contains all wallpapers you want to use for theming. If the directory does not exist, create it and set the appropriate permissions:
```bash
sudo mkdir -p /usr/share/wallpaper
sudo chmod 755 /usr/share/wallpaper

Copilot uses AI. Check for mistakes.

### Installation

Expand All @@ -37,6 +38,9 @@ chmod +x deploy.sh
./deploy.sh -up
```

### Changing Theme
To change the active theme, edit `flake.nix` and set `activeTheme` to your desired theme (e.g., `themes.mytheme`).

## Architecture

### Flake Structure
Expand Down Expand Up @@ -127,6 +131,23 @@ sudo nix-store --optimize

## Customization

### Adding New Designs (Themes)

To add a new theme:
1. Add your color scheme YAML file to `modules/nixos/themes/` (e.g., `mytheme.yaml`).
2. Add your wallpaper image to `/usr/share/wallpaper/` (e.g., `mytheme.jpg`).
3. Edit `modules/nixos/themes/defaults.nix` to include your new theme:
```nix
mytheme = {
colorScheme = ./mytheme.yaml;
wallpaper = "mytheme.jpg";
};
```

### Changing Theme

To change the active theme, edit `flake.nix` and set `activeTheme` to your desired theme (e.g., `themes.mytheme`).

### Adding New Modules

1. Create module file in appropriate directory:
Expand Down
Loading
Loading