mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 10:30:44 +02:00
Merge branch 'main' into desktop
This commit is contained in:
@@ -2,11 +2,18 @@ name: Sync branches into main
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 14 * * 1"
|
- cron: "0 14 * * 1" # Monday
|
||||||
|
- cron: "0 14 * * 3" # Wednesday
|
||||||
- cron: "0 14 * * 3"
|
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
source:
|
||||||
|
description: Branch to sync into main
|
||||||
|
required: true
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- laptop
|
||||||
|
- desktop
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -17,42 +24,82 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Determine source branch
|
- name: Determine source branch
|
||||||
id: branch
|
id: branch
|
||||||
run: |
|
run: |
|
||||||
DOW=$(date -u +%u)
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
|
echo "source=${{ inputs.source }}" >> "$GITHUB_OUTPUT"
|
||||||
if [ "$DOW" = "1" ]; then
|
exit 0
|
||||||
echo "source=laptop" >> "$GITHUB_OUTPUT"
|
|
||||||
elif [ "$DOW" = "3" ]; then
|
|
||||||
echo "source=desktop" >> "$GITHUB_OUTPUT"
|
|
||||||
else
|
|
||||||
echo "Not a scheduled sync day"
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Create pull request
|
DOW=$(date -u +%u)
|
||||||
id: cpr
|
|
||||||
uses: peter-evans/create-pull-request@v7
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
base: main
|
|
||||||
branch: ${{ steps.branch.outputs.source }}
|
|
||||||
title: "Weekly sync: ${{ steps.branch.outputs.source }} → main"
|
|
||||||
body: |
|
|
||||||
This pull request was created automatically by GitHub Actions.
|
|
||||||
|
|
||||||
If the branch can be merged cleanly, auto-merge will merge it automatically.
|
case "$DOW" in
|
||||||
|
1)
|
||||||
|
echo "source=laptop" >> "$GITHUB_OUTPUT"
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
echo "source=desktop" >> "$GITHUB_OUTPUT"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "No sync scheduled today."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
If there are merge conflicts, this PR will remain open until they are resolved.
|
- name: Check for existing PR
|
||||||
draft: false
|
id: existing
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
PR_NUMBER=$(gh pr list \
|
||||||
|
--base main \
|
||||||
|
--head "${{ steps.branch.outputs.source }}" \
|
||||||
|
--state open \
|
||||||
|
--json number \
|
||||||
|
--jq '.[0].number // empty')
|
||||||
|
|
||||||
|
echo "number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Create PR
|
||||||
|
id: create
|
||||||
|
if: steps.existing.outputs.number == ''
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
gh pr create \
|
||||||
|
--base main \
|
||||||
|
--head "${{ steps.branch.outputs.source }}" \
|
||||||
|
--title "Weekly sync: ${{ steps.branch.outputs.source }} → main" \
|
||||||
|
--body "This pull request was created automatically by GitHub Actions."
|
||||||
|
|
||||||
|
PR_NUMBER=$(gh pr list \
|
||||||
|
--base main \
|
||||||
|
--head "${{ steps.branch.outputs.source }}" \
|
||||||
|
--state open \
|
||||||
|
--json number \
|
||||||
|
--jq '.[0].number')
|
||||||
|
|
||||||
|
echo "number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Determine PR number
|
||||||
|
id: pr
|
||||||
|
run: |
|
||||||
|
if [ -n "${{ steps.existing.outputs.number }}" ]; then
|
||||||
|
echo "number=${{ steps.existing.outputs.number }}" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "number=${{ steps.create.outputs.number }}" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Enable auto-merge
|
- name: Enable auto-merge
|
||||||
if: steps.cpr.outputs.pull-request-number
|
if: steps.pr.outputs.number != ''
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
gh pr merge \
|
gh pr merge \
|
||||||
${{ steps.cpr.outputs.pull-request-number }} \
|
"${{ steps.pr.outputs.number }}" \
|
||||||
--auto \
|
--auto \
|
||||||
--merge
|
--merge
|
||||||
|
|||||||
Generated
-17
@@ -156,22 +156,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"microPlugins-vivify": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1770382657,
|
|
||||||
"narHash": "sha256-yWmIgT90mC9PhzyH/itDbRMmRTiZiwW+Yo0dsHW7ni8=",
|
|
||||||
"ref": "refs/heads/main",
|
|
||||||
"rev": "3c5cb25facf3fc4143bfea9323a60eda65ef8485",
|
|
||||||
"revCount": 8,
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://codeberg.org/gibbert/micro-vivify"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://codeberg.org/gibbert/micro-vivify"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nix-git-cherry-picker": {
|
"nix-git-cherry-picker": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": [
|
"flake-utils": [
|
||||||
@@ -391,7 +375,6 @@
|
|||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"import-tree": "import-tree",
|
"import-tree": "import-tree",
|
||||||
"microPlugins-vivify": "microPlugins-vivify",
|
|
||||||
"nix-git-cherry-picker": "nix-git-cherry-picker",
|
"nix-git-cherry-picker": "nix-git-cherry-picker",
|
||||||
"nixos-grub-themes": "nixos-grub-themes",
|
"nixos-grub-themes": "nixos-grub-themes",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2",
|
||||||
|
|||||||
@@ -45,10 +45,12 @@
|
|||||||
url = "github:nix-community/disko";
|
url = "github:nix-community/disko";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
/*microPlugins-vivify = {
|
/*
|
||||||
|
microPlugins-vivify = {
|
||||||
url = "git+https://codeberg.org/gibbert/micro-vivify";
|
url = "git+https://codeberg.org/gibbert/micro-vivify";
|
||||||
flake = false;
|
flake = false;
|
||||||
};*/
|
};
|
||||||
|
*/
|
||||||
flake-parts = {
|
flake-parts = {
|
||||||
url = "github:hercules-ci/flake-parts";
|
url = "github:hercules-ci/flake-parts";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,9 +2,11 @@ _: {
|
|||||||
flake.homeModules.git = _: {
|
flake.homeModules.git = _: {
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
/*settings = {
|
/*
|
||||||
|
settings = {
|
||||||
init.defaultBranch = "main";
|
init.defaultBranch = "main";
|
||||||
};*/
|
};
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
programs.gh = {
|
programs.gh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -34,13 +34,15 @@
|
|||||||
CPUWeight = 1; # minimum relative CPU share
|
CPUWeight = 1; # minimum relative CPU share
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
/*systemd.user.timers.kdrive-sync = {
|
/*
|
||||||
|
systemd.user.timers.kdrive-sync = {
|
||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
OnBootSec = "1m";
|
OnBootSec = "1m";
|
||||||
OnUnitActiveSec = "5m";
|
OnUnitActiveSec = "5m";
|
||||||
};
|
};
|
||||||
};*/
|
};
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
perSystem = {pkgs, ...}: {
|
perSystem = {pkgs, ...}: {
|
||||||
packages.custom-checkKdrive = pkgs.writeShellApplication {
|
packages.custom-checkKdrive = pkgs.writeShellApplication {
|
||||||
|
|||||||
@@ -33,14 +33,18 @@ _: {
|
|||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
};
|
};
|
||||||
flake.nixosModules.hardware-configuration-desktop = # Do not modify this file! It was generated by ‘nixos-generate-config’
|
flake.nixosModules.hardware-configuration-desktop =
|
||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
config,
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
lib,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = ["vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
|
boot.initrd.availableKernelModules = ["vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
|
||||||
@@ -48,31 +52,31 @@ flake.nixosModules.hardware-configuration-desktop = # Do not modify this file!
|
|||||||
boot.kernelModules = ["kvm-intel"];
|
boot.kernelModules = ["kvm-intel"];
|
||||||
boot.extraModulePackages = [];
|
boot.extraModulePackages = [];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" = {
|
||||||
{ device = "/dev/disk/by-uuid/14bcd132-b4a3-46f2-ac35-3497340de4b2";
|
device = "/dev/disk/by-uuid/14bcd132-b4a3-46f2-ac35-3497340de4b2";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/home" =
|
fileSystems."/home" = {
|
||||||
{ device = "/dev/disk/by-uuid/14bcd132-b4a3-46f2-ac35-3497340de4b2";
|
device = "/dev/disk/by-uuid/14bcd132-b4a3-46f2-ac35-3497340de4b2";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=home"];
|
options = ["subvol=home"];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/nix" =
|
fileSystems."/nix" = {
|
||||||
{ device = "/dev/disk/by-uuid/14bcd132-b4a3-46f2-ac35-3497340de4b2";
|
device = "/dev/disk/by-uuid/14bcd132-b4a3-46f2-ac35-3497340de4b2";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=nix"];
|
options = ["subvol=nix"];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" =
|
fileSystems."/boot" = {
|
||||||
{ device = "/dev/disk/by-uuid/BAB4-34F6";
|
device = "/dev/disk/by-uuid/BAB4-34F6";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
options = ["fmask=0077" "dmask=0077"];
|
options = ["fmask=0077" "dmask=0077"];
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices =
|
swapDevices = [
|
||||||
[ { device = "/dev/disk/by-uuid/ce6f9a68-0517-4f8a-b375-66f2173efe59"; }
|
{device = "/dev/disk/by-uuid/ce6f9a68-0517-4f8a-b375-66f2173efe59";}
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
|||||||
@@ -24,7 +24,8 @@
|
|||||||
gnumake
|
gnumake
|
||||||
go
|
go
|
||||||
direnv
|
direnv
|
||||||
git gh
|
git
|
||||||
|
gh
|
||||||
cling # c interpreter used for coding
|
cling # c interpreter used for coding
|
||||||
# lsp
|
# lsp
|
||||||
clang-tools
|
clang-tools
|
||||||
|
|||||||
@@ -39,8 +39,7 @@
|
|||||||
home.packages = [
|
home.packages = [
|
||||||
inputs.nix-git-cherry-picker.packages.${pkgs.system}.default
|
inputs.nix-git-cherry-picker.packages.${pkgs.system}.default
|
||||||
];
|
];
|
||||||
};
|
home.file.".config/nix-git-cherry-picker/config.json" = {
|
||||||
home.file-".config/nix-git-cherry-picker/config.json" = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
text = ''
|
text = ''
|
||||||
{
|
{
|
||||||
@@ -51,4 +50,5 @@
|
|||||||
'';
|
'';
|
||||||
force = true;
|
force = true;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user